forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.acr
334 lines (292 loc) · 8.27 KB
/
configure.acr
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
PKGNAME radare2
VERSION 5.9.3
CONTACT pancake ; [email protected]
DESCRIPTION The UNIX-like reverse engineering toolkit ;
LANG_C!
ARG_DISABLE DEBUGGER debugger disable native debugger features ;
USE_DL
USE_PKGCONFIG
R2_BUILDSYSTEM = "make" ;
CHKPRG! PATCH patch
CHKPRG! AR ar
CHKPRG GIT git
CHKPRG GPERF gperf
CHKLIB magic
CHKINC linux/can.h
ARG_WITH USE_MAGIC sysmagic force to use system's magic ;
IFAND HAVE_LIB_MAGIC USE_MAGIC {
USE_LIB_MAGIC = 1 ;
LIBMAGIC = -lmagic ;
}{
USE_LIB_MAGIC = 0 ;
LIBMAGIC = '' ;
}
ARG_DISABLE WANT_THREADS threads disable use of thread apis ;
(( useful for static builds . see sys/static.sh ))
ARG_DISABLE LOADLIBS loadlibs disable loading plugins ;
ARG_ENABLE R_CRITICAL_ENABLED threadsafety enable mutexes in critical code paths ;
ARG_WITHOUT WANT_DYLINK dylink disable support for dynamic loading of plugins ;
ARG_WITHOUT HAVE_FORK fork disable fork ;
ARG_WITHOUT WANT_PTRACE_WRAP ptrace-wrap build ptrace-wrap support needed for the iaito debugger on Linux ;
ARG_WITHOUT WANT_GPERF gperf do not statically link the sdb databases even if gperf is found ;
ARG_WITHOUT WANT_CAPSTONE capstone dont build the capstone dependency ;
IFNOT WANT_GPERF {
HAVE_GPERF = 0 ;
}
ARG_WITH WITH_LIBR libr build libr.a and libr.dylib ;
ARG_WITH WITH_STATIC_THEMES static-themes default themes are compiled and fallback if not available on disk ;
(( CAPSTONE ))
ARG_WITH USE_CSNEXT capstone-next build next branch of the capstone disassembler ;
(( TODO rename to capstone-v5 and capstone-v4 ))
ARG_WITH USE_CS5 capstone5 build v5 branch of capstone5 (default) ;
ARG_WITH USE_CS4 capstone4 build v4 branch of capstone ;
ARG_WITH WITH_CAPSTONE syscapstone force to use system-wide capstone ;
ARG_WITHOUT WITHOUT_SYSCAPSTONE syscapstone avoid the system-wide capstone ;
IF WITH_CAPSTONE {
PKGCFG CAPSTONE_CFLAGS CAPSTONE_LDFLAGS capstone
}
IFAND WITH_CAPSTONE HAVE_PKGCFG_CAPSTONE {
USE_CAPSTONE = 1 ;
}{
USE_CAPSTONE = 0 ;
}
IFNOT WITHOUT_SYSCAPSTONE {
USE_CAPSTONE = 0 ;
HAVE_PKGCFG_CAPSTONE = 0 ;
CAPSTONE_CFLAGS = "" ;
CAPSTONE_LDFLAGS = "" ;
}
(( LZ4 ))
PKGCFG LZ4_CFLAGS LZ4_LDFLAGS liblz4
ARG_WITH WITH_SYSLZ4 syslz4 force to use system's liblz4 ;
IFAND WITH_SYSLZ4 HAVE_PKGCFG_LIBLZ4 {
USE_SYSLZ4 = 1 ;
}{
USE_SYSLZ4 = 0 ;
}
(( ZIP ))
CHKLIB z
CHKLIB zip
ARG_WITH USE_ZIP syszip force to use system's libzip and zlib ;
IFAND HAVE_LIB_Z USE_ZIP {
IF HAVE_LIB_ZIP {
USE_LIB_ZIP = 1 ;
LIBZIP = -lz -lzip ;
}{
USE_LIB_ZIP = 0 ;
LIBZIP = '' ; (( static linking to shlr/zip ))
}
}{
USE_LIB_ZIP = 0 ;
LIBZIP = '' ; (( static linking to shlr/zip ))
}
CHKLIB xxhash
ARG_WITH USE_XXHASH sysxxhash force to use system's xxhash ;
IFAND HAVE_LIB_XXHASH USE_XXHASH {
USE_LIB_XXHASH = 1 ;
LIBXXHASH = -lxxhash ;
}{
USE_LIB_XXHASH = 0 ;
LIBXXHASH = '' ;
}
ARG_WITHOUT WITH_GPL gpl do not build GPL code (grub, cxx, ... ) ;
CHKDECL sys/personality.h ADDR_NO_RANDOMIZE
CHKDECL features.h __GLIBC__
CHKFNC c arc4random_uniform
CHKFNC c explicit_bzero
CHKFNC c explicit_memset
CHKFNC c clock_nanosleep
CHKFNC c sigaction
CHKFNC c clock_gettime
IFNOT HAVE_CLOCK_GETTIME {
IF HAVE_DECL___GLIBC__ {
CLOCK_LDFLAGS += '-lrt' ;
}
}
CHKFLG SUPPORT_GNU99 -std=gnu99 ;
(( TODO must deprecate
CHKLIB gmp
ARG_WITHOUT HAVE_GMP gmp disable GMP dependency ;
IFNOT HAVE_GMP { HAVE_LIB_GMP = 0 ; }
HAVE_GMP = 0 ;
))
HAVE_LIB_GMP = 0 ;
(( openssl is used for https:// in rsocket and crypto/hash ))
ARG_WITH WANT_SSL ssl build with (Open|Boring|..)SSL if possible ;
ARG_WITH WANT_SSL_CRYPTO ssl-crypto build crypto code with libssl ;
IFNOT WANT_SSL {
HAVE_OPENSSL = 0 ;
SSL_CFLAGS = "" ;
SSL_LDFLAGS = "" ;
}{
CHKLIB ssl
PKGCFG SSL_CFLAGS SSL_LDFLAGS openssl
IFNOTNULL SSL_LDFLAGS {
HAVE_OPENSSL = 1 ;
}
IFNULL SSL_LDFLAGS {
IFNOT HAVE_LIB_SSL {
HAVE_OPENSSL = 0 ;
}{
SSL_LDFLAGS = -lssl ;
}
}
IFAND WANT_SSL_CRYPTO HAVE_OPENSSL {
WANT_SSL_CRYPTO = 1 ;
}{
WANT_SSL_CRYPTO = 0 ;
}
}
ARG_WITH WANT_LIBUV libuv use libuv if available ;
CHKVER libuv 1.0.0
IF HAVE_LIBUV_VERSION_1_0_0 {
PKGCFG LIBUV_CFLAGS LIBUV_LDFLAGS libuv
IFNOTNULL LIBUV_LDFLAGS {
HAVE_LIBUV = 1 ;
}{
HAVE_LIBUV = 0 ;
}
IFNOT WANT_LIBUV {
HAVE_LIBUV = 0 ;
}
}{
HAVE_LIBUV = 0 ;
}
ARG_WITH USE_NEW_ABI new-abi use the new ABI breaking changes scheduled for the next major release ;
ARG_WITH USE_RPATH rpath use rpath to build ;
(( rules for the compiler ))
ARG_WITH USERCC=gcc compiler Define compiler to use (see mk/) ;
ARG_WITH USEROSTYPE=auto ostype Choose OS ( android windows wsl mingw32 bsd solaris gnulinux darwin haiku ) ;
(( TODO: throw error if unknown ostype ))
(( TODO: handle BSD os as different ostype? ))
IFEQ USEROSTYPE auto ; {
IFEQ HOST_OS mingw32_nt-6.2 ; {
USEROSTYPE = mingw32 ;
}{
IFEQ HOST_OS mingw32_nt ; {
USEROSTYPE = mingw32 ;
}{
IFEQ HOST_OS wsl ; {
USEROSTYPE = wsl ;
}{
IFEQ HOST_OS linux ; {
USEROSTYPE = gnulinux ;
}{
IFEQ HOST_OS serenityos ; {
USEROSTYPE = serenityos ;
HAVE_LIB_DL = 1 ;
DL_LIBS = -ldl ;
}{
IFEQ HOST_OS gnu ; {
(( GNU / HURD ))
USEROSTYPE = gnulinux ;
HAVE_LIB_DL = 1 ;
DL_LIBS = -ldl ;
}{
IFEQ HOST_OS sunos ; {
USEROSTYPE = solaris ;
}{
IFEQ HOST_OS gnu/kfreebsd ; {
USEROSTYPE = bsd ;
}{
IFEQ HOST_OS netbsd ; {
USEROSTYPE = bsd ;
}{
IFEQ HOST_OS freebsd ; {
USEROSTYPE = bsd ;
}{
IFEQ HOST_OS openbsd ; {
USEROSTYPE = bsd ;
}{
IFEQ HOST_OS darwin ; {
USEROSTYPE = darwin ;
}{
IFEQ HOST_OS haiku ; {
USEROSTYPE = haiku ;
}{
IFEQ HOST_OS aix ; {
USEROSTYPE = aix ;
} } } } } } } } } } } } } }
}
(( this hack is required for openbsd ports ))
ARG_WITH LIBVERSION=xxx libversion specify different libversion ;
ARG_WITHOUT HAVE_JEMALLOC jemalloc build without jemalloc ;
IFEQ LIBVERSION xxx ; {
LIBVERSION = $VERSION ;
}
IFEQ USEROSTYPE gnulinux ; {
HAVE_PTRACE = 1 ;
USE_PTRACE_WRAP = 1 ;
}{
IFEQ USEROSTYPE wsl ; {
BUILD = ${SPLIT_CPU}-unknown-linux-gnu ;
HOST = $BUILD ;
TARGET = $HOST ;
USEROSTYPE = gnulinux ;
HAVE_PTRACE = 1 ;
USE_PTRACE_WRAP = 0 ;
}{
IFEQ USEROSTYPE android ; {
HAVE_PTRACE = 1 ;
USE_PTRACE_WRAP = 1 ;
}{
IFEQ USEROSTYPE mingw32 ; {
HAVE_PTRACE = 0 ;
USE_PTRACE_WRAP = 0 ;
}{
IFEQ USEROSTYPE solaris ; {
HAVE_PTRACE = 0 ;
USE_PTRACE_WRAP = 0 ;
}{
IFEQ USEROSTYPE haiku ; {
HAVE_PTRACE = 0 ;
USE_PTRACE_WRAP = 0 ;
}{
IFEQ USEROSTYPE aix ; {
HAVE_PTRACE = 0 ;
USE_PTRACE_WRAP = 0 ;
}{
HAVE_PTRACE = 1 ;
USE_PTRACE_WRAP = 0 ;
} } } } } } }
IFNOT DEBUGGER {
HAVE_PTRACE = 0 ;
}
IFEQ WANT_PTRACE_WRAP 0 ; {
USE_PTRACE_WRAP = 0 ;
}
ARG_WITH R_CHECKS_LEVEL=2 checks-level value between 0 and 3 to enable different level of assert (see R_CHECKS_LEVEL) ;
ARG_DISABLE WANT_DEBUGSTUFF debug-stuff disable the log messages and disable control-c ;
REPORT
BUILD CC CFLAGS DEBUGGER HAVE_ARC4RANDOM_UNIFORM HAVE_EXPLICIT_BZERO USE_NEW_ABI
HAVE_EXPLICIT_MEMSET HAVE_FORK HAVE_GPERF HAVE_LIBUV HAVE_LIB_GMP WANT_DEBUGSTUFF
HAVE_OPENSSL WANT_SSL_CRYPTO HAVE_PTRACE HOST LDFLAGS LIBVERSION PKGCONFIG PREFIX
R_CHECKS_LEVEL TARGET USERCC USEROSTYPE USE_CAPSTONE USE_LIB_MAGIC NEW_IO_CACHE
USE_LIB_XXHASH USE_LIB_ZIP USE_PTRACE_WRAP USE_SYSLZ4 VERSION WANT_DYLINK USE_SMALLZ4
;
PKGCFG_DO pkgcfg/r_egg.pc r_egg r_asm r_syscall r_util r_reg r_flag r_cons ;
PKGCFG_DO pkgcfg/r_io.pc r_io r_util r_socket r_cons r_crypto ;
PKGCFG_DO pkgcfg/r_esil.pc r_esil r_util r_reg ;
PKGCFG_DO pkgcfg/r_cons.pc r_cons r_util ;
PKGCFG_DO pkgcfg/r_socket.pc r_socket r_util ;
PKGCFG_DO pkgcfg/r_reg.pc r_reg r_util ;
PKGCFG_DO pkgcfg/r_bp.pc r_bp r_util ;
PKGCFG_DO pkgcfg/r_flag.pc r_flag r_util ;
PKGCFG_DO pkgcfg/r_bin.pc r_bin r_util r_io r_socket r_magic ;
PKGCFG_DO pkgcfg/r_lang.pc r_lang r_util ;
PKGCFG_DO pkgcfg/r_syscall.pc r_syscall r_util ;
PKGCFG_DO pkgcfg/r_config.pc r_config r_util ;
PKGCFG_DO pkgcfg/r_fs.pc r_fs r_util r_io ;
PKGCFG_DO pkgcfg/r_util.pc r_util ;
PKGCFG_DO pkgcfg/r_magic.pc r_magic r_util ;
PKGCFG_DO pkgcfg/r_search.pc r_search r_util ;
PKGCFG_DO pkgcfg/r_arch.pc r_arch r_util r_reg r_esil ;
PKGCFG_DO pkgcfg/r_crypto.pc r_crypto r_util ;
PKGCFG_DO pkgcfg/r_anal.pc r_anal r_util r_reg r_syscall r_search r_cons r_flag r_crypto r_arch r_esil ;
PKGCFG_DO pkgcfg/r_asm.pc r_asm r_util r_reg r_syscall r_search r_cons r_flag r_crypto r_arch r_esil ;
PKGCFG_DO pkgcfg/r_debug.pc r_debug r_util ;
/* TODO: Add the rest of .pc files here.. add a rule for acr? */
SUBDIRS ./config-user.mk
libr/include/r_userconf.h
pkgcfg/r_core.pc
;