Skip to content

Commit 37792e2

Browse files
committed
Only build correct capstone support for the machine
1 parent 896e9d7 commit 37792e2

File tree

1 file changed

+23
-0
lines changed
  • ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/capstone/tasks

1 file changed

+23
-0
lines changed

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/capstone/tasks/main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
when:
3636
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES")
3737
- capstone_installed.rc != 0
38+
- (ansible_architecture !+ "riscv64")
3839
tags: capstone_source
3940

4041
- name: Extract capstone {{ capstone_version }}
@@ -45,13 +46,35 @@
4546
when:
4647
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES")
4748
- capstone_installed.rc != 0
49+
- (ansible_architecture !+ "riscv64")
4850
tags: capstone_source
4951

52+
- name: Set architecture variable for x64
53+
set_fact: capstone_architecture=X86
54+
when: ansible_architecture == "x86_64"
55+
56+
- name: Set architecture variable for arm32
57+
set_fact: capstone_architecture=ARM
58+
when: ansible_architecture == "armv7l"
59+
60+
- name: Set architecture variable for aarch64
61+
set_fact: capstone_architecture=Aarch64
62+
when: ansible_architecture == "aarch64"
63+
64+
- name: Set architecture variable for ppc64le
65+
set_fact: capstone_architecture=PowerPC
66+
when: ansible_architecture == "ppc64le"
67+
68+
- name: Set architecture variable for s390x
69+
set_fact: capstone_architecture=SystemZ
70+
when: ansible_architecture == "s390x"
71+
5072
- name: Build and install capstone {{ capstone_version }}
5173
shell: cd /tmp/capstone-{{ capstone_version }}} && ./make.sh && PREFIX=/usr/local ./make.sh install
5274
when:
5375
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES")
5476
- capstone_installed.rc != 0
77+
- (ansible_architecture !+ "riscv64")
5578
tags: capstone_source
5679

5780
- name: Remove downloaded packages for capstone {{ capstone_version }}

0 commit comments

Comments
 (0)