Nguyen Anh Quynh | d03edf4 | 2014-03-02 10:20:37 +0800 | [diff] [blame] | 1 | # This file contains all customized compile options for Capstone. |
Nguyen Anh Quynh | 838b378 | 2014-03-04 18:20:28 +0800 | [diff] [blame] | 2 | # Modify it before building step. Consult docs/README for details. |
Nguyen Anh Quynh | d03edf4 | 2014-03-02 10:20:37 +0800 | [diff] [blame] | 3 | |
Nguyen Anh Quynh | fc83a43 | 2014-02-22 23:26:27 +0800 | [diff] [blame] | 4 | ################################################################################ |
Nguyen Anh Quynh | 3b53fc4 | 2014-02-28 11:05:01 +0800 | [diff] [blame] | 5 | # Specify which archs you want to compile in. By default, we build all archs. |
danghvu | 6f52bf9 | 2013-12-19 22:43:01 -0600 | [diff] [blame] | 6 | |
Nguyen Anh Quynh | 52a8d2a | 2014-05-26 23:24:11 +0800 | [diff] [blame] | 7 | CAPSTONE_ARCHS ?= arm aarch64 mips powerpc sparc systemz x86 xcore |
Nguyen Anh Quynh | 7e5a6b5 | 2014-02-23 00:47:38 +0800 | [diff] [blame] | 8 | |
| 9 | |
| 10 | ################################################################################ |
Nguyen Anh Quynh | e31327d | 2014-04-29 14:25:15 +0800 | [diff] [blame] | 11 | # Comment out the line below ('CAPSTONE_USE_SYS_DYN_MEM = yes'), or change it to |
| 12 | # 'CAPSTONE_USE_SYS_DYN_MEM = no' if do NOT use malloc/calloc/realloc/free/ |
| 13 | # vsnprintf() provided by system for internal dynamic memory management. |
Nguyen Anh Quynh | 7e5a6b5 | 2014-02-23 00:47:38 +0800 | [diff] [blame] | 14 | # |
Nguyen Anh Quynh | b6ece8d | 2014-03-07 21:46:45 +0800 | [diff] [blame] | 15 | # NOTE: in that case, specify your own malloc/calloc/realloc/free/vsnprintf() |
Nguyen Anh Quynh | 951e8e5 | 2014-03-01 23:24:09 +0800 | [diff] [blame] | 16 | # functions in your program via API cs_option(), using CS_OPT_MEM option type. |
Nguyen Anh Quynh | d03edf4 | 2014-03-02 10:20:37 +0800 | [diff] [blame] | 17 | |
Nguyen Anh Quynh | e31327d | 2014-04-29 14:25:15 +0800 | [diff] [blame] | 18 | CAPSTONE_USE_SYS_DYN_MEM ?= yes |
Nguyen Anh Quynh | 7e5a6b5 | 2014-02-23 00:47:38 +0800 | [diff] [blame] | 19 | |
| 20 | |
| 21 | ################################################################################ |
| 22 | # Change 'CAPSTONE_DIET = no' to 'CAPSTONE_DIET = yes' to make the library |
| 23 | # more compact: use less memory & smaller in binary size. |
Nguyen Anh Quynh | d5ca145 | 2014-02-24 22:13:29 +0800 | [diff] [blame] | 24 | # This setup will remove the @mnemonic & @op_str data, plus semantic information |
Nguyen Anh Quynh | 838b378 | 2014-03-04 18:20:28 +0800 | [diff] [blame] | 25 | # such as @regs_read/write & @group. The amount of binary size reduced is |
| 26 | # up to 50% in some individual archs. |
Nguyen Anh Quynh | 7e5a6b5 | 2014-02-23 00:47:38 +0800 | [diff] [blame] | 27 | # |
| 28 | # NOTE: we still keep all those related fileds @mnemonic, @op_str, @regs_read, |
Nguyen Anh Quynh | d5ca145 | 2014-02-24 22:13:29 +0800 | [diff] [blame] | 29 | # @regs_write, @groups, etc in fields in cs_insn structure regardless, but they |
Nguyen Anh Quynh | 838b378 | 2014-03-04 18:20:28 +0800 | [diff] [blame] | 30 | # will not be updated (i.e empty), thus become irrelevant. |
Nguyen Anh Quynh | d03edf4 | 2014-03-02 10:20:37 +0800 | [diff] [blame] | 31 | |
Nguyen Anh Quynh | dc09a9a | 2014-04-29 12:59:01 +0800 | [diff] [blame] | 32 | CAPSTONE_DIET ?= no |
Nguyen Anh Quynh | 9518148 | 2014-03-25 23:20:41 +0800 | [diff] [blame] | 33 | |
| 34 | |
| 35 | ################################################################################ |
Nguyen Anh Quynh | 59b5489 | 2014-03-27 10:54:44 +0800 | [diff] [blame] | 36 | # Change 'CAPSTONE_X86_REDUCE = no' to 'CAPSTONE_X86_REDUCE = yes' to remove |
Nguyen Anh Quynh | 6d3c711 | 2014-03-27 15:38:23 +0800 | [diff] [blame] | 37 | # non-critical instruction sets of X86, making the binary size smaller by ~60%. |
Nguyen Anh Quynh | 9518148 | 2014-03-25 23:20:41 +0800 | [diff] [blame] | 38 | # This is desired in special cases, such as OS kernel, where these kind of |
| 39 | # instructions are not used. |
| 40 | # |
| 41 | # The list of instruction sets to be removed includes: |
Nguyen Anh Quynh | 01d8a49 | 2014-03-26 14:49:19 +0800 | [diff] [blame] | 42 | # - Floating Point Unit (FPU) |
| 43 | # - MultiMedia eXtension (MMX) |
| 44 | # - Streaming SIMD Extensions (SSE) |
| 45 | # - 3DNow |
| 46 | # - Advanced Vector Extensions (AVX) |
| 47 | # - Fused Multiply Add Operations (FMA) |
| 48 | # - eXtended Operations (XOP) |
Nguyen Anh Quynh | 01d8a49 | 2014-03-26 14:49:19 +0800 | [diff] [blame] | 49 | # - Transactional Synchronization Extensions (TSX) |
Nguyen Anh Quynh | 9518148 | 2014-03-25 23:20:41 +0800 | [diff] [blame] | 50 | # |
| 51 | # Due to this removal, the related instructions are nolonger supported. |
| 52 | # |
Nguyen Anh Quynh | 59b5489 | 2014-03-27 10:54:44 +0800 | [diff] [blame] | 53 | # By default, Capstone is compiled with 'CAPSTONE_X86_REDUCE = no', |
Nguyen Anh Quynh | 5fbcc9e | 2014-03-26 16:20:25 +0800 | [diff] [blame] | 54 | # thus supports complete X86 instructions. |
Nguyen Anh Quynh | 9518148 | 2014-03-25 23:20:41 +0800 | [diff] [blame] | 55 | |
Nguyen Anh Quynh | dc09a9a | 2014-04-29 12:59:01 +0800 | [diff] [blame] | 56 | CAPSTONE_X86_REDUCE ?= no |
Ole André Vadla Ravnås | 927fcbc | 2014-05-01 16:00:52 +0200 | [diff] [blame] | 57 | |
| 58 | |
| 59 | ################################################################################ |
| 60 | # Change 'CAPSTONE_STATIC = yes' to 'CAPSTONE_STATIC = no' to avoid building |
| 61 | # a static library. |
| 62 | |
| 63 | CAPSTONE_STATIC ?= yes |
| 64 | |
| 65 | |
| 66 | ################################################################################ |
| 67 | # Change 'CAPSTONE_SHARED = yes' to 'CAPSTONE_SHARED = no' to avoid building |
| 68 | # a shared library. |
| 69 | |
| 70 | CAPSTONE_SHARED ?= yes |