forked from arangodb/arangodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
435 lines (335 loc) · 13.8 KB
/
configure.ac
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
dnl ============================================================================
dnl ArangoDB (c) triAGENS GmbH
dnl ============================================================================
dnl ============================================================================
dnl --SECTION-- triAGENS GmbH Build Environment
dnl ============================================================================
AC_INIT([triAGENS ArangoDB], [2.6.0-devel], [[email protected]], [arangodb], [https://www.arangodb.com])
dnl ----------------------------------------------------------------------------
dnl auxillary directory for install-sh and missing
dnl ----------------------------------------------------------------------------
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
CURRENT_DIR=`pwd`
AC_MSG_NOTICE([configure started in '$CURRENT_DIR])
AC_MSG_NOTICE([with CC='$CC'])
AC_MSG_NOTICE([with CXX='$CXX'])
AC_MSG_NOTICE([with CPPFLAGS='$CPPFLAGS'])
AC_MSG_NOTICE([with CFLAGS='$CFLAGS'])
AC_MSG_NOTICE([with CXXFLAGS='$CXXFLAGS'])
AC_MSG_NOTICE([with LDFLAGS='$LDFLAGS'])
if python -c '
import sys
if sys.version_info.major != 2:
exit(0)
else:
exit(1)
'; then
echo "Compiling V8 requires a python version 2; please adjust your " `which python`
exit 1
fi
dnl ----------------------------------------------------------------------------
dnl grab the configure command, options and flags and store them in m4 variables
dnl ----------------------------------------------------------------------------
if test `expr -- [$]0 : "'.*"` = 0; then
TRI_CONFIGURE_COMMAND="$TRI_CONFIGURE_COMMAND '[$]0'"
else
TRI_CONFIGURE_COMMAND="$TRI_CONFIGURE_COMMAND [$]0"
fi
TRI_CONFIGURE_OPTIONS="$ac_configure_args"
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS EXTRA_LDFLAGS_PROGRAM LIBS CC CXX; do
eval val=\$$var
if test -n "$val"; then
TRI_CONFIGURE_FLAGS="$TRI_CONFIGURE_FLAGS $var='$val'"
fi
done
AC_SUBST(TRI_CONFIGURE_COMMAND)
AC_SUBST(TRI_CONFIGURE_OPTIONS)
AC_SUBST(TRI_CONFIGURE_FLAGS)
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_COMMAND, "$TRI_CONFIGURE_COMMAND", "" , [configure command])
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_OPTIONS, "$TRI_CONFIGURE_OPTIONS", "" , [configure options])
AC_DEFINE_UNQUOTED(TRI_CONFIGURE_FLAGS, "$TRI_CONFIGURE_FLAGS", "" , [configure flags])
dnl ----------------------------------------------------------------------------
dnl grab the git version number if available
dnl ----------------------------------------------------------------------------
if test -d ".git"; then
TRI_REPOSITORY_VERSION=`git describe --all --tags --long --abbrev=40 --dirty="-dirty" 2> /dev/null`
else
TRI_REPOSITORY_VERSION=""
fi
AC_SUBST(TRI_REPOSITORY_VERSION)
AC_DEFINE_UNQUOTED(TRI_REPOSITORY_VERSION, "$TRI_REPOSITORY_VERSION", "" , [repository version])
dnl ============================================================================
dnl --SECTION-- 3RD-PARTY LIBRARIES
dnl ============================================================================
dnl ----------------------------------------------------------------------------
dnl ETCD
dnl ----------------------------------------------------------------------------
AC_ARG_ENABLE(all-in-one-etcd,
AS_HELP_STRING([--enable-all-in-one-etcd], [use supplied etcd from 3rdParty directory (default: yes)]),
[tr_ALL_IN_ONE_ETCD="${enableval:-yes}"],
[tr_ALL_IN_ONE_ETCD=yes]
)
AM_CONDITIONAL(ENABLE_ALL_IN_ONE_ETCD, test "x$tr_ALL_IN_ONE_ETCD" = xyes)
dnl ----------------------------------------------------------------------------
dnl GO
dnl ----------------------------------------------------------------------------
AC_ARG_ENABLE(internal-go,
AS_HELP_STRING([--enable-internal-go], [use go binaries from 3rdParty directory (default: no)]),
[tr_INTERNAL_GO="${enableval:-yes}"],
[tr_INTERNAL_GO=no]
)
AM_CONDITIONAL(ENABLE_INTERNAL_GO, test "x$tr_INTERNAL_GO" = xyes)
if test "x$tr_INTERNAL_GO" = "xno"; then
AC_CHECK_PROG(GO, go, go)
if test "x$GO" = "x"; then
AC_MSG_WARN([no go executable found.])
BASIC_INFO="$BASIC_INFO|GO BINARY: not found"
else
BASIC_INFO="$BASIC_INFO|GO BINARY: $GO"
fi
fi
dnl ============================================================================
dnl --SECTION-- OPTIONS
dnl ============================================================================
dnl ----------------------------------------------------------------------------
dnl RELATIVE PATH
dnl ----------------------------------------------------------------------------
AC_ARG_ENABLE(relative,
AS_HELP_STRING([--enable-relative], [all path are relative to the binary (default: no)]),
[tr_RELATIVE="${enableval:-yes}"],
[tr_RELATIVE=no]
)
AM_CONDITIONAL(ENABLE_RELATIVE, test "x$tr_RELATIVE" = xyes)
if test "x$tr_RELATIVE" != xno; then
BASIC_INFO="$BASIC_INFO|RELATIVE PATHS: enabled"
else
BASIC_INFO="$BASIC_INFO|RELATIVE PATHS: disabled"
fi
dnl ============================================================================
dnl --SECTION-- CONFIGURATION
dnl ============================================================================
m4_include([m4/configure.basics])
AC_PROG_RANLIB
m4_include([m4/configure.logging])
m4_include([m4/configure.largefile])
m4_include([m4/configure.threads])
m4_include([m4/configure.documentation])
m4_include([m4/configure.coverage])
m4_include([m4/configure.maintainer])
AC_CHECK_FUNCS([futimes])
dnl ============================================================================
dnl --SECTION-- EXTERNAL LIBRARIES
dnl ============================================================================
dnl ----------------------------------------------------------------------------
dnl tcmalloc
dnl ----------------------------------------------------------------------------
AC_ARG_ENABLE(tcmalloc,
AS_HELP_STRING([--enable-tcmalloc], [use system-installed tcmalloc library (default: no)]),
[tr_TCMALLOC="${enableval:-yes}"],
[tr_TCMALLOC=no]
)
if test "x$tr_TCMALLOC" = "xyes"; then
AC_MSG_CHECKING([tcmalloc])
AC_SEARCH_LIBS([tc_malloc], [tcmalloc tcmalloc_minimal tcmalloc_debug], [ ], [ AC_MSG_ERROR([unable to find the tc_malloc library function]) ])
fi
AM_CONDITIONAL(ENABLE_TCMALLOC, test "x$tr_TCMALLOC" = xyes)
if test "x$tr_TCMALLOC" = "xyes"; then
TCMALLOC_LIBS="-ltcmalloc"
fi
AC_SUBST(TCMALLOC_LIBS)
if test "x$tr_TCMALLOC" = "xyes"; then
BASIC_INFO="$BASIC_INFO|TCMALLOC support: enabled ($TCMALLOC_LIBS)"
else
BASIC_INFO="$BASIC_INFO|TCMALLOC support: disabled"
fi
dnl ----------------------------------------------------------------------------
dnl -lrt
dnl ----------------------------------------------------------------------------
m4_include([m4/clock_gettime])
AC_CLOCK()
dnl ----------------------------------------------------------------------------
dnl MATH
dnl ----------------------------------------------------------------------------
m4_include([m4/external.math])
dnl ----------------------------------------------------------------------------
dnl READLINE
dnl ----------------------------------------------------------------------------
m4_include([m4/external.readline])
dnl ----------------------------------------------------------------------------
dnl OPENSSL
dnl ----------------------------------------------------------------------------
m4_include([m4/external.openssl])
dnl ----------------------------------------------------------------------------
dnl V8
dnl ----------------------------------------------------------------------------
V8_VERSION="3.31.74.1"
V8_DIR=V8-${V8_VERSION}
V8_CPPFLAGS="-I${srcdir}/3rdParty/${V8_DIR}/include -DTRI_V8_VERSION='\"${V8_VERSION}\"'"
V8_LDFLAGS=""
V8_TARGET="native"
v8_lib_dir=""
AC_ARG_ENABLE(v8-debug,
AS_HELP_STRING([--enable-v8-debug], [build debug version of V8 (default: no)]),
[tr_V8_DEBUG="${enableval:-yes}"],
[tr_V8_DEBUG=no]
)
AM_CONDITIONAL(ENABLE_V8_DEBUG, test "x$tr_V8_DEBUG" = xyes)
if test x$tr_ARM == xyes; then
if test x$tr_V8_DEBUG == xyes; then
V8_TARGET="arm.debug"
else
V8_TARGET="arm.release"
fi
v8_lib_dir="${srcdir}/3rdParty/${V8_DIR}/out/$V8_TARGET/obj.target/tools/gyp"
elif test x$tr_DARWIN == xyes; then
if test "x$tr_BITS" == x64; then
if test x$tr_V8_DEBUG == xyes; then
V8_TARGET="x64.debug"
else
V8_TARGET="x64.release"
fi
else
if test x$tr_V8_DEBUG == xyes; then
V8_TARGET="ia32.debug"
else
V8_TARGET="ia32.release"
fi
fi
v8_lib_dir="${srcdir}/3rdParty/${V8_DIR}/out/$V8_TARGET"
else
if test "x$tr_BITS" == x64; then
if test x$tr_V8_DEBUG == xyes; then
V8_TARGET="x64.debug"
else
V8_TARGET="x64.release"
fi
else
if test x$tr_V8_DEBUG == xyes; then
V8_TARGET="ia32.debug"
else
V8_TARGET="ia32.release"
fi
fi
v8_lib_dir="${srcdir}/3rdParty/${V8_DIR}/out/$V8_TARGET/obj.target/tools/gyp"
fi
V8_LIBS="${v8_lib_dir}/libv8_base.a ${v8_lib_dir}/libv8_libbase.a ${v8_lib_dir}/libv8_libplatform.a ${v8_lib_dir}/libv8_nosnapshot.a"
if test "x$tr_FREEBSD" == xyes; then
V8_LIBS="$V8_LIBS -lexecinfo"
fi
AC_SUBST(V8_VERSION)
AC_SUBST(V8_DIR)
AC_SUBST(V8_CPPFLAGS)
AC_SUBST(V8_LDFLAGS)
AC_SUBST(V8_LIBS)
AC_SUBST(V8_TARGET)
LIB_INFO="$LIB_INFO|V8: 3rdParty version"
LIB_INFO="$LIB_INFO|V8 VERSION: ${V8_VERSION}"
LIB_INFO="$LIB_INFO|V8_TARGET: ${V8_TARGET}"
LIB_INFO="$LIB_INFO|V8_CPPFLAGS: ${V8_CPPFLAGS}"
LIB_INFO="$LIB_INFO|V8_LDFLAGS: ${V8_LDFLAGS}"
LIB_INFO="$LIB_INFO|V8_LIBS: ${V8_LIBS}"
LIB_INFO="$LIB_INFO|."
dnl ----------------------------------------------------------------------------
dnl ICU
dnl ----------------------------------------------------------------------------
ICU_VERSION="52.2"
ICU_CPPFLAGS="-D_REENTRANT -I${srcdir}/3rdParty/${V8_DIR}/third_party/icu/source/common -I${srcdir}/3rdParty/${V8_DIR}/third_party/icu/source/i18n -I${srcdir}/3rdParty/${V8_DIR}/third_party/icu/source/io"
ICU_LDFLAGS=""
if test "x$tr_DARWIN" = xyes; then
icu_lib_dir="${srcdir}/3rdParty/${V8_DIR}/out/$V8_TARGET"
else
icu_lib_dir="${srcdir}/3rdParty/${V8_DIR}/out/$V8_TARGET/obj.target/third_party/icu"
fi
ICU_LIBS="-ldl -lm ${icu_lib_dir}/libicui18n.a ${icu_lib_dir}/libicuuc.a ${icu_lib_dir}/libicudata.a -ldl -lm"
AC_SUBST(ICU_CPPFLAGS)
AC_SUBST(ICU_LDFLAGS)
AC_SUBST(ICU_LIBS)
ICU_CPPFLAGS="${ICU_CPPFLAGS}"
LIB_INFO="$LIB_INFO|ICU: 3rdParty version"
LIB_INFO="$LIB_INFO|ICU VERSION: ${ICU_VERSION}"
LIB_INFO="$LIB_INFO|ICU_CPPFLAGS: ${ICU_CPPFLAGS}"
LIB_INFO="$LIB_INFO|ICU_LDFLAGS: ${ICU_LDFLAGS}"
LIB_INFO="$LIB_INFO|ICU_LIBS: ${ICU_LIBS}"
LIB_INFO="$LIB_INFO|."
dnl ----------------------------------------------------------------------------
dnl LIBEV
dnl ----------------------------------------------------------------------------
LIBEV_VERSION="4.11"
LIBEV_CPPFLAGS="-I${srcdir}/3rdParty/libev -DTRI_LIBEV_VERSION='\"${LIBEV_VERSION}\"'"
LIBEV_CPPFLAGS="${LIBEV_CPPFLAGS}"
LIBEV_LDFLAGS=""
LIBEV_LIBS="${srcdir}/3rdParty/libev/BUILD/.libs/libev.a"
AC_SUBST(LIBEV_VERSION)
AC_SUBST(LIBEV_CPPFLAGS)
AC_SUBST(LIBEV_LDFLAGS)
AC_SUBST(LIBEV_LIBS)
LIB_INFO="$LIB_INFO|LIBEV: 3rdParty version"
LIB_INFO="$LIB_INFO|LIBEV VERSION: ${LIBEV_VERSION}"
LIB_INFO="$LIB_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
LIB_INFO="$LIB_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
LIB_INFO="$LIB_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
LIB_INFO="$LIB_INFO|."
dnl ----------------------------------------------------------------------------
dnl ZLIB
dnl ----------------------------------------------------------------------------
ZLIB_VERSION="1.2.7"
ZLIB_CPPFLAGS=""
ZLIB_LDFLAGS=""
ZLIB_LIBS="${srcdir}/3rdParty/zlib-${ZLIB_VERSION}/libz.a"
AC_SUBST(ZLIB_VERSION)
AC_SUBST(ZLIB_CPPFLAGS)
AC_SUBST(ZLIB_LDFLAGS)
AC_SUBST(ZLIB_LIBS)
LIB_INFO="$LIB_INFO|ZLIB: 3rdParty version"
LIB_INFO="$LIB_INFO|ZLIB VERSION: ${ZLIB_VERSION}"
LIB_INFO="$LIB_INFO|ZLIB_CPPFLAGS: ${ZLIB_CPPFLAGS}"
LIB_INFO="$LIB_INFO|ZLIB_LDFLAGS: ${ZLIB_LDFLAGS}"
LIB_INFO="$LIB_INFO|ZLIB_LIBS: ${ZLIB_LIBS}"
dnl ----------------------------------------------------------------------------
dnl SPLICE
dnl ----------------------------------------------------------------------------
AC_MSG_CHECKING([whether your system knows about splice()])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <unistd.h>
#include <fcntl.h>
],
[
ssize_t sent, pipesize;
int fd, SplicePipe[2];
pipesize = splice(fd, NULL,
SplicePipe[1], NULL,
1,
SPLICE_F_MORE | SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
],
[
ok_splice=yes
AC_DEFINE_UNQUOTED(TRI_LINUX_SPLICE, 1, [true if we have the linux splice api])
AC_MSG_RESULT([yes])
AC_SUBST(TRI_LINUX_SPLICE)
],
[
ok_splice=no
AC_MSG_RESULT([no])
]
)
dnl ============================================================================
dnl --SECTION-- GENERATE FILES
dnl ============================================================================
BUILD_H="\$(top_srcdir)/build.h"
AC_SUBST(BUILD_H)
AC_CONFIG_FILES([Makefile Installation/MacOSX/Bundle/Info.plist])
AC_CONFIG_HEADER([config/config.h lib/Basics/local-configuration.h])
AC_OUTPUT
dnl ============================================================================
dnl --SECTION-- GENERATE INFO
dnl ============================================================================
m4_include([m4/configure.information])
dnl ============================================================================
dnl --SECTION-- END-OF-FILE
dnl ============================================================================
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl [a-zA-Z]\\|dnl --SECTION--\\)"
dnl End: