File: cmake.sh

package info (click to toggle)
capstone 5.0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,212 kB
  • sloc: ansic: 96,103; cpp: 67,489; cs: 29,510; python: 25,829; pascal: 24,412; java: 15,582; ml: 14,473; makefile: 1,274; sh: 479; ruby: 386
file content (72 lines) | stat: -rwxr-xr-x 1,129 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh

# Capstone disassembler engine (www.capstone-engine.org)
# Build Capstone libs for specified architecture, or all if none is specified (libcapstone.so & libcapstone.a) on *nix with CMake & make
# By Nguyen Anh Quynh, Jorn Vernee, 2019

CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release"
# Uncomment below line to compile in Diet mode
# CMAKE_FLAGS+=" -DCAPSTONE_BUILD_DIET=ON"

case $1 in
  ARM)
    ARCH=ARM
    ;;
  ARM64)
    ARCH=ARM64
    ;;
  M68K)
    ARCH=M68K
    ;;
  MIPS)
    ARCH=MIPS
    ;;
  PowerPC)
    ARCH=PPC
    ;;
  Sparc)
    ARCH=SPARC
    ;;
  SystemZ)
    ARCH=SYSZ
    ;;
  XCore)
    ARCH=XCORE
    ;;
  x86)
    ARCH=X86
    ;;
  TMS320C64x)
    ARCH=TMS320C64X
    ;;
  M680x)
    ARCH=M680X
    ;;
  EVM)
    ARCH=EVM
    ;;
  MOS65XX)
    ARCH=MOS65XX
    ;;
  WASM)
    ARCH=WASM
    ;;
  BPF)
    ARCH=BPF
    ;;
  RISCV)
    ARCH=RISCV
    ;;
  *)
    ;;
esac

if [ -z "${ARCH}" ]; then
  CMAKE_FLAGS="${CMAKE_FLAGS} -DCAPSTONE_ARCHITECTURE_DEFAULT=ON"
else
  CMAKE_FLAGS="${CMAKE_FLAGS} -DCAPSTONE_ARCHITECTURE_DEFAULT=OFF -DCAPSTONE_${ARCH}_SUPPORT=ON"
fi

cmake ${CMAKE_FLAGS} ..

make -j8