Skip to content

Commit

Permalink
Only build correct capstone support for the machine
Browse files Browse the repository at this point in the history
  • Loading branch information
sxa committed Jul 6, 2023
1 parent 4e0f16f commit d32f9af
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
when:
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES")
- capstone_installed.rc != 0
- (ansible_architecture !+ "riscv64")
tags: capstone_source

- name: Extract capstone {{ capstone_version }}
Expand All @@ -45,13 +46,35 @@
when:
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "SLES")
- capstone_installed.rc != 0
- (ansible_architecture !+ "riscv64")
tags: capstone_source

- name: Set architecture variable for x64
set_fact: capstone_architecture=x86
when: ansible_architecture == "x86_64"

- name: Set architecture variable for arm32
set_fact: capstone_architecture=arm
when: ansible_architecture == "armv7l"

- name: Set architecture variable for aarch64
set_fact: capstone_architecture=aarch64
when: ansible_architecture == "aarch64"

- name: Set architecture variable for ppc64le
set_fact: capstone_architecture=powerpc
when: ansible_architecture == "ppc64le"

- name: Set architecture variable for s390x
set_fact: capstone_architecture=systemz
when: ansible_architecture == "s390x"

- name: Build and install capstone {{ capstone_version }}
shell: cd /tmp/capstone-{{ capstone_version }}} && ./make.sh && PREFIX=/usr/local ./make.sh install
shell: cd /tmp/capstone-{{ capstone_version }}} && CAPSTONE_ARCHS={{ capstone_architcture }}./make.sh && PREFIX=/usr/local ./make.sh install
when:
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES")
- capstone_installed.rc != 0
- (ansible_architecture !+ "riscv64")
tags: capstone_source

- name: Remove downloaded packages for capstone {{ capstone_version }}
Expand Down

0 comments on commit d32f9af

Please sign in to comment.