-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathconfigure.in
447 lines (379 loc) · 17.9 KB
/
configure.in
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
436
437
438
439
440
441
442
443
444
445
446
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([voipmonitor],[VERSION],[[email protected]])
AC_CONFIG_SRCDIR([voipmonitor.cpp])
AC_CONFIG_HEADERS([config.h])
#AC_ARG_VAR([CFLAGS], [compiler flags for C])
#AC_ARG_VAR([CXXFLAGS], [compiler flags for C++])
AC_ARG_VAR([CFLAGS], [compiler flags for C code])
if test "x$CFLAGS" = "x"; then
CFLAGS=''
fi
AC_ARG_VAR([CXXFLAGS], [compiler flags for C++ code])
if test "x$CXXFLAGS" = "x"; then
CXXFLAGS=''
fi
# test platform
PLATFORM=`uname`
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_ARG_WITH(openssl-dir, [ --with-openssl-dir=PATH path to openssl lib directory ], [
TMPOPENSSLDIRLIB=-L$withval/lib
TMPOPENSSLDIRINC=-I$withval/include
AC_SUBST([OPENSSLDIRLIB], [$TMPOPENSSLDIRLIB])
AC_SUBST([OPENSSLDIRINC], [$TMPOPENSSLDIRINC])
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TMPOPENSSLDIRLIB"
LDFLAGS="$LDFLAGS $TMPOPENSSLDIRLIB"
])
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lc':
AC_CHECK_LIB([c], [main])
# FIXME: Replace `main' with a function in `-lcrypt':
AC_CHECK_LIB([crypt], [main])
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([dl], [main], AC_SUBST([LIBLD],["-ldl"]), AC_MSG_NOTICE([Unable to find libdl. Safe to ignore on FreeBSD as the functionality is provided by libc.]))
# FIXME: Replace `main' with a function in `-lltdl':
AC_CHECK_LIB([ltdl], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-lodbc':
AC_CHECK_LIB([odbc], [main], , AC_MSG_ERROR([Unable to find odbc library. Debian: apt-get install unixodbc-dev. Centos/Redhat: yum install unixODBC-devel]))
# FIXME: Replace `main' with a function in `-logg':
AC_CHECK_LIB([ogg], [main], , AC_MSG_ERROR([Unable to find OGG library. Debian: apt-get install libvorbis-dev. Centos/Redhat: yum install libogg-devel libvorbis-devel]))
# FIXME: Replace `main' with a function in `-lpcap':
AC_CHECK_LIB([pcap], [main], ,AC_MSG_ERROR([Unable to find libpcap library. Debian: apt-get install libpcap-dev. Centos/Redhat: yum install libpcap-devel]))
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [main])
# FIXME: Replace `main' with a function in `-lrt':
AC_CHECK_LIB([rt], [main])
# FIXME: Replace `main' with a function in `-lssl':
AC_CHECK_LIB([ssl], [main], HAVE_OPENSSL=1 , AC_MSG_ERROR([Unable to find ssl library. apt-get install libssl-dev | yum install openssl-devel]))
# FIXME: Replace `main' with a function in `-lvorbis':
AC_CHECK_LIB([vorbis], [main], ,AC_MSG_ERROR([Unable to find VORBIS library. Debian: apt-get install libvorbis-dev. Centos/Redhat: yum install libogg-devel libvorbis-devel]))
# FIXME: Replace `main' with a function in `-lvorbisenc':
AC_CHECK_LIB([vorbisenc], [main], ,AC_MSG_ERROR([Unable to find VORBISENC library. Debian: apt-get install libvorbis-dev. Centos/Redhat: yum install libogg-devel libvorbis-devel]))
# FIXME: Replace `main' with a function in `-lz':
AC_CHECK_LIB([snappy], [main], ,AC_MSG_ERROR([Unable to find snappy library. apt-get install libsnappy-dev | yum install snappy-devel.x86_64 | or compile from source: https://snappy.googlecode.com/files/snappy-1.1.0.tar.gz]))
AC_CHECK_LIB([curl], [main], , AC_MSG_ERROR([Unable to find curl library. apt-get install libcurl4-openssl-dev | yum install libcurl-devel]))
AC_CHECK_LIB([icuuc], [main], , AC_MSG_ERROR([Unable to find libicuuc library. apt-get install libicu-dev | yum install libicu-devel]))
CURL_CFG='curl-config'
CURL_VER_MAJOR=`$CURL_CFG --version | cut -d" " -f2 | cut -d"." -f1`
CURL_VER_MINOR=`$CURL_CFG --version | cut -d" " -f2 | cut -d"." -f2`
if test -z $CURL_VER_MAJOR || test -z $CURL_VER_MINOR; then
AC_MSG_ERROR([Can't get about curl's version. $CURL_CFG binary is needed.])
fi
if (test $CURL_VER_MAJOR -eq 7 && test $CURL_VER_MINOR -ge 34) || test $CURL_VER_MAJOR -ge 8; then
AC_MSG_NOTICE([Curl version is ok ($CURL_VER_MAJOR.$CURL_VER_MINOR).])
else
AC_MSG_ERROR([Bad curl version ($CURL_VER_MAJOR.$CURL_VER_MINOR). Version 7.34 or higher is required.])
fi
AC_CHECK_LIB([json], [main], LIBJSON_NAME='json')
AC_CHECK_LIB([json-c], [main], LIBJSON_NAME='json-c')
AC_CHECK_LIB([png], [main], HAVE_LIBPNG=1, AC_MSG_WARN([Unable to find libpng library. apt-get install libpng-dev | yum install libpng-devel]))
AC_CHECK_LIB([jpeg], [main], HAVE_LIBJPEG=1, AC_MSG_NOTICE([Unable to find jpeg library. apt-get install libjpeg-dev | yum install libjpeg-devel]))
AC_CHECK_LIB([fftw3], [main], HAVE_LIBFFT=1, AC_MSG_WARN([Unable to find libfftw3 library. apt-get install libfftw3-dev | yum install fftw-devel]))
if test "x$LIBJSON_NAME" = "x"; then
AC_MSG_ERROR([Unable to find json(-c) library. apt-get install libjson-c-dev | yum install json-c-devel (RPM from EPEL) | pkg install json-c | or compile from source: git clone https://github.com/json-c/json-c.git; cd json-c; sh autogen.sh; ./configure; make; make install;ldconfig])
else
AC_SUBST([LIBJSON_NAME],["$LIBJSON_NAME"])
fi
AC_CHECK_DECLS([LN_aes_128_gcm], HAVE_OPENSSL101=1, AC_MSG_WARN([disabling tls - ssl is too old - you need >= 1.0.1]), [[#include <openssl/obj_mac.h>]])
AC_CHECK_LIB([rrd], [main], , AC_MSG_ERROR([Unable to find librrd library. apt-get install librrd-dev | yum install rrdtool-devel | or compile from source http://oss.oetiker.ch/rrdtool/doc/librrd.en.html]))
AC_CHECK_LIB([glib-2.0], [main], , AC_MSG_ERROR([Unable to find libglib library. apt-get install libglib2.0-dev | yum install glib2-devel]))
AC_CHECK_LIB([xml2], [main], , AC_MSG_ERROR([Unable to find xml2 library. apt-get install libxml2-dev | yum install libxml2-devel]))
AC_CHECK_LIB([blake3], [blake3_hasher_init], HAVE_LIBBLAKE3=1, AC_MSG_NOTICE([Unable to find blake3 library. yum install blake3-devel or compile from source]))
AC_CHECK_LIB([whisper], [main], HAVE_LIBWHISPER=1, AC_MSG_NOTICE([Unable to find whisper library. You can compile it from https://github.com/ggerganov/whisper.cpp]))
AC_ARG_WITH(libc-dir, [ --with-libc-dir=PATH path to explicit libc directory (for static building)], [
TMPLIBCDIRLIB=-L$withval/lib
TMPLIBCDIRINC=-I$withval/include
AC_SUBST([LIBCDIRLIB], [$TMPLIBCDIRLIB])
AC_SUBST([LIBCDIRINC], [$TMPLIBCDIRINC])
])
AC_ARG_WITH(dpdk-include, [ --with-dpdk-include=PATH path to explicit include files], [
TMPDPDK=-I$withval
AC_SUBST([DPDKINCLUDE], [$TMPDPDK])
], [
])
AC_ARG_WITH(dpdk-lib, [ --with-dpdk-lib=PATH path to explicit lib files], [
TMPDPDKLIB=-L$withval
AC_SUBST([DPDKLIBRARY], [$TMPDPDKLIB])
], [
])
# Check for MySQL libraries (or MariaDB)
AC_MSG_CHECKING(for mysql_config executable)
AC_ARG_WITH(mysql, [ --with-mysql=PATH path to mysql_config binary or mysql prefix dir], [
if test -x $withval -a -f $withval
then
MYSQL_CONFIG=$withval
elif test -x $withval/bin/mysql_config -a -f $withval/bin/mysql_config
then
MYSQL_CONFIG=$withval/bin/mysql_config
fi
], [
if test -x /usr/local/mysql/bin/mysql_config -a -f /usr/local/mysql/bin/mysql_config
then
MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
elif test -x /usr/bin/mysql_config -a -f /usr/bin/mysql_config
then
MYSQL_CONFIG=/usr/bin/mysql_config
elif test -x /usr/local/bin/mysql_config -a -f /usr/local/bin/mysql_config
then
MYSQL_CONFIG=/usr/local/bin/mysql_config
fi
])
if test "x$MYSQL_CONFIG" = "x"
then
AC_MSG_RESULT(not found - apt-get install libmysqlclient-dev | yum install mysql-devel or yum install mysql-community-devel)
exit 3
else
AC_SUBST([MYSQLCFLAGS],[`$MYSQL_CONFIG --cflags`])
MYSQLLDFLAGS_LIBS=`$MYSQL_CONFIG --libs`
MYSQLLDFLAGS_LIBS_SYS=`$MYSQL_CONFIG --libs_sys 2>/dev/null`
# check if the --libx_sys ends with error or Usage (some mysql_config does not return $?=1 if paramteters is not supported
AS_IF([test $? -eq 0], [AS_IF([test "x`echo $MYSQLLDFLAGS_LIBS_SYS | grep 'Usage'`" = "x"], [], [MYSQLLDFLAGS_LIBS_SYS="$MYSQLLDFLAGS_LIBS"])], [MYSQLLDFLAGS_LIBS_SYS="$MYSQLLDFLAGS_LIBS"])
MYSQLLDFLAGS="$MYSQLLDFLAGS_LIBS_SYS $MYSQLLDFLAGS_LIBS"
LDFLAGS="$LDFLAGS $MYSQLLDFLAGS"
AC_SUBST([MYSQLLIB],[$MYSQLLDFLAGS])
AC_SUBST([MYSQLINCLUDE],[`$MYSQL_CONFIG --include`])
AC_MSG_RESULT($MYSQL_CONFIG)
fi
AC_CHECK_LIB([mysqlclient], [main], , AC_MSG_ERROR([Unable to find libmysqlclient. apt-get install libmysqlclient-dev | yum install mysql-devel or yum install mysql-community-devel| pkg install mysql56-client]))
# check if mysql knows the MYSQL_OPT_SSL_* options
# mariadb 10.3 don't know --cxxflags option in mysql_config
ORIGCFLAGS=$CFLAGS
ORIGCXXFLAGS=$CXXFLAGS
CFLAGS=`$MYSQL_CONFIG --cflags`
CXXFLAGS=`$MYSQL_CONFIG --cflags`
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <mysql.h>]],
[[ int i = MYSQL_OPT_SSL_ENFORCE;]])],
[AC_MSG_NOTICE([Mariadb SSL options found.])], [AC_SUBST([NO_MARIADB_SSL_SUPPORT],["yes"])])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <mysql.h>]],
[[ int i = MYSQL_OPT_SSL_MODE;]])],
[AC_MSG_NOTICE([Mysql SSL options found.])], [AC_SUBST([NO_MYSQL_SSL_SUPPORT],["yes"])])
AS_IF([test "x$NO_MARIADB_SSL_SUPPORT" = "xyes"], [AS_IF([test "x$NO_MYSQL_SSL_SUPPORT" = "xyes"],[AC_SUBST([MYSQL_WITHOUT_SSL_SUPPORT],["yes"])AC_MSG_NOTICE([Mariadb/MYSQL SSL options NOT found!])])])
CFLAGS=$ORIGCFLAGS
CXXFLAGS=$ORIGCXXFLAGS
AC_CHECK_LIB([z], [main], , AC_MSG_ERROR([Unable to find libz. apt-get install zlib1g-dev | yum install zlib-devel]))
AC_CHECK_LIB([zstd], [main], HAVE_LIBZSTD=1, AC_MSG_ERROR([Unable to find zstd. apt-get install libzstd-dev]))
if ! pkg-config --atleast-version 1.4.4 libzstd; then
AC_MSG_ERROR([The version of zstd must be at least 1.4.4. You can compile it from this source: https://github.com/facebook/zstd.])
fi
AC_CHECK_LIB([lz4], [main], HAVE_LIBLZ4=1, AC_MSG_ERROR([Unable to find lz4. apt-get install liblz4-dev]))
AC_CHECK_LIB([lzma], [main], HAVE_LIBLZMA=1, AC_MSG_NOTICE([Unable to find lzma. apt-get install liblzma-dev | yum install xz-devel]))
AC_CHECK_LIB([lzo2], [main], HAVE_LIBLZO=1, AC_MSG_ERROR([Unable to find lzo. apt-get install liblzo2-dev | yum install lzo-devel]))
AC_CHECK_LIB([gnutls], [gnutls_init], HAVE_LIBGNUTLS=1, AC_MSG_NOTICE([Unable to find gnutls - disabling SIP TLS decoder. apt-get install gnutls-dev | yum install gnutls-devel]))
AC_CHECK_LIB([gcrypt], [gcry_check_version], HAVE_LIBGCRYPT=1, AC_MSG_NOTICE([Unable to find libgcrypt - disabling SIP TLS decoder. apt-get install libgcrypt-dev | yum install libgcrypt-devel]))
AC_ARG_WITH(heap_profiler, [ --with-heap_profiler use tcmalloc library with heap profiler], [
HEAPPROF=1
], [
HEAPPROF=0
])
if test "x$HEAPPROF" = "x1"
then
AC_CHECK_LIB([tcmalloc], [tc_malloc], HAVE_LIBTCMALLOC_HEAPPROF=1, AC_MSG_NOTICE([Unable to find tcmalloc library which speeds up threads by 10%. The library is optional: apt-get install libgoogle-perftools-dev | yum install gperftools-devel.x86_64 | or compile from source https://code.google.com/p/gperftools/]))
else
AC_CHECK_LIB([tcmalloc_minimal], [tc_malloc], HAVE_LIBTCMALLOC=1, AC_MSG_NOTICE([Unable to find tcmalloc_minimal library which speeds up threads by 10%. The library is optional: apt-get install libgoogle-perftools-dev | yum install gperftools-devel.x86_64 | or compile from source https://code.google.com/p/gperftools/]))
fi
AC_ARG_ENABLE([dpdk], AS_HELP_STRING([--disable-dpdk], [Disable searching for dpdk libs (librte_*)]))
AS_IF([test "x$enable_dpdk" != "xno"], [AC_CHECK_LIB([rte_net], [main], HAVE_LIBDPDK=1)])
HAVE_LIBPNG_T=no
if test "x$HAVE_LIBPNG" = "x1"; then
AC_DEFINE([HAVE_LIBPNG], [1], [Define if using libpng])
AC_SUBST([LIBPNG],["-lpng"])
HAVE_LIBPNG_T=yes
fi
HAVE_LIBJPEG_T=no
if test "x$HAVE_LIBJPEG" = "x1"; then
AC_DEFINE([HAVE_LIBJPEG], [1], [Define if using libjpeg])
AC_SUBST([LIBJPEG],["-ljpeg"])
HAVE_LIBJPEG_T=yes
fi
HAVE_LIBFFT_T=no
if test "x$HAVE_LIBFFT" = "x1"; then
AC_DEFINE([HAVE_LIBFFT], [1], [Define if using libfftw3])
AC_SUBST([LIBFFT],["-lfftw3 -lfftw3_threads"])
HAVE_LIBFFT_T=yes
fi
HAVE_LIBZSTD_T=no
if test "x$HAVE_LIBZSTD" = "x1"; then
AC_DEFINE([HAVE_LIBZSTD], [1], [Define if using libzstd])
AC_SUBST([LIBZSTD],["-lzstd"])
HAVE_LIBZSTD_T=yes
fi
HAVE_LIBLZ4_T=no
if test "x$HAVE_LIBLZ4" = "x1"; then
AC_DEFINE([HAVE_LIBLZ4], [1], [Define if using liblz4])
AC_SUBST([LIBLZ4],["-llz4"])
HAVE_LIBLZ4_T=yes
fi
HAVE_LIBLZMA_T=no
if test "x$HAVE_LIBLZMA" = "x1"; then
AC_DEFINE([HAVE_LIBLZMA], [1], [Define if using liblzma])
AC_SUBST([LIBLZMA],["-llzma"])
HAVE_LIBLZMA_T=yes
fi
HAVE_LIBLZO_T=no
if test "x$HAVE_LIBLZO" = "x1"; then
AC_DEFINE([HAVE_LIBLZO], [1], [Define if using liblzo])
AC_SUBST([LIBLZO],["-llzo2"])
HAVE_LIBLZO_T=yes
fi
LIBGNUTLS_T=no
if test "x$HAVE_LIBGNUTLS" = "x1" && test "x$HAVE_LIBGCRYPT" = "x1"; then
AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if using gnutls])
AC_SUBST([LIBGNUTLS],["-lgcrypt -lgnutls"])
AC_SUBST([LIBGNUTLSSTATIC],["-lgcrypt -lgnutls -lnettle -lhogweed -lgmp -lgpg-error -lpthread "])
LIBGNUTLS_T=yes
fi
TCMALLOC_T=no
if test "x$HAVE_LIBTCMALLOC" = "x1"; then
AC_DEFINE([HAVE_LIBTCMALLOC], [1], [Define if using libtcmalloc_minimal])
AC_SUBST([LIBTCMALLOC],["-ltcmalloc_minimal"])
TCMALLOC_T=yes
fi
if test "x$HAVE_LIBTCMALLOC_HEAPPROF" = "x1"; then
AC_DEFINE([HAVE_LIBTCMALLOC], [1], [Define if using libtcmalloc_minimal])
AC_DEFINE([HAVE_LIBTCMALLOC_HEAPPROF], [1], [Define if using libtcmalloc (with heap profiler)])
AC_SUBST([LIBTCMALLOC],["-ltcmalloc"])
AC_SUBST([HEAPPROF_CXXFLAG],["-fno-omit-frame-pointer"])
TCMALLOC_T="yes (with heap profiler)"
fi
HAVE_OPENSSL_T=no
if test "x$HAVE_OPENSSL" = "x1"; then
AC_DEFINE([HAVE_OPENSSL], [1], [Define if using openssl])
HAVE_OPENSSL_T=yes
fi
OPENSSL101_T=no
if test "x$HAVE_OPENSSL101" = "x1"; then
AC_DEFINE([HAVE_OPENSSL101], [1], [Define if using openssl >= 1.0.1])
OPENSSL101_T=yes
fi
OPENSSL111_T=no
if pkg-config --atleast-version 1.1.1 openssl; then
AC_DEFINE([HAVE_DSSL_TLS13], [1], [Define if we have openssl >= 1.1.1])
OPENSSL111_T=yes
fi
DPDK_T=no
if test "x$HAVE_LIBDPDK" = "x1"; then
AC_DEFINE([HAVE_LIBDPDK], [1], [Define if using dpdk])
AC_SUBST([DPDK_CFLAGS],[`"$PKGCONFIG" --cflags libdpdk`])
AC_SUBST([DPDK_LDFLAGS],[`"$PKGCONFIG" --libs libdpdk`])
AC_SUBST([DPDK_LDFLAGSSTATIC],[`"$PKGCONFIG" --static --libs libdpdk`])
DPDK_T=yes
fi
HAVE_LIBBLAKE3_T=no
if test "x$HAVE_LIBBLAKE3" = "x1"; then
AC_DEFINE([HAVE_LIBBLAKE3], [1], [Define if using libblake3])
AC_SUBST([LIBBLAKE3],["-lblake3"])
HAVE_LIBBLAKE3_T=yes
fi
HAVE_LIBWHISPER_T=no
if test "x$HAVE_LIBWHISPER" = "x1"; then
AC_DEFINE([HAVE_LIBWHISPER], [1], [Define if using libwhisper])
AC_SUBST([LIBWHISPER],["-lwhisper"])
HAVE_LIBWHISPER_T=yes
fi
# Checks for header files.
#AC_FUNC_ALLOCA
#AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_INLINE
#AC_TYPE_INT16_T
#AC_TYPE_INT32_T
#AC_TYPE_INT64_T
#AC_TYPE_MODE_T
#AC_TYPE_OFF_T
#AC_TYPE_PID_T
#AC_TYPE_SIZE_T
#AC_TYPE_UINT16_T
#AC_TYPE_UINT32_T
#AC_TYPE_UINT64_T
#AC_TYPE_UINT8_T
# Checks for library functions.
#AC_FUNC_ERROR_AT_LINE
#AC_FUNC_FORK
#AC_FUNC_FSEEKO
#AC_FUNC_MALLOC
#AC_FUNC_REALLOC
#AC_FUNC_STRNLEN
#AC_FUNC_STRTOD
#AC_CHECK_FUNCS([gethostbyname gettimeofday inet_ntoa memmove memset mkdir mkfifo pow select setenv setlocale socket sqrt strcasecmp strchr strdup strerror strncasecmp strndup strstr strtol])
# Initialize the FLTO variable
FLTO=""
# Add --enable-flto option
AC_ARG_ENABLE([flto],
[AS_HELP_STRING([--enable-flto], [Enable the use of gcc -flto flag])],
[if test "x$enableval" = "xyes"; then
enable_flto=yes
else
enable_flto=no
fi],
[enable_flto=no] # Default is to disable flto
)
# Check if flto is not disabled by the user
if test "x$enable_flto" != "xno"; then
# Check if gcc supports -flto
AC_MSG_CHECKING([whether gcc supports -flto])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[int main() { return 0; }]])],
[
# Save the current CFLAGS
saved_CFLAGS="$CFLAGS"
# Add -flto to CFLAGS for the test
CFLAGS="$CFLAGS -flto"
# Attempt to compile with -flto
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[int main() { return 0; }]])],
[
# -flto works, so update the FLTO variable
AC_MSG_RESULT([yes])
FLTO="-flto"
],
[
# Compilation failed, so -flto is not supported
AC_MSG_RESULT([no])
]
)
# Restore the original CFLAGS
CFLAGS="$saved_CFLAGS"
]
)
fi
# Make the FLTO variable available in the generated Makefile
AC_SUBST(FLTO)
AC_CONFIG_FILES([Makefile
simpleini/Makefile])
AC_OUTPUT
AC_MSG_NOTICE([
##############################################################
__ __ ___ ____ _ _
\ \ / /__|_ _| _ \ _ __ ___ ___ _ __ (_) |_ ___ _ __
\ \ / / _ \| || |_) | '_ ` _ \ / _ \| '_ \| | __/ _ \| '__|
\ V / (_) | || __/| | | | | | (_) | | | | | || (_) | |
\_/ \___/___|_| |_| |_| |_|\___/|_| |_|_|\__\___/|_|
lzma compression enabled : $HAVE_LIBLZMA_T
gnutls library enabled (SIP TLS) : $LIBGNUTLS_T
tcmalloc (faster *alloc) lib found : $TCMALLOC_T
libpng lib found : $HAVE_LIBPNG_T
libjpeg lib found : $HAVE_LIBJPEG_T
fftw3 lib found : $HAVE_LIBFFT_T
openssl >= 1.0.1 found : $OPENSSL101_T
openssl >= 1.1.1 found tls 1.3 enabled : $OPENSSL111_T
dpdk lib found : DPDK_T
shared binary: run make
static binary: run make static
check README_*.md
#############################################################
])