summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/build_posix/aclocal/options.m4
blob: 0fe512c0c8c53c482b2d1ce3d30455b088b39f38 (plain)
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
# Optional configuration.
AC_DEFUN([AM_OPTIONS], [

AH_TEMPLATE(HAVE_ATTACH, [Define to 1 to pause for debugger attach on failure.])
AC_MSG_CHECKING(if --enable-attach option specified)
AC_ARG_ENABLE(attach,
	[AS_HELP_STRING([--enable-attach],
	    [Configure for debugger attach on failure.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_attach=no;;
*)	AC_DEFINE(HAVE_ATTACH)
	wt_cv_enable_attach=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_attach)

AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_LZ4,
	    [LZ4 support automatically loaded.])
AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_SNAPPY,
	    [Snappy support automatically loaded.])
AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_ZLIB,
	    [Zlib support automatically loaded.])
AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_ZSTD,
	    [ZSTD support automatically loaded.])
AH_TEMPLATE(HAVE_BUILTIN_EXTENSION_SODIUM,
	    [Sodium support automatically loaded.])
AC_MSG_CHECKING(if --with-builtins option specified)
AC_ARG_WITH(builtins,
	[AS_HELP_STRING([--with-builtins],
	    [builtin extension names (lz4, snappy, zlib, zstd, sodium).])],
	    [with_builtins=$withval],
	    [with_builtins=])

# Validate and setup each builtin extension library.
builtin_list=`echo "$with_builtins"|tr -s , ' '`
for builtin_i in $builtin_list; do
	case "$builtin_i" in
	lz4)	AC_DEFINE(HAVE_BUILTIN_EXTENSION_LZ4)
		wt_cv_with_builtin_extension_lz4=yes;;
	snappy)	AC_DEFINE(HAVE_BUILTIN_EXTENSION_SNAPPY)
		wt_cv_with_builtin_extension_snappy=yes;;
	zlib)	AC_DEFINE(HAVE_BUILTIN_EXTENSION_ZLIB)
		wt_cv_with_builtin_extension_zlib=yes;;
	zstd)	AC_DEFINE(HAVE_BUILTIN_EXTENSION_ZSTD)
		wt_cv_with_builtin_extension_zstd=yes;;
	sodium)	AC_DEFINE(HAVE_BUILTIN_EXTENSION_SODIUM)
		wt_cv_with_builtin_extension_sodium=yes;;
	*)	AC_MSG_ERROR([Unknown builtin extension "$builtin_i"]);;
	esac
done
AM_CONDITIONAL([HAVE_BUILTIN_EXTENSION_LZ4],
    [test "$wt_cv_with_builtin_extension_lz4" = "yes"])
AM_CONDITIONAL([HAVE_BUILTIN_EXTENSION_SNAPPY],
    [test "$wt_cv_with_builtin_extension_snappy" = "yes"])
AM_CONDITIONAL([HAVE_BUILTIN_EXTENSION_ZLIB],
    [test "$wt_cv_with_builtin_extension_zlib" = "yes"])
AM_CONDITIONAL([HAVE_BUILTIN_EXTENSION_ZSTD],
    [test "$wt_cv_with_builtin_extension_zstd" = "yes"])
AM_CONDITIONAL([HAVE_BUILTIN_EXTENSION_SODIUM],
    [test "$wt_cv_with_builtin_extension_sodium" = "yes"])
AC_MSG_RESULT($with_builtins)

AH_TEMPLATE(HAVE_DIAGNOSTIC, [Define to 1 for diagnostic tests.])
AC_MSG_CHECKING(if --enable-diagnostic option specified)
AC_ARG_ENABLE(diagnostic,
	[AS_HELP_STRING([--enable-diagnostic],
	    [Configure for diagnostic tests.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_diagnostic=no;;
*)	AC_DEFINE(HAVE_DIAGNOSTIC)
	wt_cv_enable_diagnostic=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_diagnostic)

AC_MSG_CHECKING(if --enable-python option specified)
AC_ARG_ENABLE(python,
	[AS_HELP_STRING([--enable-python],
	    [Configure the python API.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_python=no;;
*)	if test "$enable_shared" = "no"; then
		AC_MSG_ERROR([--enable-python requires shared libraries])
	fi
	wt_cv_enable_python=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_python)
AM_CONDITIONAL([PYTHON], [test x$wt_cv_enable_python = xyes])

AC_MSG_CHECKING(if --with-python-prefix option specified)
AC_ARG_WITH(python-prefix,
	[AS_HELP_STRING([--with-python-prefix=DIR],
	    [Installation prefix for Python module.])])
AC_MSG_RESULT($with_python_prefix)

AC_MSG_CHECKING(if --enable-snappy option specified)
AC_ARG_ENABLE(snappy,
	[AS_HELP_STRING([--enable-snappy],
	    [Build the snappy compressor extension.])], r=$enableval, r=no)
case "$r" in
no)	if test "$wt_cv_with_builtin_extension_snappy" = "yes"; then
		wt_cv_enable_snappy=yes
	else
		wt_cv_enable_snappy=no
	fi
	;;
*)	if test "$wt_cv_with_builtin_extension_snappy" = "yes"; then
		AC_MSG_ERROR(
		   [Only one of --enable-snappy --with-builtins=snappy allowed])
	fi
	wt_cv_enable_snappy=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_snappy)
if test "$wt_cv_enable_snappy" = "yes"; then
	AC_CHECK_HEADER(snappy-c.h,,
	    [AC_MSG_ERROR([--enable-snappy requires snappy.h])])
	AC_CHECK_LIB(snappy, snappy_compress,,
	    [AC_MSG_ERROR([--enable-snappy requires snappy library])])
fi
AM_CONDITIONAL([SNAPPY], [test "$wt_cv_enable_snappy" = "yes"])

AC_MSG_CHECKING(if --enable-lz4 option specified)
AC_ARG_ENABLE(lz4,
	[AS_HELP_STRING([--enable-lz4],
	    [Build the lz4 compressor extension.])], r=$enableval, r=no)
case "$r" in
no)	if test "$wt_cv_with_builtin_extension_lz4" = "yes"; then
		wt_cv_enable_lz4=yes
	else
		wt_cv_enable_lz4=no
	fi
	;;
*)	if test "$wt_cv_with_builtin_extension_lz4" = "yes"; then
		AC_MSG_ERROR(
		   [Only one of --enable-lz4 --with-builtins=lz4 allowed])
	fi
	wt_cv_enable_lz4=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_lz4)
if test "$wt_cv_enable_lz4" = "yes"; then
	AC_CHECK_HEADER(lz4.h,,
	    [AC_MSG_ERROR([--enable-lz4 requires lz4.h])])
	AC_CHECK_LIB(lz4, LZ4_compress_destSize,,
	    [AC_MSG_ERROR([--enable-lz4 requires lz4 library with LZ4_compress_destSize support])])
fi
AM_CONDITIONAL([LZ4], [test "$wt_cv_enable_lz4" = "yes"])

AC_MSG_CHECKING(if --enable-sodium option specified)
AC_ARG_ENABLE(sodium,
	[AS_HELP_STRING([--enable-sodium],
	    [Build the libsodium encryptor extension.])], r=$enableval, r=no)
case "$r" in
no)	if test "$wt_cv_with_builtin_extension_sodium" = "yes"; then
		wt_cv_enable_sodium=yes
	else
		wt_cv_enable_sodium=no
	fi
	;;
*)	if test "$wt_cv_with_builtin_extension_sodium" = "yes"; then
		AC_MSG_ERROR(
		   [Only one of --enable-sodium --with-builtins=sodium allowed])
	fi
	wt_cv_enable_sodium=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_sodium)
if test "$wt_cv_enable_sodium" = "yes"; then
	AC_CHECK_HEADER(sodium.h,,
	    [AC_MSG_ERROR([--enable-sodium requires sodium.h])])
	AC_CHECK_LIB(sodium, sodium_init,,
	    [AC_MSG_ERROR([--enable-sodium requires sodium library])])
fi
AM_CONDITIONAL([SODIUM], [test "$wt_cv_enable_sodium" = "yes"])

AC_MSG_CHECKING(if --enable-tcmalloc option specified)
AC_ARG_ENABLE(tcmalloc,
	[AS_HELP_STRING([--enable-tcmalloc],
	    [Build WiredTiger with tcmalloc.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_tcmalloc=no;;
*)	wt_cv_enable_tcmalloc=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_tcmalloc)
if test "$wt_cv_enable_tcmalloc" = "yes"; then
	AC_CHECK_HEADER(gperftools/tcmalloc.h,,
	    [AC_MSG_ERROR([--enable-tcmalloc requires gperftools/tcmalloc.h])])
	AC_CHECK_LIB(tcmalloc, tc_calloc,,
	    [AC_MSG_ERROR([--enable-tcmalloc requires tcmalloc library])])
fi
AM_CONDITIONAL([TCMalloc], [test "$wt_cv_enable_tcmalloc" = "yes"])

AC_MSG_CHECKING(if --enable-memkind option specified)
AC_ARG_ENABLE(memkind,
	[AS_HELP_STRING([--enable-memkind],
	    [Memkind library enables using memory on Optane NVRAM. Enable if planning to use NVRAM block cache.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_memkind=no;;
*)	wt_cv_enable_memkind=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_memkind)
if test "$wt_cv_enable_memkind" = "yes"; then
	AC_CHECK_HEADER(memkind.h,,
	    [AC_MSG_ERROR([--enable-memkind requires memkind.h])])
	AC_CHECK_LIB(memkind, memkind_get_version,,
	    [AC_MSG_ERROR([--enable-memkind requires memkind library])])
fi
AM_CONDITIONAL([Memkind], [test "$wt_cv_enable_memkind" = "yes"])

AH_TEMPLATE(SPINLOCK_TYPE, [Spinlock type from mutex.h.])
AC_MSG_CHECKING(if --with-spinlock option specified)
AC_ARG_WITH(spinlock,
	[AS_HELP_STRING([--with-spinlock],
	    [Spinlock type (pthread, pthread_adaptive or gcc).])],
	    [],
	    [with_spinlock=pthread])
case "$with_spinlock" in
gcc)	AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_GCC);;
pthread|pthreads)
	AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX);;
pthread_adaptive|pthreads_adaptive)
	AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX_ADAPTIVE);;
*)	AC_MSG_ERROR([Unknown spinlock type "$with_spinlock"]);;
esac
AC_MSG_RESULT($with_spinlock)

AC_MSG_CHECKING(if --enable-strict option specified)
AC_ARG_ENABLE(strict,
	[AS_HELP_STRING([--enable-strict],
	    [Enable strict compiler checking.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_strict=no;;
*)	wt_cv_enable_strict=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_strict)

AC_MSG_CHECKING(if --enable-zlib option specified)
AC_ARG_ENABLE(zlib,
	[AS_HELP_STRING([--enable-zlib],
	    [Build the zlib compressor extension.])], r=$enableval, r=no)
case "$r" in
no)	if test "$wt_cv_with_builtin_extension_zlib" = "yes"; then
		wt_cv_enable_zlib=yes
	else
		wt_cv_enable_zlib=no
	fi
	;;
*)	if test "$wt_cv_with_builtin_extension_zlib" = "yes"; then
		AC_MSG_ERROR(
		   [Only one of --enable-zlib --with-builtins=zlib allowed])
	fi
	wt_cv_enable_zlib=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_zlib)
if test "$wt_cv_enable_zlib" = "yes"; then
	AC_CHECK_HEADER(zlib.h,,
	    [AC_MSG_ERROR([--enable-zlib requires zlib.h])])
	AC_CHECK_LIB(z, deflate,,
	    [AC_MSG_ERROR([--enable-zlib requires zlib library])])
fi
AM_CONDITIONAL([ZLIB], [test "$wt_cv_enable_zlib" = "yes"])

AC_MSG_CHECKING(if --enable-zstd option specified)
AC_ARG_ENABLE(zstd,
	[AS_HELP_STRING([--enable-zstd],
	    [Build the zstd compressor extension.])], r=$enableval, r=no)
case "$r" in
no)	if test "$wt_cv_with_builtin_extension_zstd" = "yes"; then
		wt_cv_enable_zstd=yes
	else
		wt_cv_enable_zstd=no
	fi
	;;
*)	if test "$wt_cv_with_builtin_extension_zstd" = "yes"; then
		AC_MSG_ERROR(
		   [Only one of --enable-zstd --with-builtins=zstd allowed])
	fi
	wt_cv_enable_zstd=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_zstd)
if test "$wt_cv_enable_zstd" = "yes"; then
	AC_CHECK_HEADER(zstd.h,,
	    [AC_MSG_ERROR([--enable-zstd requires zstd.h])])
	AC_CHECK_LIB(zstd, ZSTD_compress,,
	    [AC_MSG_ERROR([--enable-zstd requires Zstd library])])
fi
AM_CONDITIONAL([ZSTD], [test "$wt_cv_enable_zstd" = "yes"])

AH_TEMPLATE(HAVE_NO_CRC32_HARDWARE,
    [Define to 1 to disable any crc32 hardware support.])
AC_MSG_CHECKING(if --disable-crc32-hardware option specified)
AC_ARG_ENABLE(crc32-hardware,
	[AS_HELP_STRING([--disable-crc32-hardware],
	    [Disable any crc32 hardware support.])], r=$enableval, r=yes)
case "$r" in
no)	wt_cv_crc32_hardware=no
	AC_DEFINE(HAVE_NO_CRC32_HARDWARE)
	AC_MSG_RESULT(yes);;
*)	wt_cv_crc32_hardware=yes
	AC_MSG_RESULT(no);;
esac

AH_TEMPLATE(WT_STANDALONE_BUILD,
    [Define to 1 to support standalone build.])
AC_MSG_CHECKING(if --disable-standalone-build option specified)
AC_ARG_ENABLE(standalone-build,
       [AS_HELP_STRING([--disable-standalone-build],
           [Disable standalone build support.])], r=$enableval, r=yes)
case "$r" in
no)    wt_cv_disable_standalone_build=no
	   AC_MSG_RESULT(yes);;
*)     wt_cv_disable_standalone_build=yes
	   AC_DEFINE(WT_STANDALONE_BUILD)
	   AC_MSG_RESULT(no);;
esac

AC_MSG_CHECKING(if --enable-llvm option specified)
AC_ARG_ENABLE(llvm,
	[AS_HELP_STRING([--enable-llvm],
	    [Configure with LLVM.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_llvm=no;;
*)	wt_cv_enable_llvm=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_llvm)
if test "$wt_cv_enable_llvm" = "yes"; then
	AC_CHECK_PROG(wt_cv_llvm_config, llvm-config, yes)
	if test "$wt_cv_llvm_config" != "yes"; then
		AC_MSG_ERROR([--enable-llvm requires llvm-config])
	fi
	if ! test $(llvm-config --version | grep "^8"); then
		AC_MSG_ERROR([llvm-config must be version 8])
	fi
fi
AM_CONDITIONAL([LLVM], [test x$wt_cv_enable_llvm = xyes])

AC_MSG_CHECKING(if --enable-libfuzzer option specified)
AC_ARG_ENABLE(libfuzzer,
	[AS_HELP_STRING([--enable-libfuzzer],
		[Configure with LibFuzzer.])], r=$enableval, r=no)
case "$r" in
no)	wt_cv_enable_libfuzzer=no;;
*)	wt_cv_enable_libfuzzer=yes;;
esac
AC_MSG_RESULT($wt_cv_enable_libfuzzer)
if test "$wt_cv_enable_libfuzzer" = "yes"; then
	AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer-no-link], [wt_cv_libfuzzer_works=yes])
        if test "$wt_cv_libfuzzer_works" != "yes"; then
		AC_MSG_ERROR([--enable-libfuzzer requires a Clang version that supports -fsanitize=fuzzer-no-link])
	fi
fi
AM_CONDITIONAL([LIBFUZZER], [test x$wt_cv_enable_libfuzzer = xyes])
])