]>
Commit | Line | Data |
---|---|---|
6da970bf | 1 | AC_PREREQ(2.60a) |
574e14cb | 2 | |
0d6b2718 | 3 | AC_INIT([asterisk], [master], [https://github.com/asterisk/asterisk/issues]) |
3c3d054e | 4 | |
574e14cb KF |
5 | # cross-compile macros |
6 | AC_CANONICAL_BUILD | |
7 | AC_CANONICAL_HOST | |
574e14cb KF |
8 | |
9 | # check existence of the package | |
0a27d8bf | 10 | AC_CONFIG_SRCDIR([main/asterisk.c]) |
574e14cb | 11 | |
574e14cb | 12 | AC_COPYRIGHT("Asterisk") |
574e14cb | 13 | |
802b79e3 | 14 | # preserve any CFLAGS or LDFLAGS that may be set |
5d079002 KF |
15 | # NOTE: This must be done before calling any macros that end up |
16 | # calling AC_PROG_CC or the like, since they will set a default | |
17 | # set of CFLAGS ("-g -O2") if the user did not supply any, and | |
18 | # we don't want those default flags to be carried over into the | |
19 | # rest of the build system since we have other means of controlling | |
20 | # debugging symbol generation and optimization. | |
802b79e3 KF |
21 | CONFIG_CFLAGS="${CFLAGS}" |
22 | CONFIG_LDFLAGS="${LDFLAGS}" | |
23 | AC_SUBST(CONFIG_CFLAGS) | |
24 | AC_SUBST(CONFIG_LDFLAGS) | |
25 | ||
5d079002 | 26 | # specify output header file |
baa4a066 | 27 | AC_CONFIG_HEADERS([include/asterisk/autoconfig.h]) |
5d079002 | 28 | |
bad92a47 TL |
29 | # Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any |
30 | # other macro that uses the C compiler, or the default order will be used. | |
1c6bb4c4 | 31 | AC_PROG_CC([gcc cc]) |
bad92a47 | 32 | |
7157b481 TL |
33 | AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD |
34 | ||
35 | # System default paths | |
36 | AC_SUBST([astsbindir], ['${sbindir}'])dnl | |
b0842713 | 37 | AC_SUBST([astcachedir], ['${localstatedir}/cache/asterisk'])dnl |
7157b481 TL |
38 | AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl |
39 | AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl | |
92ef8a6f KF |
40 | AC_SUBST([astlibdir], ['${libdir}'])dnl |
41 | AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl | |
7157b481 TL |
42 | AC_SUBST([astmandir], ['${mandir}'])dnl |
43 | AC_SUBST([astvarlibdir], ['${localstatedir}/lib/asterisk'])dnl | |
44 | AC_SUBST([astdatadir], ['${astvarlibdir}'])dnl | |
45 | AC_SUBST([astdbdir], ['${astvarlibdir}'])dnl | |
46 | AC_SUBST([astkeydir], ['${astvarlibdir}'])dnl | |
47 | AC_SUBST([astspooldir], ['${localstatedir}/spool/asterisk'])dnl | |
48 | AC_SUBST([astlogdir], ['${localstatedir}/log/asterisk'])dnl | |
49 | AC_SUBST([astvarrundir], ['${localstatedir}/run/asterisk'])dnl | |
50 | ||
51 | case "${host_os}" in | |
52 | *bsd*) | |
dda73c50 | 53 | if test ${prefix} != 'NONE'; then |
7157b481 TL |
54 | astvarlibdir='${prefix}/share/asterisk' |
55 | astdbdir='${localstatedir}/db/asterisk' | |
56 | fi | |
57 | ;; | |
58 | darwin*) | |
59 | if test ${prefix} = 'NONE'; then | |
60 | astvarrundir='/Library/Application Support/Asterisk/Run' | |
61 | fi | |
62 | ;; | |
63 | esac | |
5d079002 | 64 | |
0a27d8bf | 65 | case "${host_os}" in |
5b525c97 AT |
66 | netbsd*) |
67 | ac_default_prefix=/usr/pkg | |
68 | CPPFLAGS=-I/usr/pkg/include | |
69 | LDFLAGS=-L/usr/pkg/lib | |
70 | ;; | |
efe40ff6 | 71 | dragonfly*|freebsd*) |
650d1ce9 | 72 | ac_default_prefix=/usr/local |
e7db78a4 LR |
73 | CPPFLAGS=-I/usr/local/include |
74 | LDFLAGS=-L/usr/local/lib | |
9993d14f | 75 | ;; |
dc20e8c4 | 76 | openbsd*) |
650d1ce9 | 77 | ac_default_prefix=/usr/local |
dc20e8c4 MB |
78 | if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then |
79 | if test ${sysconfdir} = '${prefix}/etc'; then | |
7157b481 | 80 | astetcdir=/etc/asterisk |
dc20e8c4 MB |
81 | fi |
82 | if test ${mandir} = '${prefix}/man'; then | |
7157b481 | 83 | astmandir=/usr/share/man |
dc20e8c4 MB |
84 | fi |
85 | fi | |
86 | CPPFLAGS=-I/usr/local/include | |
87 | LDFLAGS=-L/usr/local/lib | |
88 | ;; | |
0bdd99ad | 89 | darwin*) |
650d1ce9 | 90 | ac_default_prefix=/usr/local |
d275217c | 91 | if test ${prefix} = 'NONE'; then |
92ef8a6f | 92 | astmoddir='/Library/Application Support/Asterisk/Modules' |
ecf3c1a3 | 93 | astvarlibdir='/Library/Application Support/Asterisk' |
d275217c | 94 | astlogdir=/Library/Logs/Asterisk |
ecf3c1a3 | 95 | astvarrundir='/Library/Application Support/Asterisk/Run' |
d275217c | 96 | fi |
0bdd99ad | 97 | AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]) |
5eae9f44 | 98 | AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.]) |
0bdd99ad | 99 | ;; |
7157b481 TL |
100 | solaris*) |
101 | if test ${prefix} = 'NONE'; then | |
b0842713 | 102 | astcachedir=/var/cache/asterisk |
7157b481 TL |
103 | astetcdir=/var/etc/asterisk |
104 | astsbindir=/opt/asterisk/sbin | |
105 | astlibdir=/opt/asterisk/lib | |
92ef8a6f | 106 | astmoddir=/opt/asterisk/lib/modules |
7157b481 TL |
107 | astheaderdir=/opt/asterisk/include |
108 | astmandir=/opt/asterisk/man | |
109 | astvarlibdir=/var/opt/asterisk | |
110 | astspooldir=/var/spool/asterisk | |
111 | astlogdir=/var/log/asterisk | |
112 | astvarrundir=/var/run/asterisk | |
113 | fi | |
114 | ;; | |
9993d14f | 115 | *) |
650d1ce9 | 116 | ac_default_prefix=/usr |
e9fa4afa | 117 | if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then |
d37e1c89 TL |
118 | if test ${sysconfdir} = '${prefix}/etc'; then |
119 | sysconfdir=/etc | |
120 | fi | |
121 | if test ${mandir} = '${prefix}/man'; then | |
122 | mandir=/usr/share/man | |
123 | fi | |
1e61ba66 | 124 | fi |
9993d14f RB |
125 | ;; |
126 | esac | |
127 | ||
d555f6b9 JP |
128 | if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then |
129 | if test ${localstatedir} = '${prefix}/var'; then | |
130 | localstatedir=/var | |
131 | fi | |
9993d14f | 132 | fi |
574e14cb | 133 | |
0a27d8bf KF |
134 | BUILD_PLATFORM=${build} |
135 | BUILD_CPU=${build_cpu} | |
136 | BUILD_VENDOR=${build_vendor} | |
137 | BUILD_OS=${build_os} | |
138 | ||
139 | AC_SUBST(BUILD_PLATFORM) | |
140 | AC_SUBST(BUILD_CPU) | |
141 | AC_SUBST(BUILD_VENDOR) | |
142 | AC_SUBST(BUILD_OS) | |
143 | ||
144 | HOST_PLATFORM=${host} | |
145 | HOST_CPU=${host_cpu} | |
146 | HOST_VENDOR=${host_vendor} | |
147 | HOST_OS=${host_os} | |
148 | ||
149 | AC_SUBST(HOST_PLATFORM) | |
150 | AC_SUBST(HOST_CPU) | |
151 | AC_SUBST(HOST_VENDOR) | |
152 | AC_SUBST(HOST_OS) | |
574e14cb | 153 | |
448562af | 154 | PBX_WINARCH=0 |
01f8a695 | 155 | |
44f60a28 | 156 | case "${host_os}" in |
efe40ff6 | 157 | dragonfly*|freebsd*) |
44f60a28 KF |
158 | OSARCH=FreeBSD |
159 | ;; | |
52ad6440 JP |
160 | netbsd*) |
161 | OSARCH=NetBSD | |
162 | ;; | |
ba1a1586 JP |
163 | openbsd*) |
164 | OSARCH=OpenBSD | |
165 | ;; | |
52ad6440 JP |
166 | solaris*) |
167 | OSARCH=SunOS | |
168 | ;; | |
01f8a695 KF |
169 | mingw32) |
170 | OSARCH=mingw32 | |
448562af | 171 | PBX_WINARCH=1 |
01f8a695 KF |
172 | ;; |
173 | cygwin) | |
174 | OSARCH=cygwin | |
448562af | 175 | PBX_WINARCH=1 |
01f8a695 | 176 | ;; |
6a99f007 | 177 | linux-gnu*) |
7e29f0da TC |
178 | OSARCH=linux-gnu |
179 | ;; | |
72d190eb TT |
180 | linux-musl*) |
181 | OSARCH=linux-musl | |
182 | ;; | |
4a8fdd6a TC |
183 | kfreebsd*-gnu) |
184 | OSARCH=kfreebsd-gnu | |
185 | ;; | |
44f60a28 | 186 | *) |
d209cb09 | 187 | OSARCH=${host_os} |
44f60a28 KF |
188 | ;; |
189 | esac | |
190 | ||
191 | AC_SUBST(OSARCH) | |
448562af | 192 | AC_SUBST(PBX_WINARCH) |
44f60a28 | 193 | |
5e10e369 GJ |
194 | AC_MSG_CHECKING(whether char is unsigned) |
195 | AC_COMPILE_IFELSE( | |
196 | [ | |
197 | AC_LANG_SOURCE( | |
198 | #include <limits.h> | |
199 | #if CHAR_MIN == 0 | |
200 | #error | |
201 | #endif | |
202 | ) | |
203 | ],[ | |
204 | AC_MSG_RESULT(no) | |
205 | CONFIG_SIGNED_CHAR="" | |
206 | ],[ | |
207 | AC_MSG_RESULT(yes) | |
208 | CONFIG_SIGNED_CHAR="-fsigned-char" | |
209 | ] | |
210 | ) | |
211 | AC_SUBST(CONFIG_SIGNED_CHAR) | |
212 | ||
574e14cb | 213 | # check for uname |
5d8e0a65 AT |
214 | AC_PATH_TOOL([UNAME], [uname], :) |
215 | if test "x${UNAME}" != "x:"; then | |
574e14cb KF |
216 | PBX_OSREV=$(${UNAME} -r) |
217 | fi | |
218 | AC_SUBST(PBX_OSREV) | |
219 | ||
270f7be5 | 220 | AH_TOP([#ifndef ASTERISK_AUTOCONFIG_H |
472c1ca2 | 221 | #define ASTERISK_AUTOCONFIG_H |
270f7be5 | 222 | /* IWYU pragma: private, include "asterisk.h" */ |
472c1ca2 | 223 | |
270f7be5 | 224 | #include "asterisk/buildopts.h" /* IWYU pragma: export */]) |
44d4ed1b | 225 | |
270f7be5 | 226 | AH_BOTTOM([#endif /* ASTERISK_AUTOCONFIG_H */]) |
472c1ca2 | 227 | |
574e14cb | 228 | # cross-compile checks |
92ef8a6f | 229 | if test "${cross_compiling}" = "yes"; |
574e14cb KF |
230 | then |
231 | AC_CHECK_TOOL(CC, gcc, :) | |
232 | AC_CHECK_TOOL(CXX, g++, :) | |
0a27d8bf | 233 | AC_CHECK_TOOL(LD, ld, :) |
574e14cb | 234 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
b7fbb9c4 SK |
235 | CROSS_COMPILING=1 |
236 | AC_SUBST(CROSS_COMPILING) | |
574e14cb KF |
237 | fi |
238 | ||
239 | # Checks for programs. | |
574e14cb KF |
240 | AC_PROG_CXX |
241 | AC_PROG_CPP | |
242 | AC_PROG_CXXCPP | |
7cfa2154 RB |
243 | # This macro is just copied into our local acinclude.m4 from libtool.m4 so that |
244 | # the developers regenerating the configure script don't have to install libtool. | |
68a84d56 | 245 | AST_PROG_LD # note, does not work on FreeBSD |
574e14cb KF |
246 | AC_PROG_AWK |
247 | AC_PROG_INSTALL | |
00a8f14f | 248 | AC_PROG_LN_S |
574e14cb KF |
249 | AC_PROG_RANLIB |
250 | AST_CHECK_GNU_MAKE | |
bb8fe716 | 251 | AC_PROG_EGREP |
574e14cb | 252 | |
28d346dd JP |
253 | AC_CHECK_TOOLS([STRIP], [strip gstrip], :) |
254 | AC_CHECK_TOOLS([AR], [ar gar], :) | |
b66c6465 | 255 | |
ae1133d8 RB |
256 | GNU_LD=0 |
257 | if test "x$with_gnu_ld" = "xyes" ; then | |
258 | GNU_LD=1 | |
259 | fi | |
260 | AC_SUBST(GNU_LD) | |
261 | ||
bc9f02a6 | 262 | AC_PATH_PROG([BISON], [bison], :) |
bb8fe716 | 263 | AC_PATH_PROG([CMP], [cmp], :) |
d3f070c7 | 264 | AC_PATH_PROG([CAT], [cat], :) |
b4f7f825 | 265 | AC_PATH_PROG([CUT], [cut], :) |
bc9f02a6 | 266 | AC_PATH_PROG([FLEX], [flex], :) |
574e14cb | 267 | AC_PATH_PROG([GREP], [grep], :) |
610e0581 | 268 | AC_PATH_PROGS([PYTHON], [python2.7 python2 python python3], :) |
574e14cb | 269 | AC_PATH_PROG([FIND], [find], :) |
574e14cb KF |
270 | AC_PATH_PROG([BASENAME], [basename], :) |
271 | AC_PATH_PROG([DIRNAME], [dirname], :) | |
272 | AC_PATH_PROG([SHELL], [sh], :) | |
273 | AC_PATH_PROG([LN], [ln], :) | |
83b13ebc | 274 | AC_PATH_PROG([DOXYGEN], [doxygen], :) |
574e14cb | 275 | AC_PATH_PROG([DOT], [dot], :) |
c1a36cb5 | 276 | AC_PATH_PROG([WGET], [wget], :) |
e179e613 | 277 | AC_PATH_PROG([CURL], [curl], :) |
e5c4c900 | 278 | AC_PATH_PROG([XMLLINT], [xmllint], :) |
7e7a2064 | 279 | AC_PATH_PROGS([XMLSTARLET], [xmlstarlet xml], :) |
6caf6bcd | 280 | AC_PATH_PROG([BASH], [bash], :) |
b0c3d288 | 281 | AC_PATH_PROG([GIT], [git], :) |
5dde1117 | 282 | AC_PATH_PROG([ALEMBIC], [alembic], :) |
5fb848ee GJ |
283 | AC_PATH_PROG([BZIP2], [bzip2], :) |
284 | AC_PATH_PROG([TAR], [tar], :) | |
285 | AC_PATH_PROG([PATCH], [patch], :) | |
286 | AC_PATH_PROG([SED], [sed], :) | |
287 | AC_PATH_PROG([NM], [nm], :) | |
bc59b66d GJ |
288 | AC_PATH_PROG([REALPATH], [realpath], :) |
289 | ||
5fb848ee | 290 | |
f697025a AT |
291 | DOWNLOAD=":" |
292 | DOWNLOAD_TO_STDOUT= | |
293 | DOWNLOAD_TIMEOUT= | |
5d8e0a65 | 294 | if test "x${WGET}" != "x:"; then |
c1a36cb5 | 295 | DOWNLOAD=${WGET} |
01e9eaf3 | 296 | DOWNLOAD_TO_STDOUT="${WGET} -q -O-" |
d3f070c7 | 297 | DOWNLOAD_TIMEOUT='--timeout=$1' |
5d8e0a65 | 298 | elif test "x${CURL}" != "x:"; then |
1bf6d02f | 299 | DOWNLOAD="${CURL} -L -O --progress-bar -w \"%{url_effective}\n\"" |
59130260 | 300 | DOWNLOAD_TO_STDOUT="${CURL} -Ls" |
d3f070c7 | 301 | DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)' |
c1a36cb5 | 302 | else |
f697025a | 303 | AC_PATH_PROG([FETCH], [fetch], :) |
5d8e0a65 | 304 | if test "x${FETCH}" != "x:"; then |
f697025a AT |
305 | DOWNLOAD=${FETCH} |
306 | DOWNLOAD_TO_STDOUT="${FETCH} -o-" | |
307 | DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)' | |
308 | fi | |
c1a36cb5 RB |
309 | fi |
310 | AC_SUBST(DOWNLOAD) | |
5fb848ee | 311 | AC_SUBST(DOWNLOAD_TO_STDOUT) |
d3f070c7 GJ |
312 | AC_SUBST(DOWNLOAD_TIMEOUT) |
313 | ||
92ef8a6f KF |
314 | AC_PATH_PROG([LDCONFIG], [ldconfig], :) |
315 | AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh) | |
316 | AC_PATH_PROG([OPENSSL], [openssl], :) | |
574e14cb | 317 | |
0adcdbd1 GJ |
318 | PKG_PROG_PKG_CONFIG() |
319 | ||
245bd186 TL |
320 | AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [ |
321 | if test "x$BISON" != "x:" ; then | |
322 | # Create a temporary directory $tmp in $TMPDIR (default /tmp). | |
323 | # Use mktemp if possible; otherwise fall back on mkdir, | |
324 | # with $RANDOM to make collisions less likely. | |
325 | : ${TMPDIR=/tmp} | |
326 | { | |
327 | tmp=` | |
328 | (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null | |
329 | ` && | |
330 | test -n "$tmp" && test -d "$tmp" | |
331 | } || { | |
332 | tmp=$TMPDIR/foo$$-$RANDOM | |
333 | (umask 077 && mkdir "$tmp") | |
334 | } || exit $? | |
335 | cat >$tmp/test.y <<__EOL__ | |
336 | %parse-param {struct parse_io *parseio} | |
337 | %% | |
338 | file : { \$\$ = parseio->pval = 1; } | |
339 | ; | |
340 | %% | |
341 | __EOL__ | |
342 | ${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1 | |
343 | if test -e "${tmp}/test.tab.c"; then | |
344 | ac_cv_path_BISON2=${BISON} | |
345 | fi | |
346 | rm -rf ${tmp} | |
347 | fi | |
348 | ]) | |
349 | if test "x${ac_cv_path_BISON2}" = "x" ; then | |
350 | BISON=: | |
bbc47dba TL |
351 | PBX_BISON=0 |
352 | else | |
353 | PBX_BISON=1 | |
354 | fi | |
355 | AC_SUBST(PBX_BISON) | |
5d8e0a65 AT |
356 | |
357 | if test "${FLEX}" = ":"; then | |
bbc47dba TL |
358 | PBX_FLEX=0 |
359 | else | |
360 | PBX_FLEX=1 | |
245bd186 | 361 | fi |
bbc47dba | 362 | AC_SUBST(PBX_FLEX) |
245bd186 | 363 | |
5d8e0a65 | 364 | if test "${XMLSTARLET}" = ":"; then |
6caf6bcd GJ |
365 | PBX_XMLSTARLET=0 |
366 | else | |
367 | PBX_XMLSTARLET=1 | |
368 | fi | |
369 | AC_SUBST(PBX_XMLSTARLET) | |
370 | ||
5d8e0a65 | 371 | if test "${BASH}" = ":"; then |
6caf6bcd GJ |
372 | PBX_BASH=0 |
373 | else | |
374 | PBX_BASH=1 | |
375 | fi | |
376 | AC_SUBST(PBX_BASH) | |
377 | ||
5d8e0a65 AT |
378 | AC_CHECK_TOOL([SOXMIX], [soxmix], :) |
379 | if test "x${SOXMIX}" != "x:"; then | |
0e08d5e7 RB |
380 | AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.]) |
381 | fi | |
382 | ||
559e644b SB |
383 | AC_CHECK_PROGS([MD5], [md5 md5sum gmd5sum digest]) |
384 | ||
385 | if test "${MD5}" = "digest" ; then | |
92ef8a6f | 386 | MD5="${MD5} -a md5" |
559e644b SB |
387 | fi |
388 | ||
a3f4141f | 389 | AX_PTHREAD |
74f401d0 | 390 | |
574e14cb KF |
391 | AC_LANG(C) |
392 | ||
a2001c00 CF |
393 | PBX_NO_BINARY_MODULES=0 |
394 | AC_ARG_ENABLE([binary-modules], | |
395 | [AS_HELP_STRING([--disable-binary-modules], | |
396 | [Block installation of binary modules.])], | |
397 | [case "${enableval}" in | |
398 | y|ye|yes) PBX_NO_BINARY_MODULES=0 ;; | |
399 | n|no) PBX_NO_BINARY_MODULES=1 ;; | |
400 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-binary-modules) ;; | |
401 | esac]) | |
402 | AC_SUBST(PBX_NO_BINARY_MODULES) | |
403 | ||
9b0a2e52 SB |
404 | AC_ARG_ENABLE([dev-mode], |
405 | [AS_HELP_STRING([--enable-dev-mode], | |
406 | [Turn on developer mode])], | |
574e14cb KF |
407 | [case "${enableval}" in |
408 | y|ye|yes) AST_DEVMODE=yes ;; | |
409 | n|no) AST_DEVMODE=no ;; | |
c3ab548c SB |
410 | noisy) |
411 | AST_DEVMODE=yes | |
412 | NOISY_BUILD=yes | |
413 | ;; | |
2969b004 SB |
414 | strict) |
415 | AST_DEVMODE=yes | |
416 | AST_DEVMODE_STRICT=yes | |
417 | ;; | |
574e14cb KF |
418 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;; |
419 | esac]) | |
c3ab548c | 420 | AC_SUBST(NOISY_BUILD) |
574e14cb | 421 | AC_SUBST(AST_DEVMODE) |
2969b004 | 422 | AC_SUBST(AST_DEVMODE_STRICT) |
574e14cb | 423 | |
305bd0d9 | 424 | AST_OPTION_ONLY([download-cache], [AST_DOWNLOAD_CACHE], [cached sound AND external module tarfiles], []) |
aa39a876 CF |
425 | AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], []) |
426 | AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], []) | |
427 | ||
0aff0b8e RB |
428 | AST_CODE_COVERAGE=no |
429 | AC_ARG_ENABLE([coverage], | |
430 | [AS_HELP_STRING([--enable-coverage], | |
431 | [Turn on code coverage tracking (for gcov)])], | |
432 | [case "${enableval}" in | |
433 | y|ye|yes) AST_CODE_COVERAGE=yes ;; | |
434 | n|no) AST_CODE_COVERAGE=no ;; | |
435 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;; | |
436 | esac]) | |
437 | AC_SUBST(AST_CODE_COVERAGE) | |
438 | ||
305ce3de DG |
439 | AST_CHECK_RAII() |
440 | AST_CHECK_STRSEP_ARRAY_BOUNDS() | |
441 | ||
ee154464 CF |
442 | JANSSON_BUNDLED=no |
443 | AC_ARG_WITH([jansson-bundled], | |
444 | [AS_HELP_STRING([--with-jansson-bundled], | |
445 | [Use bundled jansson library])], | |
446 | [case "${withval}" in | |
5d8e0a65 | 447 | y|ye|yes) JANSSON_BUNDLED=yes ;; |
ee154464 CF |
448 | *) JANSSON_BUNDLED=no ;; |
449 | esac]) | |
450 | ||
305bd0d9 | 451 | PJPROJECT_BUNDLED=yes |
5fb848ee GJ |
452 | AH_TEMPLATE(m4_bpatsubst([[HAVE_PJPROJECT_BUNDLED]], [(.*)]), [Define to 1 when using the bundled pjproject.]) |
453 | ||
454 | AC_ARG_WITH([pjproject-bundled], | |
455 | [AS_HELP_STRING([--with-pjproject-bundled], | |
305bd0d9 | 456 | [Use bundled pjproject libraries (default)])], |
147b8e63 | 457 | [case "${withval}" in |
5fb848ee GJ |
458 | n|no) PJPROJECT_BUNDLED=no ;; |
459 | *) PJPROJECT_BUNDLED=yes ;; | |
460 | esac]) | |
461 | ||
b8db1dae | 462 | if test "${with_pjproject}" = "no" || test "${with_pjproject}" = "n" ; then |
0a4dffe6 AT |
463 | PJPROJECT_BUNDLED=no |
464 | fi | |
465 | ||
15ef050d GJ |
466 | LIBJWT_BUNDLED=no |
467 | AC_ARG_WITH([libjwt-bundled], | |
468 | [AS_HELP_STRING([--with-libjwt-bundled], | |
469 | [Use bundled libjwt library])], | |
470 | [case "${withval}" in | |
471 | y|ye|yes) LIBJWT_BUNDLED=yes ;; | |
472 | *) LIBJWT_BUNDLED=no ;; | |
473 | esac]) | |
474 | ||
0adcdbd1 GJ |
475 | # |
476 | # OpenSSL stuff has to be done here because we want to pass | |
477 | # any resulting CFLAGS and LDFLAGS to the bundled pjproject | |
478 | # configure done in THIRD_PARTY_CONFIGURE() | |
479 | # | |
480 | AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto]) | |
481 | AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl]) | |
482 | AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_BIO_METHOD], [OpenSSL BIO Method Support], [CRYPTO], [crypto]) | |
483 | ||
484 | # If neither --without-ssl (PBX_OPENSSL=-1) nor --without-crypto (PBX_CRYPTO=-1) | |
485 | # and there were no directories atdded to --with-ssl and --with-crypto, and | |
486 | # pkg-config is installed (which is should be by install_prereq). | |
b8db1dae | 487 | if test "x$PKG_CONFIG" != "x" -a $PBX_OPENSSL -ge 0 -a $PBX_CRYPTO -ge 0 -a "x$OPENSSL_DIR" = "x" ; then |
0adcdbd1 GJ |
488 | AC_MSG_NOTICE(checking OPENSSL with pkg-config) |
489 | AC_MSG_NOTICE(checking whether system openssl > 1.1.0) | |
490 | AST_PKG_CONFIG_CHECK([OPENSSL], [openssl >= 1.1.0]) | |
491 | if test $PBX_OPENSSL -eq 0 ; then | |
492 | AC_MSG_NOTICE(checking whether alternate openssl11 is installed) | |
493 | AST_PKG_CONFIG_CHECK([OPENSSL], [openssl11]) | |
494 | fi | |
495 | if test $PBX_OPENSSL -eq 1 ; then | |
496 | AC_DEFINE([HAVE_OPENSSL_BIO_METHOD], 1) | |
497 | PBX_OPENSSL_BIO_METHOD=1 | |
498 | else | |
499 | AC_MSG_NOTICE(checking fallback system openssl) | |
500 | AST_PKG_CONFIG_CHECK([OPENSSL], [openssl]) | |
501 | fi | |
502 | ||
503 | if test $PBX_OPENSSL -eq 1; then | |
504 | AC_DEFINE([HAVE_CRYPTO], 1) | |
505 | PBX_CRYPTO=1 | |
506 | fi | |
507 | else | |
508 | AC_MSG_NOTICE(Checking OPENSSL without pkg-config) | |
509 | AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h]) | |
510 | if test "$PBX_CRYPTO" = "1"; | |
511 | then | |
512 | AST_EXT_LIB_CHECK([OPENSSL], [ssl], [SSL_connect], [openssl/ssl.h], [-lcrypto]) | |
513 | AST_EXT_LIB_CHECK([OPENSSL_BIO_METHOD], [ssl], [BIO_meth_new], [openssl/ssl.h], [-lcrypto]) | |
514 | fi | |
515 | fi | |
516 | if test $PBX_OPENSSL -eq 0 ; then | |
517 | AC_MSG_WARN(OpenSSL does not seem to be installed) | |
518 | fi | |
519 | ||
520 | ||
5fb848ee GJ |
521 | THIRD_PARTY_CONFIGURE() |
522 | ||
ea8af9b9 LR |
523 | # AST_EXT_LIB_SETUP is used to tell configure to handle variables for |
524 | # various packages. | |
525 | # $1 is the prefix for the variables in makeopts and autoconfig.h | |
526 | # $2 is the short comment, $4 is the long comment | |
527 | # $3 is the name used in --with- or --without- flags for configure. | |
528 | # | |
529 | # Package option names should be in alphabetical order | |
b4ab6b56 LR |
530 | # by the --with option name (the third field), |
531 | # to make things easier for the users. | |
e61d3d91 | 532 | |
b98e47d1 TL |
533 | AST_EXT_LIB_SETUP([BFD], [Debug symbol decoding], [bfd]) |
534 | ||
535 | # BKTR is used for backtrace support on platforms that do not | |
536 | # have it natively. | |
537 | AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace], [execinfo]) | |
13f15cae | 538 | AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth]) |
4116cfc3 | 539 | AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap]) |
2e79f52d | 540 | AST_EXT_LIB_SETUP([CODEC2], [Codec 2 Audio Decoder/Encoder], [codec2]) |
055a19e1 | 541 | AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg]) |
eebdf351 | 542 | AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg]) |
dcf03554 | 543 | AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt]) |
ef3b2147 | 544 | AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi]) |
b98e47d1 | 545 | AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec]) |
13f15cae | 546 | AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise]) |
b5193428 | 547 | AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise]) |
13f15cae TL |
548 | AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2]) |
549 | AST_EXT_LIB_SETUP([GMIME], [GMime], [gmime]) | |
6cf6d9ec | 550 | AST_EXT_LIB_SETUP([HOARD], [Hoard Memory Allocator], [hoard]) |
13f15cae TL |
551 | AST_EXT_LIB_SETUP([ICAL], [iCal], [ical]) |
552 | AST_EXT_LIB_SETUP([ICONV], [Iconv], [iconv]) | |
553 | AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber], [iksemel]) | |
d5b7bf2a | 554 | AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap]) |
4ac2fd4c | 555 | AST_EXT_LIB_SETUP([INOTIFY], [inotify support], [inotify]) |
4560279c | 556 | AST_EXT_LIB_SETUP([IODBC], [iODBC], [iodbc]) |
d20cb305 | 557 | AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack]) |
7695ea26 | 558 | AST_EXT_LIB_SETUP([JANSSON], [Jansson JSON library], [jansson]) |
dd332177 | 559 | AST_EXT_LIB_SETUP([URIPARSER], [uriparser library], [uriparser]) |
8d6ee962 | 560 | AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue]) |
cfa0ec1f | 561 | AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap]) |
3c3d054e | 562 | AST_LIBCURL_CHECK_CONFIG([], [7.10.1]) |
9fddc8b4 | 563 | AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit]) |
72da2ef9 | 564 | AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit]) |
15ef050d | 565 | AST_EXT_LIB_SETUP([LIBJWT], [LIBJWT], [libjwt]) |
5b168ee3 | 566 | AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2]) |
03090a88 | 567 | AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt]) |
3578bc30 | 568 | AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt]) |
e8c781b2 | 569 | AST_EXT_LIB_SETUP([LUA], [Lua], [lua]) |
4e038c1e | 570 | AC_ARG_VAR([LUA_VERSIONS],[A space separated list of target lua versions to test.]) |
13f15cae | 571 | AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient]) |
71a3a2eb | 572 | AST_EXT_LIB_SETUP([NEON], [neon], [neon]) |
f1503b9e | 573 | AST_EXT_LIB_SETUP([NEON29], [neon29], [neon29]) |
d5b7bf2a KF |
574 | AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp]) |
575 | AST_EXT_LIB_SETUP([NEWT], [newt], [newt]) | |
d5b7bf2a | 576 | AST_EXT_LIB_SETUP([OGG], [OGG], [ogg]) |
3c3d054e | 577 | AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2]) |
ef8cdd40 | 578 | AST_EXT_LIB_SETUP([OPUS], [Opus], [opus]) |
4013bfa5 | 579 | AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile]) |
d5b7bf2a | 580 | AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres]) |
4559cd0e | 581 | AST_EXT_LIB_SETUP([BEANSTALK], [Beanstalk Job Queue], [beanstalk]) |
3173e91b | 582 | |
5fb848ee | 583 | if test "x${PBX_PJPROJECT}" != "x1" ; then |
1cb91709 | 584 | AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject]) |
168c1873 | 585 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [PJSIP Dialog Create UAS with Incremented Lock], [PJPROJECT], [pjsip]) |
c321b1f4 | 586 | AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [PJPROJECT], [pjsip]) |
b8025e78 | 587 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_REPLACE_MEDIA_STREAM], [PJSIP Media Stream Replacement Support], [PJPROJECT], [pjsip]) |
0e631a54 | 588 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_GET_DEST_INFO], [pjsip_get_dest_info support], [PJPROJECT], [pjsip]) |
023fa0f9 | 589 | AST_EXT_LIB_SETUP_OPTIONAL([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj_ssl_cert_load_from_files2 support], [PJPROJECT], [pjsip]) |
a3cec44a | 590 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EXTERNAL_RESOLVER], [PJSIP External Resolver Support], [PJPROJECT], [pjsip]) |
4df7b3ae | 591 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_PROTO], [PJSIP TLS Transport proto field support], [PJPROJECT], [pjsip]) |
c52b4ce1 SB |
592 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_1], [PJSIP TLS 1.1 Support], [PJPROJECT], [pjsip]) |
593 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_2], [PJSIP TLS 1.2 Support], [PJPROJECT], [pjsip]) | |
594 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_1_3], [PJSIP TLS 1.3 Support], [PJPROJECT], [pjsip]) | |
b57cd014 | 595 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EVSUB_GRP_LOCK], [PJSIP EVSUB Group Lock support], [PJPROJECT], [pjsip]) |
7bb7f7b9 | 596 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_SESSION_REF], [PJSIP INVITE Session Reference Count support], [PJPROJECT], [pjsip]) |
0cd0e70c | 597 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_AUTH_CLT_DEINIT], [pjsip_auth_clt_deinit support], [PJPROJECT], [pjsip]) |
01e9eaf3 | 598 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip_tsx_layer_find_tsx2 support], [PJPROJECT], [pjsip]) |
880fbff6 | 599 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [PJSIP INVITE Accept Multiple SDP Answers], [PJPROJECT], [pjsip]) |
ce9a980b | 600 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_ENDPOINT_COMPACT_FORM], [PJSIP Compact Form Support on Endpoint], [PJPROJECT], [pjsip]) |
37b2e686 NF |
601 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [PJSIP Transport Connection Reuse Disabling], [PJPROJECT], [pjsip]) |
602 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_OAUTH_AUTHENTICATION], [PJSIP OAuth Authentication Support], [PJPROJECT], [pjsip]) | |
cffaf12d | 603 | AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_RESTART], [PJSIP TLS Transport Restart Support], [PJPROJECT], [pjsip]) |
5fb848ee | 604 | fi |
3173e91b GJ |
605 | |
606 | AST_EXT_LIB_SETUP([POPT], [popt], [popt]) | |
7d0eacfb | 607 | AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio]) |
d5b7bf2a | 608 | AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri]) |
8b6ab478 | 609 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_ACK_INBAND], [ISDN PRI progress inband ie in SETUP ACK], [PRI], [pri]) |
6e5f97df RM |
610 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri]) |
611 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_DATETIME_SEND], [ISDN PRI Date/time ie send policy], [PRI], [pri]) | |
612 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI_V2], [ISDN PRI Message Waiting Indication (Fixed)], [PRI], [pri]) | |
613 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_DISPLAY_TEXT], [ISDN PRI user display text IE contents during call], [PRI], [pri]) | |
614 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI], [ISDN PRI Message Waiting Indication], [PRI], [pri]) | |
615 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_MCID], [ISDN PRI Malicious Call ID], [PRI], [pri]) | |
616 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_WAITING], [ISDN PRI call waiting supplementary service], [PRI], [pri]) | |
617 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri]) | |
618 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri]) | |
619 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri]) | |
620 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri]) | |
621 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri]) | |
622 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri]) | |
623 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri]) | |
624 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri]) | |
625 | # ------------------------------------v | |
626 | # TODO: The code can be changed to always include these features now. | |
627 | # These features will always be present if pri_connected_line_update is available. | |
628 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri]) | |
629 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_PROG_W_CAUSE], [ISDN progress with cause], [PRI], [pri]) | |
630 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_SERVICE_MESSAGES], [ISDN service messages], [PRI], [pri]) | |
631 | AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [pri]) | |
632 | # ------------------------------------^ | |
ad3748d6 | 633 | AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius]) |
dd6fc1bb | 634 | AST_EXT_LIB_SETUP([FFTW3], [LIBFFTW3], [fftw3]) |
3c3d054e | 635 | AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample]) |
b58de2fa | 636 | AST_EXT_LIB_SETUP([SNDFILE], [libsndfile], [sndfile]) |
451c76c3 | 637 | AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl]) |
13f15cae | 638 | AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image]) |
3c3d054e TL |
639 | AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp]) |
640 | AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7]) | |
d5b7bf2a | 641 | AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex]) |
fc547b5f | 642 | AST_EXT_LIB_SETUP([SPEEX_PREPROCESS], [Speex preprocess routines], [speex]) |
13f15cae | 643 | AST_EXT_LIB_SETUP([SPEEXDSP], [SpeexDSP], [speexdsp]) |
74d7f7f7 | 644 | AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex]) |
5bea998a | 645 | AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3]) |
857814f4 | 646 | AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp]) |
1d2173c7 AT |
647 | AST_EXT_LIB_SETUP_OPTIONAL([SRTP_256], [SRTP Library AES-256 (ICM)], [SRTP], [srtp]) |
648 | AST_EXT_LIB_SETUP_OPTIONAL([SRTP_192], [SRTP Library AES-192 (ICM)], [SRTP], [srtp]) | |
649 | AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GCM], [SRTP Library AES-128 (GCM) and AES-256 (GCM)], [SRTP], [srtp]) | |
1ead1853 | 650 | AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp]) |
3d9deb35 | 651 | AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GET_VERSION], [SRTP Library Version Function], [SRTP], [srtp]) |
40caf0ad | 652 | AST_EXT_LIB_SETUP_OPTIONAL([RT], [Realtime functions], [rt]) |
d5b7bf2a | 653 | AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds]) |
3c3d054e | 654 | AST_EXT_LIB_SETUP([TIMERFD], [timerfd], [timerfd]) |
d5b7bf2a | 655 | AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone]) |
abf3e409 | 656 | AST_EXT_LIB_SETUP([UNBOUND], [unbound], [unbound]) |
4560279c | 657 | AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [unixodbc]) |
d5b7bf2a | 658 | AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis]) |
13f15cae TL |
659 | AST_EXT_LIB_SETUP([X11], [X11], [x11]) |
660 | AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z]) | |
732c1d30 | 661 | |
d5b7bf2a KF |
662 | # check for basic system features and functionality before |
663 | # checking for package libraries | |
df0ba5ff | 664 | |
d5b7bf2a KF |
665 | AC_FUNC_ALLOCA |
666 | AC_HEADER_DIRENT | |
8e360641 CF |
667 | if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then |
668 | AC_MSG_ERROR([*** Could not find dirent header that defines 'DIR'.]) | |
669 | fi | |
670 | ||
d5b7bf2a | 671 | AC_HEADER_SYS_WAIT |
8e360641 CF |
672 | if test "$ac_cv_header_sys_wait_h" != "yes"; then |
673 | AC_MSG_ERROR([*** POSIX.1 compatible sys/wait.h is required.]) | |
674 | fi | |
675 | ||
64529761 AT |
676 | AC_HEADER_RESOLV |
677 | if test "$ac_cv_header_resolv_h" != "yes"; then | |
678 | AC_MSG_ERROR([*** resolv.h is required.]) | |
679 | fi | |
680 | ||
8e360641 CF |
681 | # Check for headers that are unconditionally required on all platforms. Do not use |
682 | # this to check for headers that are only needed by modules. | |
683 | AC_CHECK_HEADERS([ \ | |
684 | arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \ | |
64529761 | 685 | inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \ |
8e360641 CF |
686 | sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \ |
687 | sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \ | |
688 | sys/time.h sys/types.h sys/un.h \ | |
689 | termios.h time.h unistd.h \ | |
690 | ], [], [ | |
691 | AC_MSG_ERROR([*** A required header was not found.]) | |
692 | ]) | |
693 | ||
694 | AC_CHECK_HEADERS([arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h]) | |
d5b7bf2a | 695 | |
d6fda173 AT |
696 | # Find required NetBSD Editline library (libedit). |
697 | AST_PKG_CONFIG_CHECK(LIBEDIT, libedit) | |
698 | # some platforms do not list libedit via pkg-config, for example OpenBSD 6.2 | |
699 | AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap]) | |
700 | if test "${PBX_LIBEDIT}" != 1; then | |
701 | AC_MSG_ERROR(*** Please install the 'libedit' development package.) | |
702 | exit 1 | |
1bf2d9e9 | 703 | fi |
d6fda173 | 704 | AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support]) |
1bf2d9e9 | 705 | |
6d805dc0 DL |
706 | # Find required UUID support. |
707 | # * -luuid on Linux | |
708 | # * -le2fs-uuid on OpenBSD | |
709 | # * in libsystem on OS X | |
bfefde5b | 710 | AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h]) |
6d805dc0 DL |
711 | if test "x$LIBUUID_LIB" != "x" ; then |
712 | UUID_INCLUDE="$LIBUUID_INCLUDE" | |
713 | UUID_LIB="$LIBUUID_LIB" | |
6d805dc0 | 714 | else |
bfefde5b | 715 | AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h]) |
75cebc3e AT |
716 | if test "x$E2FSUUID_LIB" != "x" ; then |
717 | UUID_INCLUDE="$E2FSUUID_INCLUDE" | |
718 | UUID_LIB="$E2FSUUID_LIB" | |
719 | else | |
720 | AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""]) | |
721 | if test "x$SYSUUID" != "x" ; then | |
722 | UUID_INCLUDE="" | |
723 | UUID_LIB="" | |
724 | else | |
725 | AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)]) | |
726 | fi | |
727 | fi | |
24b0d236 | 728 | fi |
6d805dc0 DL |
729 | AC_SUBST(UUID_INCLUDE) |
730 | AC_SUBST(UUID_LIB) | |
731 | ||
ee154464 CF |
732 | # Find required JSON support if bundled is not enabled. |
733 | if test "$JANSSON_BUNDLED" = "no" ; then | |
0a4d5873 | 734 | AST_PKG_CONFIG_CHECK([JANSSON], [jansson >= 2.11]) |
ee154464 CF |
735 | # json_sprintf is available in 2.11+ |
736 | AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_sprintf], [jansson.h]) | |
24b0d236 | 737 | |
ee154464 CF |
738 | if test "${PBX_JANSSON}" != 1; then |
739 | AC_MSG_NOTICE(*** Asterisk requires libjansson >= 2.11 and no system copy was found.) | |
740 | AC_MSG_NOTICE(*** Please install the 'libjansson' development package or) | |
741 | AC_MSG_NOTICE(*** use './configure --with-jansson-bundled') | |
742 | exit 1 | |
743 | fi | |
31fba4e8 | 744 | JANSSON_DEFINE_JSON_INT() |
ee154464 CF |
745 | else |
746 | PBX_JANSSON=1 | |
cf9324b2 DL |
747 | fi |
748 | ||
15ef050d GJ |
749 | source ./third-party/versions.mak |
750 | # Find required JWT support if bundled is not enabled. | |
751 | if test "$LIBJWT_BUNDLED" = "no" ; then | |
752 | AST_PKG_CONFIG_CHECK([LIBJWT], [libjwt >= $LIBJWT_VERSION]) | |
753 | else | |
754 | PBX_LIBJWT=1 | |
755 | fi | |
756 | ||
40caf0ad | 757 | # See if clock_gettime is in librt |
bfefde5b | 758 | AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], []) |
40caf0ad | 759 | |
64f11e0d | 760 | AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0]) |
3f64ca0c MJ |
761 | AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , , |
762 | [#include <libxml/tree.h> | |
763 | #include <libxml/parser.h>], | |
764 | [LIBXML_TEST_VERSION]) | |
765 | ||
766 | if test "${PBX_LIBXML2}" != 1; then | |
767 | AC_MSG_NOTICE(*** The Asterisk menuselect tool requires the 'libxml2' development package.) | |
768 | AC_MSG_NOTICE(*** Please install the 'libxml2' development package.) | |
26c7e684 MJ |
769 | exit 1 |
770 | fi | |
771 | ||
dd332177 JC |
772 | AST_EXT_LIB_CHECK([URIPARSER], [uriparser], [uriParseUriA], [uriparser/Uri.h]) |
773 | ||
1bf2d9e9 TL |
774 | # Another mandatory item (unless it's explicitly disabled) |
775 | AC_ARG_ENABLE([xmldoc], | |
776 | [AS_HELP_STRING([--disable-xmldoc], | |
92ef8a6f | 777 | [Explicitly disable XML documentation])], |
1bf2d9e9 | 778 | [case "${enableval}" in |
5553adb8 CF |
779 | y|ye|yes) DISABLE_XMLDOC=no ;; |
780 | n|no) DISABLE_XMLDOC=yes ;; | |
1bf2d9e9 | 781 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc) ;; |
5553adb8 | 782 | esac], [DISABLE_XMLDOC=no]) |
1bf2d9e9 | 783 | |
5553adb8 CF |
784 | AC_SUBST([DISABLE_XMLDOC]) |
785 | if test "${DISABLE_XMLDOC}" != "yes"; then | |
786 | AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.]) | |
1bf2d9e9 TL |
787 | fi |
788 | ||
b40c4d59 GJ |
789 | AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}]) |
790 | AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}]) | |
791 | ||
ccac55b8 SK |
792 | AC_ARG_ENABLE([permanent-dlopen], |
793 | [AS_HELP_STRING([--enable-permanent-dlopen], | |
794 | [Enable when your libc has a permanent dlopen like musl])], | |
795 | [case "${enableval}" in | |
796 | y|ye|yes) PERMANENT_DLOPEN=yes ;; | |
797 | n|no) PERMANENT_DLOPEN=no ;; | |
798 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-permanent-dlopen) ;; | |
799 | esac], [PERMANENT_DLOPEN=no]) | |
800 | ||
801 | AC_SUBST([PERMANENT_DLOPEN]) | |
b8db1dae | 802 | if test "${PERMANENT_DLOPEN}" = "yes"; then |
ccac55b8 SK |
803 | AC_DEFINE([HAVE_PERMANENT_DLOPEN], 1, [Define to support libc with permanent dlopen.]) |
804 | fi | |
805 | ||
dd942866 MM |
806 | # some embedded systems omit internationalization (locale) support |
807 | AC_CHECK_HEADERS([xlocale.h]) | |
808 | ||
aeba4fef LR |
809 | AC_CHECK_HEADERS([winsock.h winsock2.h]) |
810 | ||
0bdd99ad RB |
811 | AC_CHECK_HEADER([sys/poll.h], |
812 | [], | |
813 | AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])) | |
814 | ||
d5b7bf2a KF |
815 | AC_SYS_LARGEFILE |
816 | ||
817 | # Checks for typedefs, structures, and compiler characteristics. | |
818 | AC_HEADER_STDBOOL | |
819 | AC_C_CONST | |
820 | AC_TYPE_UID_T | |
821 | AC_C_INLINE | |
d8457eb1 | 822 | AC_TYPE_LONG_DOUBLE_WIDER |
d5b7bf2a KF |
823 | AC_TYPE_MODE_T |
824 | AC_TYPE_OFF_T | |
825 | AC_TYPE_PID_T | |
826 | AC_TYPE_SIZE_T | |
827 | AC_CHECK_MEMBERS([struct stat.st_blksize]) | |
76888b59 KM |
828 | AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h> |
829 | #include <sys/socket.h> ]) | |
1b0df8c3 | 830 | AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>]) |
d5b7bf2a KF |
831 | AC_STRUCT_TM |
832 | AC_C_VOLATILE | |
833 | AC_CHECK_TYPES([ptrdiff_t]) | |
38a619af DL |
834 | stat_nsec_found=no |
835 | AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimensec, struct stat.st_mtimespec], [stat_nsec_found=yes], [], [[#include <sys/stat.h>]]) | |
836 | ||
837 | if test "${stat_nsec_found}" != yes; then | |
838 | AC_MSG_WARN(Cannot determine nanosecond field of struct stat) | |
839 | fi | |
d5b7bf2a KF |
840 | |
841 | # Checks for library functions. | |
842 | AC_FUNC_CHOWN | |
843 | AC_FUNC_CLOSEDIR_VOID | |
844 | AC_FUNC_ERROR_AT_LINE | |
a394f4ad | 845 | AST_FUNC_FORK |
d5b7bf2a KF |
846 | AC_FUNC_FSEEKO |
847 | AC_PROG_GCC_TRADITIONAL | |
0a27d8bf KF |
848 | # XXX: these are commented out until we determine whether it matters if our malloc() |
849 | # acts exactly like glibc's or not | |
850 | # AC_FUNC_MALLOC | |
851 | # AC_FUNC_REALLOC | |
d5b7bf2a | 852 | AC_FUNC_MEMCMP |
d5b7bf2a | 853 | AC_FUNC_MMAP |
d5b7bf2a | 854 | AC_FUNC_SELECT_ARGTYPES |
d5b7bf2a KF |
855 | AC_FUNC_STAT |
856 | AC_FUNC_STRCOLL | |
857 | AC_FUNC_STRFTIME | |
858 | AC_FUNC_STRNLEN | |
859 | AC_FUNC_STRTOD | |
860 | AC_FUNC_UTIME_NULL | |
861 | AC_FUNC_VPRINTF | |
6d69fb3c | 862 | AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale pipe2 ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim]) |
965777cc DL |
863 | |
864 | AC_MSG_CHECKING(for htonll) | |
865 | AC_LINK_IFELSE( | |
866 | [AC_LANG_PROGRAM([#include <arpa/inet.h>], | |
867 | [return htonll(0);])], | |
868 | AC_MSG_RESULT(yes) | |
869 | AC_DEFINE(HAVE_HTONLL, 1, [Define to 1 if arpa/inet.h includes a htonll definition.]), | |
870 | AC_MSG_RESULT(no) | |
871 | ) | |
872 | ||
873 | AC_MSG_CHECKING(for ntohll) | |
874 | AC_LINK_IFELSE( | |
875 | [AC_LANG_PROGRAM([#include <arpa/inet.h>], | |
876 | [return ntohll(0);])], | |
877 | AC_MSG_RESULT(yes) | |
878 | AC_DEFINE(HAVE_NTOHLL, 1, [Define to 1 if arpa/inet.h includes a ntohll definition.]), | |
879 | AC_MSG_RESULT(no) | |
880 | ) | |
d5b7bf2a | 881 | |
d8457eb1 TL |
882 | # NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks, |
883 | # so that AC_CHECK_FUNCS can detect functions in that library. | |
74d7f7f7 | 884 | AC_CHECK_LIB([m], [sqrt]) |
d8457eb1 | 885 | # BSD might not have exp2, and/or log2 |
e6a36741 | 886 | AC_CHECK_FUNCS([exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round roundf trunc floor ceil]) |
d8457eb1 TL |
887 | |
888 | # Certain architectures don't really have long double, even though | |
889 | # AC_CHECK_FUNCS would otherwise find the following functions. | |
890 | if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then | |
891 | AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill]) | |
892 | fi | |
3f0324ea | 893 | |
753fa3b2 TL |
894 | AC_MSG_CHECKING(for LLONG_MAX in limits.h) |
895 | AC_LINK_IFELSE( | |
35a5b042 KF |
896 | [AC_LANG_PROGRAM([#include <limits.h>], |
897 | [long long foo = LLONG_MAX])], | |
753fa3b2 TL |
898 | AC_MSG_RESULT(yes) |
899 | AC_DEFINE([HAVE_LLONG_MAX], 1, [Define to 1 if limits.h includes a LLONG_MAX definition.]), | |
900 | AC_MSG_RESULT(no) | |
901 | ) | |
902 | ||
3f0324ea | 903 | AC_MSG_CHECKING(for timersub in time.h) |
59efa922 | 904 | AC_LINK_IFELSE( |
35a5b042 KF |
905 | [AC_LANG_PROGRAM([#include <sys/time.h>], |
906 | [struct timeval *a; timersub(a, a, a);])], | |
59efa922 LR |
907 | AC_MSG_RESULT(yes) |
908 | AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]), | |
909 | AC_MSG_RESULT(no) | |
910 | ) | |
911 | ||
0ab4420d TL |
912 | AC_MSG_CHECKING(for a version of GNU ld that supports the --dynamic-list flag) |
913 | old_LDFLAGS=${LDFLAGS} | |
a76c8e36 TL |
914 | cat >conftest.dynamics <<_ACEOF |
915 | { | |
916 | *ast_*; | |
917 | }; | |
918 | _ACEOF | |
919 | LDFLAGS="${LDFLAGS} -Wl,--dynamic-list,conftest.dynamics" | |
0ab4420d TL |
920 | PBX_DYNAMIC_LIST=0 |
921 | AC_LINK_IFELSE( | |
35a5b042 | 922 | [AC_LANG_PROGRAM([], [])], |
0ab4420d TL |
923 | PBX_DYNAMIC_LIST=1 |
924 | AC_MSG_RESULT(yes), | |
925 | AC_MSG_RESULT(no) | |
926 | ) | |
927 | AC_SUBST(PBX_DYNAMIC_LIST) | |
928 | LDFLAGS=${old_LDFLAGS} | |
a76c8e36 | 929 | rm -f conftest.dynamics |
0ab4420d | 930 | |
92ef8a6f | 931 | AC_CHECK_HEADER([sys/poll.h], |
50549958 RB |
932 | [HAS_POLL=1] |
933 | AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]), | |
934 | ) | |
99db9f65 | 935 | |
9b0a2e52 SB |
936 | AC_ARG_ENABLE([internal-poll], |
937 | [AS_HELP_STRING([--enable-internal-poll], | |
938 | [Use Asterisk's poll implementation])], | |
99db9f65 MM |
939 | [case "${enableval}" in |
940 | y|ye|yes) HAS_POLL="";; | |
941 | n|no) HAS_POLL="${HAS_POLL}" ;; | |
942 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-internal-poll) ;; | |
943 | esac]) | |
3b1f69de | 944 | AC_SUBST(HAS_POLL) |
d209cb09 | 945 | |
92ef8a6f KF |
946 | AC_ARG_ENABLE([asteriskssl], |
947 | [AS_HELP_STRING([--disable-asteriskssl], | |
948 | [Disable Asterisk's SSL wrapper library])], | |
949 | [case "${enableval}" in | |
950 | y|ye|yes) AST_ASTERISKSSL=yes ;; | |
951 | n|no) AST_ASTERISKSSL=no ;; | |
952 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-asteriskssl) ;; | |
953 | esac], [AST_ASTERISKSSL=yes]) | |
954 | AC_SUBST(AST_ASTERISKSSL) | |
99db9f65 | 955 | |
a0f06d0d LR |
956 | AC_CHECK_FUNCS([inet_aton]) |
957 | ||
32701f50 | 958 | # check if we have IP_PKTINFO constant defined |
3f0324ea | 959 | AC_MSG_CHECKING(for IP_PKTINFO) |
32701f50 | 960 | AC_LINK_IFELSE( |
35a5b042 KF |
961 | [AC_LANG_PROGRAM([#include <netinet/in.h>], |
962 | [int pi = IP_PKTINFO;])], | |
32701f50 TL |
963 | AC_MSG_RESULT(yes) |
964 | AC_DEFINE([HAVE_PKTINFO], 1, [Define to 1 if your system defines IP_PKTINFO.]), | |
965 | AC_MSG_RESULT(no) | |
966 | ) | |
967 | ||
6a879eea MG |
968 | # NetBSD libc ships with an internal-only incompatible symbol gethostbyname_r |
969 | AC_CHECK_DECLS([gethostbyname_r], | |
970 | [have_gethostbyname_r_public_declaration=yes], | |
971 | [have_gethostbyname_r_public_declaration=no], | |
972 | [#include <stdlib.h> | |
973 | #include <netdb.h>] | |
d51079b7 JC |
974 | ) |
975 | ||
6a879eea MG |
976 | if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then |
977 | # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c | |
978 | AC_SEARCH_LIBS(gethostbyname_r, [socket nsl]) | |
979 | ||
980 | AC_MSG_CHECKING(for gethostbyname_r with 6 arguments) | |
981 | AC_LINK_IFELSE( | |
982 | [AC_LANG_PROGRAM([#include <stdlib.h> | |
983 | #include <netdb.h>], | |
0e629512 | 984 | [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])], |
6a879eea MG |
985 | AC_MSG_RESULT(yes) |
986 | AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]), | |
987 | AC_MSG_RESULT(no) | |
988 | ) | |
989 | ||
990 | AC_MSG_CHECKING(for gethostbyname_r with 5 arguments) | |
991 | AC_LINK_IFELSE( | |
992 | [AC_LANG_PROGRAM([#include <stdlib.h> | |
993 | #include <netdb.h>], | |
0e629512 | 994 | [int r = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])], |
6a879eea MG |
995 | AC_MSG_RESULT(yes) |
996 | AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]), | |
997 | AC_MSG_RESULT(no) | |
998 | ) | |
999 | fi | |
c15f7953 | 1000 | |
91c3d90e JC |
1001 | AC_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])]) |
1002 | ||
1003 | AC_MSG_CHECKING(for __swap16 variant of <sys/endian.h> byteswapping macros) | |
1004 | AC_LINK_IFELSE( | |
35a5b042 | 1005 | [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);])], |
91c3d90e JC |
1006 | AC_MSG_RESULT(yes) |
1007 | AC_DEFINE([HAVE_SYS_ENDIAN_SWAP16], 1, [Define to 1 if your sys/endian.h header file provides the __swap16 macro.]), | |
1008 | AC_MSG_RESULT(no) | |
1009 | ) | |
1010 | ||
1011 | AC_MSG_CHECKING(for bswap16 variant of <sys/endian.h> byteswapping macros) | |
1012 | AC_LINK_IFELSE( | |
35a5b042 | 1013 | [AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);])], |
91c3d90e JC |
1014 | AC_MSG_RESULT(yes) |
1015 | AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header file provides the bswap16 macro.]), | |
1016 | AC_MSG_RESULT(no) | |
1017 | ) | |
1018 | ||
3c26b511 TL |
1019 | AC_MSG_CHECKING(for locale_t in locale.h) |
1020 | AC_LINK_IFELSE( | |
35a5b042 | 1021 | [AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])], |
3c26b511 TL |
1022 | AC_MSG_RESULT(yes) |
1023 | AC_DEFINE([HAVE_LOCALE_T_IN_LOCALE_H], 1, [Define to 1 if your system defines the locale_t type in locale.h]), | |
1024 | AC_MSG_RESULT(no) | |
1025 | AC_MSG_CHECKING(for locale_t in xlocale.h) | |
1026 | AC_LINK_IFELSE( | |
35a5b042 | 1027 | [AC_LANG_PROGRAM([#include <xlocale.h>], [locale_t lt = NULL])], |
3c26b511 TL |
1028 | AC_MSG_RESULT(yes) |
1029 | AC_DEFINE([HAVE_LOCALE_T_IN_XLOCALE_H], 1, [Define to 1 if your system defines the locale_t type in xlocale.h]), | |
1030 | AC_MSG_RESULT(no) | |
1031 | ) | |
1032 | ) | |
1033 | ||
8d6ee962 TL |
1034 | AC_MSG_CHECKING(for O_EVTONLY in fcntl.h) |
1035 | AC_LINK_IFELSE( | |
35a5b042 | 1036 | [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_EVTONLY;])], |
8d6ee962 TL |
1037 | AC_MSG_RESULT(yes) |
1038 | AC_DEFINE([HAVE_O_EVTONLY], 1, [Define to 1 if your system defines the file flag O_EVTONLY in fcntl.h]), | |
1039 | AC_MSG_RESULT(no) | |
1040 | ) | |
1041 | ||
1042 | AC_MSG_CHECKING(for O_SYMLINK in fcntl.h) | |
1043 | AC_LINK_IFELSE( | |
35a5b042 | 1044 | [AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_SYMLINK;])], |
8d6ee962 TL |
1045 | AC_MSG_RESULT(yes) |
1046 | AC_DEFINE([HAVE_O_SYMLINK], 1, [Define to 1 if your system defines the file flag O_SYMLINK in fcntl.h]), | |
1047 | AC_MSG_RESULT(no) | |
1048 | ) | |
1049 | ||
aebb4aaa | 1050 | AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h]) |
54567cf2 JC |
1051 | |
1052 | AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h) | |
1053 | AC_LINK_IFELSE( | |
35a5b042 | 1054 | [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;])], |
54567cf2 JC |
1055 | AC_MSG_RESULT(yes) |
1056 | AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h]), | |
1057 | AC_MSG_RESULT(no) | |
1058 | ) | |
1059 | ||
1060 | AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h) | |
1061 | AC_LINK_IFELSE( | |
35a5b042 | 1062 | [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_RECURSIVE_NP;])], |
54567cf2 JC |
1063 | AC_MSG_RESULT(yes) |
1064 | AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h]), | |
1065 | AC_MSG_RESULT(no) | |
1066 | ) | |
1067 | ||
64045f0b GJ |
1068 | AC_MSG_CHECKING(for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h) |
1069 | AC_LINK_IFELSE( | |
1070 | [AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_ADAPTIVE_NP;])], | |
1071 | AC_MSG_RESULT(yes) | |
1072 | AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h]), | |
1073 | AC_MSG_RESULT(no) | |
1074 | ) | |
1075 | ||
1076 | AC_MSG_CHECKING(for pthread_spinlock_t in pthread.h) | |
1077 | AC_LINK_IFELSE( | |
1078 | [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_spinlock_t spin;])], | |
1079 | AC_MSG_RESULT(yes) | |
1080 | AC_DEFINE([HAVE_PTHREAD_SPINLOCK], 1, [Define to 1 if your system has pthread_spinlock_t in pthread.h]), | |
1081 | AC_MSG_RESULT(no) | |
1082 | ) | |
1083 | ||
13f15cae TL |
1084 | save_LIBS="$LIBS" |
1085 | save_CFLAGS="$CFLAGS" | |
1086 | LIBS="$PTHREAD_LIBS $LIBS" | |
1087 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
2de42c2a DL |
1088 | |
1089 | AC_MSG_CHECKING(for pthread_rwlock_timedwrlock() in pthread.h) | |
25cea89d TL |
1090 | AC_LINK_IFELSE( |
1091 | [AC_LANG_PROGRAM( | |
1092 | [#include <pthread.h> | |
1093 | #include <time.h>], | |
1094 | [pthread_rwlock_t foo; struct timespec bar; pthread_rwlock_timedwrlock(&foo, &bar)]) | |
1095 | ],[ | |
1096 | AC_MSG_RESULT(yes) | |
1097 | ac_cv_pthread_rwlock_timedwrlock="yes" | |
1098 | ],[ | |
1099 | AC_MSG_RESULT(no) | |
1100 | ac_cv_pthread_rwlock_timedwrlock="no" | |
1101 | ] | |
1102 | ) | |
2de42c2a DL |
1103 | |
1104 | # Some platforms define sem_init(), but only support sem_open(). joyous. | |
1105 | AC_MSG_CHECKING(for working unnamed semaphores) | |
1106 | AC_RUN_IFELSE( | |
1107 | [AC_LANG_PROGRAM([#include <semaphore.h>], | |
1108 | [sem_t sem; return sem_init(&sem, 0, 0);])], | |
1109 | AC_MSG_RESULT(yes) | |
1110 | AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]), | |
f11fb762 MJ |
1111 | AC_MSG_RESULT(no), |
1112 | AC_MSG_RESULT(cross-compile) | |
1113 | AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation]) | |
1114 | AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]) | |
2de42c2a DL |
1115 | ) |
1116 | ||
13f15cae TL |
1117 | LIBS="$save_LIBS" |
1118 | CFLAGS="$save_CFLAGS" | |
25cea89d TL |
1119 | if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then |
1120 | AC_DEFINE([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK], 1, [Define if your system has pthread_rwlock_timedwrlock()]) | |
1121 | fi | |
1122 | ||
2706de85 SB |
1123 | AC_MSG_CHECKING(if PTHREAD_ONCE_INIT needs braces) |
1124 | saved_CFLAGS="${CFLAGS}" | |
1125 | CFLAGS="${CFLAGS} -Werror -Wmissing-braces" | |
1126 | AC_COMPILE_IFELSE( | |
1127 | [AC_LANG_PROGRAM( | |
ce7b0a51 SB |
1128 | [#include <pthread.h> |
1129 | void empty(){}], | |
1130 | [pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty);]) | |
2706de85 SB |
1131 | ],[ |
1132 | AC_MSG_RESULT(no) | |
1133 | ac_cv_pthread_once_needsbraces="no" | |
1134 | ],[ | |
1135 | AC_MSG_RESULT(yes) | |
1136 | ac_cv_pthread_once_needsbraces="yes" | |
1137 | ] | |
1138 | ) | |
1139 | CFLAGS="${saved_CFLAGS}" | |
1140 | if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then | |
1141 | AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT]) | |
1142 | fi | |
1143 | ||
42b08b4e | 1144 | AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h]) |
aebb4aaa | 1145 | |
bcbafc80 TL |
1146 | # Can we compare a mutex to its initial value? |
1147 | # Generally yes on OpenBSD/FreeBSD and no on Mac OS X. | |
1148 | AC_MSG_CHECKING(whether we can compare a mutex to its initial value) | |
1149 | AC_LINK_IFELSE( | |
35a5b042 | 1150 | [AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock; |
bcbafc80 TL |
1151 | if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) { |
1152 | return 0; | |
1153 | } | |
35a5b042 | 1154 | return 0])], |
bcbafc80 TL |
1155 | AC_MSG_RESULT(yes) |
1156 | AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if your system's implementation of mutexes supports comparison of a mutex to its initializer.]), | |
1157 | AC_MSG_RESULT(no) | |
1158 | ) | |
1159 | ||
edad3284 JC |
1160 | #if test "${cross_compiling}" = "no"; |
1161 | #then | |
1162 | #AC_MSG_CHECKING(for working epoll support) | |
1163 | #AC_LINK_IFELSE( | |
1164 | #AC_LANG_PROGRAM([#include <sys/epoll.h>], [int res = epoll_create(10); | |
1165 | # if (res < 0) | |
1166 | # return 1; | |
1167 | # close (res); | |
1168 | # return 0;]), | |
1169 | #AC_MSG_RESULT(yes) | |
1170 | #AC_DEFINE([HAVE_EPOLL], 1, [Define to 1 if your system has working epoll support.]), | |
1171 | #AC_MSG_RESULT(no) | |
1172 | #) | |
1173 | #fi | |
22114b50 | 1174 | |
6fbd8552 | 1175 | AC_MSG_CHECKING(for compiler sync operations) |
d5b7bf2a | 1176 | AC_LINK_IFELSE( |
35a5b042 | 1177 | [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])], |
d5b7bf2a | 1178 | AC_MSG_RESULT(yes) |
23381d2c | 1179 | ax_cv_have_gcc_atomics=1 |
6fbd8552 CF |
1180 | AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides __sync atomic operations.]), |
1181 | AC_MSG_RESULT(no) | |
1182 | ) | |
1183 | ||
1184 | AC_MSG_CHECKING(for compiler atomic operations) | |
1185 | AC_LINK_IFELSE( | |
1186 | [AC_LANG_PROGRAM([], [int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED);])], | |
1187 | AC_MSG_RESULT(yes) | |
23381d2c | 1188 | ax_cv_have_c_atomics=1 |
6fbd8552 | 1189 | AC_DEFINE([HAVE_C_ATOMICS], 1, [Define to 1 if your C compiler provides __atomic operations.]), |
d5b7bf2a KF |
1190 | AC_MSG_RESULT(no) |
1191 | ) | |
1192 | ||
23381d2c CF |
1193 | if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then |
1194 | AC_MSG_ERROR([*** Atomic operations are not supported by your compiler.]) | |
1195 | fi | |
1196 | ||
c8abb42e TL |
1197 | # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe. |
1198 | AC_MSG_CHECKING([if your system printf is NULL-safe.]) | |
1199 | AC_RUN_IFELSE( | |
35a5b042 KF |
1200 | [AC_LANG_PROGRAM([#include <stdio.h>], |
1201 | [printf("%s", NULL)])], | |
c8abb42e TL |
1202 | AC_DEFINE([HAVE_NULLSAFE_PRINTF], 1, [Define to 1 if your C library can safely print NULL to string formats.]) |
1203 | AC_MSG_RESULT(yes), | |
1204 | AC_MSG_RESULT(no), | |
1205 | # It's unlikely an embedded system will have this. | |
1206 | AC_MSG_RESULT(unknown) | |
1207 | ) | |
1208 | ||
6d69fb3c SB |
1209 | AC_MSG_CHECKING([if socket() accepts SOCK_NONBLOCK]) |
1210 | AC_RUN_IFELSE( | |
1211 | [AC_LANG_PROGRAM([ | |
1212 | #ifdef HAVE_SYS_TYPES_H | |
1213 | # include <sys/types.h> | |
1214 | #endif | |
1215 | #ifdef HAVE_SYS_SOCKET_H | |
1216 | # include <sys/socket.h> | |
1217 | #endif | |
1218 | ], [ | |
1219 | if (socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0) < 0) { | |
1220 | return 1; | |
1221 | } | |
1222 | return 0; | |
1223 | ])], | |
1224 | AC_MSG_RESULT(yes) | |
1225 | AC_DEFINE([HAVE_SOCK_NONBLOCK], 1, [Define to 1 if your socket() implementation can accept SOCK_NONBLOCK.]), | |
1226 | AC_MSG_RESULT(no), | |
1227 | AC_MSG_RESULT(cross-compile) | |
1228 | ) | |
1229 | ||
5eae9f44 TL |
1230 | AC_MSG_CHECKING(if we can increase the maximum select-able file descriptor) |
1231 | AC_RUN_IFELSE( | |
35a5b042 | 1232 | [AC_LANG_PROGRAM([ |
5eae9f44 TL |
1233 | #include <stdio.h> |
1234 | #include <sys/select.h> | |
1235 | #include <sys/time.h> | |
1236 | #include <sys/resource.h> | |
1237 | #include <string.h> | |
1238 | #include <errno.h> | |
1239 | #include <stdlib.h> | |
1240 | #include <sys/types.h> | |
1241 | #include <sys/stat.h> | |
1242 | #include <fcntl.h> | |
1243 | #include <unistd.h> | |
1244 | ], [[ | |
1245 | struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 }; | |
1246 | int fd0, fd1; | |
1247 | struct timeval tv = { 0, }; | |
1248 | struct ast_fdset { long fds_bits[[1024]]; } fds = { { 0, } }; | |
1249 | if (setrlimit(RLIMIT_NOFILE, &rlim)) { exit(1); } | |
1250 | if ((fd0 = open("/dev/null", O_RDONLY)) < 0) { exit(1); } | |
1251 | if (dup2(fd0, (fd1 = FD_SETSIZE + 1)) < 0) { exit(1); } | |
1252 | FD_SET(fd0, (fd_set *) &fds); | |
1253 | FD_SET(fd1, (fd_set *) &fds); | |
1254 | if (select(FD_SETSIZE + 2, (fd_set *) &fds, NULL, NULL, &tv) < 0) { exit(1); } | |
35a5b042 | 1255 | exit(0)]])], |
5eae9f44 TL |
1256 | AC_MSG_RESULT(yes) |
1257 | AC_DEFINE([HAVE_VARIABLE_FDSET], 1, [Define to 1 if your system can support larger than default select bitmasks.]), | |
1258 | AC_MSG_RESULT(no), | |
1259 | AC_MSG_RESULT(cross-compile) | |
1260 | ) | |
1261 | ||
1262 | if test "${ac_cv_have_variable_fdset}x" = "0x"; then | |
1263 | AC_RUN_IFELSE( | |
35a5b042 | 1264 | [AC_LANG_PROGRAM([ |
5eae9f44 TL |
1265 | #include <unistd.h> |
1266 | #include <sys/types.h> | |
1267 | #include <stdlib.h> | |
35a5b042 | 1268 | ], [if (getuid() != 0) { exit(1); }])], |
5eae9f44 TL |
1269 | AC_DEFINE([CONFIGURE_RAN_AS_ROOT], 1, [Some configure tests will unexpectedly fail if configure is run by a non-root user. These may be able to be tested at runtime.])) |
1270 | fi | |
1271 | ||
59203c51 SB |
1272 | AC_MSG_CHECKING([if we have usable eventfd support]) |
1273 | AC_RUN_IFELSE( | |
1274 | [AC_LANG_PROGRAM([#include <sys/eventfd.h>], | |
1275 | [return eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE) == -1;])], | |
1276 | AC_MSG_RESULT(yes) | |
1277 | AC_DEFINE([HAVE_EVENTFD], 1, [Define to 1 if your system supports eventfd and the EFD_NONBLOCK and EFD_SEMAPHORE flags.]), | |
e497a76d SB |
1278 | AC_MSG_RESULT(no), |
1279 | AC_MSG_RESULT(cross-compile) | |
59203c51 SB |
1280 | ) |
1281 | ||
aa7b32d1 KF |
1282 | AST_GCC_ATTRIBUTE(pure) |
1283 | AST_GCC_ATTRIBUTE(malloc) | |
1284 | AST_GCC_ATTRIBUTE(const) | |
1285 | AST_GCC_ATTRIBUTE(unused) | |
1286 | AST_GCC_ATTRIBUTE(always_inline) | |
0b0e64fe | 1287 | AST_GCC_ATTRIBUTE(deprecated) |
0113bd4b | 1288 | AST_GCC_ATTRIBUTE(sentinel) |
4522c60e | 1289 | AST_GCC_ATTRIBUTE(warn_unused_result) |
9bed50db DL |
1290 | AST_GCC_ATTRIBUTE(may_alias) |
1291 | AST_GCC_ATTRIBUTE(constructor) | |
e9f8b317 CF |
1292 | if test "$ax_cv_have_func_attribute_constructor" != "1"; then |
1293 | AC_MSG_ERROR([*** Function constructor attribute is not supported by your compiler.]) | |
1294 | fi | |
1295 | ||
9bed50db | 1296 | AST_GCC_ATTRIBUTE(destructor) |
e9f8b317 CF |
1297 | if test "$ax_cv_have_func_attribute_destructor" != "1"; then |
1298 | AC_MSG_ERROR([*** Function destructor attribute is not supported by your compiler.]) | |
1299 | fi | |
8f6e9ffc | 1300 | AST_GCC_ATTRIBUTE(noreturn,noreturn) |
aa7b32d1 | 1301 | |
a23d01e9 BV |
1302 | AC_MSG_CHECKING(for -fsanitize=address support) |
1303 | saved_sanitize_CFLAGS="${CFLAGS}" | |
1304 | saved_sanitize_LDFLAGS="${LDFLAGS}" | |
1305 | CFLAGS="-fsanitize=address -fno-omit-frame-pointer" | |
1306 | LDFLAGS="-fsanitize=address" | |
1307 | AC_COMPILE_IFELSE( | |
1308 | [AC_LANG_PROGRAM([], [int x = 1;])], | |
1309 | AC_MSG_RESULT(yes) | |
1310 | [AST_ADDRESS_SANITIZER=1], | |
edea4112 | 1311 | [AST_ADDRESS_SANITIZER=0] |
a23d01e9 BV |
1312 | AC_MSG_RESULT(no) |
1313 | ) | |
1314 | CFLAGS="${saved_sanitize_CFLAGS}" | |
1315 | LDFLAGS="${saved_sanitize_LDFLAGS}" | |
1316 | AC_SUBST(AST_ADDRESS_SANITIZER) | |
1317 | ||
1318 | AC_MSG_CHECKING(for -fsanitize=thread support) | |
1319 | saved_sanitize_CFLAGS="${CFLAGS}" | |
1320 | saved_sanitize_LDFLAGS="${LDFLAGS}" | |
1321 | CFLAGS="-fno-omit-frame-pointer -pie -fPIE -fsanitize=thread" | |
1322 | LDFLAGS="-fsanitize=thread -pie -fPIE" | |
1323 | AC_COMPILE_IFELSE( | |
1324 | [AC_LANG_PROGRAM([], [int x = 1;])], | |
1325 | AC_MSG_RESULT(yes) | |
1326 | [AST_THREAD_SANITIZER=1], | |
edea4112 | 1327 | [AST_THREAD_SANITIZER=0] |
a23d01e9 BV |
1328 | AC_MSG_RESULT(no) |
1329 | ) | |
1330 | CFLAGS="${saved_sanitize_CFLAGS}" | |
1331 | LDFLAGS="${saved_sanitize_LDFLAGS}" | |
1332 | AC_SUBST(AST_THREAD_SANITIZER) | |
1333 | ||
1334 | AC_MSG_CHECKING(for -fsanitize=leak support) | |
1335 | saved_sanitize_CFLAGS="${CFLAGS}" | |
1336 | saved_sanitize_LDFLAGS="${LDFLAGS}" | |
1337 | CFLAGS="-fno-omit-frame-pointer -fsanitize=leak" | |
1338 | LDFLAGS="-fsanitize=leak" | |
1339 | AC_COMPILE_IFELSE( | |
1340 | [AC_LANG_PROGRAM([], [int x = 1;])], | |
1341 | AC_MSG_RESULT(yes) | |
1342 | [AST_LEAK_SANITIZER=1], | |
5236ffed | 1343 | [AST_LEAK_SANITIZER=0] |
a23d01e9 BV |
1344 | AC_MSG_RESULT(no) |
1345 | ) | |
1346 | CFLAGS="${saved_sanitize_CFLAGS}" | |
1347 | LDFLAGS="${saved_sanitize_LDFLAGS}" | |
1348 | AC_SUBST(AST_LEAK_SANITIZER) | |
1349 | ||
1350 | AC_MSG_CHECKING(for -fsanitize=undefined support) | |
1351 | saved_sanitize_CFLAGS="${CFLAGS}" | |
1352 | saved_sanitize_LDFLAGS="${LDFLAGS}" | |
1353 | CFLAGS="-fno-omit-frame-pointer -fsanitize=undefined" | |
1354 | LDFLAGS="-fsanitize=undefined" | |
1355 | AC_COMPILE_IFELSE( | |
1356 | [AC_LANG_PROGRAM([], [int x = 1;])], | |
1357 | AC_MSG_RESULT(yes) | |
1358 | [AST_UNDEFINED_SANITIZER=1], | |
5236ffed | 1359 | [AST_UNDEFINED_SANITIZER=0] |
a23d01e9 BV |
1360 | AC_MSG_RESULT(no) |
1361 | ) | |
1362 | CFLAGS="${saved_sanitize_CFLAGS}" | |
1363 | LDFLAGS="${saved_sanitize_LDFLAGS}" | |
1364 | AC_SUBST(AST_UNDEFINED_SANITIZER) | |
1365 | ||
7412b3bf | 1366 | AC_MSG_CHECKING(for -Wdeclaration-after-statement support) |
512286e3 | 1367 | if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
7412b3bf JP |
1368 | AC_MSG_RESULT(yes) |
1369 | AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement | |
1370 | else | |
1371 | AC_MSG_RESULT(no) | |
1372 | AST_DECLARATION_AFTER_STATEMENT= | |
1373 | fi | |
1374 | AC_SUBST(AST_DECLARATION_AFTER_STATEMENT) | |
1375 | ||
d54717c3 | 1376 | AC_MSG_CHECKING(for -Wtrampolines support) |
29304d10 | 1377 | if $(${CC} -Wtrampolines -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
d54717c3 TW |
1378 | AC_MSG_RESULT(yes) |
1379 | AST_TRAMPOLINES=-Wtrampolines | |
1380 | else | |
1381 | AC_MSG_RESULT(no) | |
1382 | AST_TRAMPOLINES= | |
1383 | fi | |
1384 | AC_SUBST(AST_TRAMPOLINES) | |
1385 | ||
887e28d7 | 1386 | AC_MSG_CHECKING(for _FORTIFY_SOURCE support) |
98ca5c0b | 1387 | if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
887e28d7 | 1388 | AC_MSG_RESULT(yes) |
98ca5c0b | 1389 | AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" |
887e28d7 KF |
1390 | else |
1391 | AC_MSG_RESULT(no) | |
1392 | AST_FORTIFY_SOURCE= | |
1393 | fi | |
1394 | AC_SUBST(AST_FORTIFY_SOURCE) | |
1395 | ||
c7eebb3d KF |
1396 | AC_MSG_CHECKING(for -fno-strict-overflow) |
1397 | if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then | |
54d9ba76 SB |
1398 | AC_MSG_RESULT(yes) |
1399 | AST_NO_STRICT_OVERFLOW=-fno-strict-overflow | |
c7eebb3d KF |
1400 | else |
1401 | AC_MSG_RESULT(no) | |
1402 | AST_NO_STRICT_OVERFLOW= | |
1403 | fi | |
1404 | AC_SUBST(AST_NO_STRICT_OVERFLOW) | |
7412b3bf | 1405 | |
4b03eb5c | 1406 | AC_MSG_CHECKING(for -Wno-format-truncation) |
512286e3 | 1407 | if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
4b03eb5c CF |
1408 | AC_MSG_RESULT(yes) |
1409 | AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation | |
1410 | else | |
1411 | AC_MSG_RESULT(no) | |
1412 | AST_NO_FORMAT_TRUNCATION= | |
1413 | fi | |
1414 | AC_SUBST(AST_NO_FORMAT_TRUNCATION) | |
1415 | ||
945193cc PP |
1416 | AC_MSG_CHECKING(for -Wno-format-y2k) |
1417 | if $(${CC} -Wno-format-y2k -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then | |
1418 | AC_MSG_RESULT(yes) | |
1419 | AST_NO_FORMAT_Y2K=-Wno-format-y2k | |
1420 | else | |
1421 | AC_MSG_RESULT(no) | |
1422 | AST_NO_FORMAT_Y2K= | |
1423 | fi | |
1424 | AC_SUBST(AST_NO_FORMAT_Y2K) | |
1425 | ||
b5914d90 CF |
1426 | AC_MSG_CHECKING(for -Wno-stringop-truncation) |
1427 | if $(${CC} -Wno-stringop-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then | |
1428 | AC_MSG_RESULT(yes) | |
1429 | AST_NO_STRINGOP_TRUNCATION=-Wno-stringop-truncation | |
1430 | else | |
1431 | AC_MSG_RESULT(no) | |
1432 | AST_NO_STRINGOP_TRUNCATION= | |
1433 | fi | |
1434 | AC_SUBST(AST_NO_STRINGOP_TRUNCATION) | |
1435 | ||
54d9ba76 | 1436 | AC_MSG_CHECKING(for -Wshadow) |
512286e3 | 1437 | if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
54d9ba76 SB |
1438 | AC_MSG_RESULT(yes) |
1439 | AST_SHADOW_WARNINGS=-Wshadow | |
1440 | else | |
1441 | AC_MSG_RESULT(no) | |
1442 | AST_SHADOW_WARNINGS= | |
1443 | fi | |
1444 | AC_SUBST(AST_SHADOW_WARNINGS) | |
1445 | ||
8696daad | 1446 | AC_MSG_CHECKING(for -march=native support) |
7cf70df9 | 1447 | if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then |
110b01a0 AT |
1448 | AC_MSG_RESULT(yes) |
1449 | AST_NATIVE_ARCH=1 | |
7cf70df9 KF |
1450 | else |
1451 | AC_MSG_RESULT(no) | |
110b01a0 | 1452 | AST_NATIVE_ARCH=0 |
7cf70df9 | 1453 | fi |
8696daad | 1454 | AC_SUBST(AST_NATIVE_ARCH) |
7cf70df9 | 1455 | |
f8d815e1 | 1456 | |
7bd50bc0 DL |
1457 | dnl Check to see if rpath should be set in LDFLAGS |
1458 | AC_ARG_ENABLE(rpath, | |
9e222efb | 1459 | [AS_HELP_STRING([--disable-rpath], |
7bd50bc0 DL |
1460 | [Disables rpath linker option checking])], |
1461 | [case "${enableval}" in | |
1462 | y|ye|yes) check_rpath=yes ;; | |
1463 | n|no) check_rpath=no ;; | |
1464 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-rpath) ;; | |
1465 | esac], [check_rpath=yes]) | |
1466 | ||
1467 | AC_MSG_CHECKING(whether to use rpath) | |
1468 | AST_RPATH= | |
5b525c97 AT |
1469 | if test "${OSARCH}" = "NetBSD"; then |
1470 | AST_RPATH="-Wl,-rpath,/usr/pkg/lib" | |
1471 | fi | |
7bd50bc0 DL |
1472 | if test "${check_rpath}" != yes; then |
1473 | AC_MSG_RESULT(skipped) | |
1474 | elif test "${prefix}" = /usr || test "${prefix}" = NONE; then | |
1475 | AC_MSG_RESULT(not needed) | |
1476 | else | |
bc97a4de | 1477 | AST_RPATH="-Wl,-rpath,${libdir}" |
7bd50bc0 DL |
1478 | fi |
1479 | AC_SUBST(AST_RPATH) | |
1480 | ||
97d93d09 JC |
1481 | AC_MSG_CHECKING(for sysinfo) |
1482 | AC_LINK_IFELSE( | |
35a5b042 KF |
1483 | [AC_LANG_PROGRAM([#include <sys/sysinfo.h>], |
1484 | [struct sysinfo sys_info; int uptime = sys_info.uptime])], | |
97d93d09 JC |
1485 | AC_MSG_RESULT(yes) |
1486 | AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]), | |
1487 | AC_MSG_RESULT(no) | |
1488 | ) | |
1489 | ||
ea483db4 | 1490 | AC_SEARCH_LIBS(res_9_ninit, resolv) |
5418a7a1 | 1491 | AC_MSG_CHECKING(for res_ninit) |
0a27d8bf | 1492 | AC_LINK_IFELSE( |
35a5b042 | 1493 | [AC_LANG_PROGRAM([ |
ea483db4 JC |
1494 | #ifdef HAVE_SYS_SOCKET_H |
1495 | #include <sys/socket.h> | |
1496 | #endif | |
1497 | #ifdef HAVE_NETINET_IN_H | |
1498 | #include <netinet/in.h> | |
1499 | #endif | |
1500 | #ifdef HAVE_ARPA_NAMESER_H | |
1501 | #include <arpa/nameser.h> | |
1502 | #endif | |
1503 | #include <resolv.h>], | |
faf58ccc FF |
1504 | [ |
1505 | int foo; | |
1506 | foo = res_ninit(NULL); | |
1507 | foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0); | |
1508 | ])], | |
0a27d8bf | 1509 | AC_MSG_RESULT(yes) |
8a5cea16 | 1510 | AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]) |
ea483db4 | 1511 | AC_SEARCH_LIBS(res_9_ndestroy, resolv) |
8a5cea16 JP |
1512 | AC_MSG_CHECKING(for res_ndestroy) |
1513 | AC_LINK_IFELSE( | |
35a5b042 | 1514 | [AC_LANG_PROGRAM([ |
ea483db4 JC |
1515 | #ifdef HAVE_SYS_SOCKET_H |
1516 | #include <sys/socket.h> | |
1517 | #endif | |
1518 | #ifdef HAVE_NETINET_IN_H | |
1519 | #include <netinet/in.h> | |
1520 | #endif | |
1521 | #ifdef HAVE_ARPA_NAMESER_H | |
1522 | #include <arpa/nameser.h> | |
1523 | #endif | |
1524 | #include <resolv.h>], | |
35a5b042 | 1525 | [res_ndestroy(NULL);])], |
8a5cea16 JP |
1526 | AC_MSG_RESULT(yes) |
1527 | AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]), | |
1528 | AC_MSG_RESULT(no) | |
e75ae63a SB |
1529 | ) |
1530 | AC_SEARCH_LIBS(res_9_close, resolv) | |
1531 | AC_MSG_CHECKING(for res_close) | |
1532 | AC_LINK_IFELSE( | |
35a5b042 | 1533 | [AC_LANG_PROGRAM([ |
e75ae63a SB |
1534 | #ifdef HAVE_SYS_SOCKET_H |
1535 | #include <sys/socket.h> | |
1536 | #endif | |
1537 | #ifdef HAVE_NETINET_IN_H | |
1538 | #include <netinet/in.h> | |
1539 | #endif | |
1540 | #ifdef HAVE_ARPA_NAMESER_H | |
1541 | #include <arpa/nameser.h> | |
1542 | #endif | |
1543 | #include <resolv.h>], | |
35a5b042 | 1544 | [res_close();])], |
e75ae63a SB |
1545 | AC_MSG_RESULT(yes) |
1546 | AC_DEFINE([HAVE_RES_CLOSE], 1, [Define to 1 if your system has the close resolver function.]), | |
1547 | AC_MSG_RESULT(no) | |
695fc3db SB |
1548 | ) |
1549 | AC_CHECK_MEMBERS([struct __res_state._u._ext.nsaddrs], [], [], [[#include <resolv.h>]]), | |
0a27d8bf KF |
1550 | AC_MSG_RESULT(no) |
1551 | ) | |
1552 | ||
fcb1a0d7 DL |
1553 | AC_MSG_CHECKING(for BIND_8_COMPAT required) |
1554 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | |
1555 | [[ | |
1556 | #undef BIND_8_COMPAT | |
1557 | #include <arpa/nameser.h> | |
1558 | ]], | |
1559 | [[int x = NXDOMAIN]])], | |
1560 | AC_MSG_RESULT(no), | |
1561 | AC_MSG_RESULT(yes) | |
1562 | [BIND8_CFLAGS=-DBIND_8_COMPAT]) | |
1563 | AC_SUBST(BIND8_CFLAGS) | |
1564 | ||
f431c867 DB |
1565 | AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h]) |
1566 | ||
1567 | AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h]) | |
1568 | ||
9bed50db DL |
1569 | AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h]) |
1570 | ||
0638096e KF |
1571 | AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h]) |
1572 | ||
374e4e9d TL |
1573 | AC_CHECK_SIZEOF([int]) |
1574 | AC_CHECK_SIZEOF([long]) | |
1575 | AC_CHECK_SIZEOF([long long]) | |
1576 | AC_CHECK_SIZEOF([char *]) | |
336d2a1a TL |
1577 | AC_CHECK_SIZEOF(long) |
1578 | AC_CHECK_SIZEOF(long long) | |
1579 | AC_COMPUTE_INT([ac_cv_sizeof_fd_set_fds_bits], [sizeof(foo.fds_bits[[0]])], [$ac_includes_default | |
1580 | fd_set foo;]) | |
1581 | # This doesn't actually work; what it does is to use the variable set in the | |
1582 | # previous test as a cached value to set the right output variables. | |
1583 | AC_CHECK_SIZEOF(fd_set.fds_bits) | |
1584 | ||
1585 | # Set a type compatible with the previous. We cannot just use a generic type | |
1586 | # for these bits, because on big-endian systems, the bits won't match up | |
1587 | # correctly if the size is wrong. | |
1588 | if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then | |
1589 | AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [int], [Define to a type of the same size as fd_set.fds_bits[[0]]]) | |
66f13ed6 | 1590 | elif test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then |
336d2a1a | 1591 | AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]]) |
66f13ed6 | 1592 | elif test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then |
336d2a1a | 1593 | AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]]) |
66f13ed6 | 1594 | fi |
336d2a1a | 1595 | |
b98e47d1 TL |
1596 | AC_MSG_CHECKING(for dladdr in dlfcn.h) |
1597 | PBX_DLADDR=0 | |
1598 | old_LIBS=${LIBS} | |
1599 | LIBS="${LIBS} -ldl" | |
1600 | AC_LINK_IFELSE( | |
35a5b042 | 1601 | [AC_LANG_PROGRAM([#define _GNU_SOURCE 1 |
b98e47d1 TL |
1602 | #include <dlfcn.h>], |
1603 | [dladdr((void *)0, (void *)0)] | |
35a5b042 | 1604 | )], |
b98e47d1 TL |
1605 | AC_MSG_RESULT(yes) |
1606 | PBX_DLADDR=1 | |
1607 | AC_SUBST([PBX_DLADDR]) | |
1608 | AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]), | |
1609 | AC_MSG_RESULT(no) | |
1610 | ) | |
1611 | LIBS=${old_LIBS} | |
1612 | ||
36c8885c AT |
1613 | # re-check without -ldl |
1614 | # Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so. | |
1615 | if test "${PBX_DLADDR}" = "0"; then | |
1616 | AC_MSG_CHECKING(for dladdr in dlfcn.h without -ldl) | |
1617 | AC_LINK_IFELSE( | |
1618 | [AC_LANG_PROGRAM([#define _GNU_SOURCE 1 | |
1619 | #include <dlfcn.h>], | |
1620 | [dladdr((void *)0, (void *)0)] | |
1621 | )], | |
1622 | AC_MSG_RESULT(yes) | |
1623 | PBX_DLADDR=1 | |
1624 | AC_SUBST([PBX_DLADDR]) | |
1625 | AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]), | |
1626 | AC_MSG_RESULT(no) | |
1627 | ) | |
1628 | fi | |
1629 | ||
574e14cb | 1630 | |
d5b7bf2a | 1631 | # do the package library checks now |
574e14cb | 1632 | |
b98e47d1 | 1633 | AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h]) |
c5f23329 AT |
1634 | # Fedora/RedHat/CentOS require extra libraries |
1635 | AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty]) | |
1636 | # openSUSE requires -lz | |
1637 | AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz]) | |
8ddd829b | 1638 | |
72d190eb TT |
1639 | case "${OSARCH}" in |
1640 | linux*) | |
4116cfc3 | 1641 | AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h]) |
72d190eb TT |
1642 | ;; |
1643 | esac | |
4116cfc3 | 1644 | |
b5a62962 TL |
1645 | AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230]) |
1646 | AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220]) | |
1647 | AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200]) | |
ef3b2147 | 1648 | |
77503330 MF |
1649 | AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h]) |
1650 | ||
9a28a077 DB |
1651 | AST_C_COMPILE_CHECK([DAHDI_LINEREVERSE_VMWI], [struct dahdi_vmwi_info booger], [dahdi/user.h], , [enhanced dahdi vmwi support]) |
1652 | ||
d9d27790 KF |
1653 | AST_C_COMPILE_CHECK([DAHDI_ECHOCANCEL_FAX_MODE], [int foo = DAHDI_ECHOCANCEL_FAX_MODE], [dahdi/user.h]) |
1654 | ||
d9e31c74 | 1655 | AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support]) |
0e5367f7 | 1656 | AST_C_COMPILE_CHECK([TIMERFD], [timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);], [sys/timerfd.h], , [timerfd support]) |
1ce6a2d5 | 1657 | |
d5b7bf2a | 1658 | GSM_INTERNAL="yes" |
0a27d8bf | 1659 | AC_SUBST(GSM_INTERNAL) |
d5b7bf2a | 1660 | GSM_SYSTEM="yes" |
574e14cb | 1661 | if test "${USE_GSM}" != "no"; then |
72c9c5de KF |
1662 | if test "${GSM_DIR}" = "internal"; then |
1663 | GSM_SYSTEM="no" | |
1664 | elif test "${GSM_DIR}" != ""; then | |
1665 | GSM_INTERNAL="no" | |
1666 | fi | |
574e14cb | 1667 | if test "${GSM_SYSTEM}" = "yes"; then |
9993d14f | 1668 | gsmlibdir="" |
ae685fd1 | 1669 | if test "x${GSM_DIR}" != "x"; then |
f722121c RB |
1670 | if test -d ${GSM_DIR}/lib; then |
1671 | gsmlibdir="-L${GSM_DIR}/lib" | |
1672 | else | |
1673 | gsmlibdir="-L${GSM_DIR}" | |
1674 | fi | |
ae685fd1 | 1675 | fi |
574e14cb | 1676 | AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1, |
9993d14f | 1677 | [Define to indicate the GSM library]), [], ${gsmlibdir}) |
574e14cb | 1678 | if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then |
f722121c RB |
1679 | if test "x${GSM_DIR}" != "x" ; then |
1680 | AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0]) | |
1681 | AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0]) | |
1682 | else | |
1683 | AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0]) | |
1684 | AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0]) | |
1685 | fi | |
1686 | if test "${GSM_HEADER_FOUND}" = "0" ; then | |
1687 | if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then | |
1688 | if test "x${GSM_MANDATORY}" = "xyes" ; then | |
1689 | AC_MSG_NOTICE([***]) | |
1690 | AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.]) | |
1691 | AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure]) | |
1692 | AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}]) | |
1693 | exit 1 | |
1694 | fi | |
1695 | fi | |
1696 | fi | |
1697 | GSM_OK=0 | |
1698 | if test "${GSM_HEADER_FOUND}" = "1" ; then | |
1699 | AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location]) | |
1700 | GSM_OK=1 | |
66f13ed6 CF |
1701 | elif test "${GSM_GSM_HEADER_FOUND}" = "1" ; then |
1702 | AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h]) | |
1703 | GSM_OK=1 | |
f722121c RB |
1704 | fi |
1705 | if test "${GSM_OK}" = "1" ; then | |
1706 | GSM_LIB="-lgsm" | |
1707 | if test "x${GSM_DIR}" != "x"; then | |
1708 | GSM_LIB="${gsmlibdir} ${GSM_LIB}" | |
1709 | GSM_INCLUDE="-I${GSM_DIR}/include" | |
1710 | fi | |
1711 | PBX_GSM=1 | |
1712 | GSM_INTERNAL="no" | |
1713 | fi | |
574e14cb KF |
1714 | fi |
1715 | fi | |
1716 | if test "${GSM_INTERNAL}" = "yes"; then | |
d5b7bf2a | 1717 | PBX_GSM=1 |
f722121c | 1718 | AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location]) |
574e14cb KF |
1719 | fi |
1720 | fi | |
1721 | ||
b5193428 KF |
1722 | ILBC_INTERNAL="yes" |
1723 | AC_SUBST(ILBC_INTERNAL) | |
1724 | ILBC_SYSTEM="yes" | |
1725 | if test "${USE_ILBC}" != "no"; then | |
1726 | if test "${ILBC_DIR}" = "internal"; then | |
1727 | ILBC_SYSTEM="no" | |
1728 | elif test "${ILBC_DIR}" != ""; then | |
1729 | ILBC_INTERNAL="no" | |
1730 | fi | |
1731 | if test "${ILBC_SYSTEM}" = "yes"; then | |
36f84909 | 1732 | AST_PKG_CONFIG_CHECK(ILBC, libilbc < 3) |
7d4ccea7 KF |
1733 | if test "$PBX_ILBC" = "1"; then |
1734 | ILBC_INTERNAL="no" | |
b5193428 KF |
1735 | fi |
1736 | fi | |
1737 | if test "${ILBC_INTERNAL}" = "yes"; then | |
1738 | PBX_ILBC=1 | |
1739 | fi | |
1740 | fi | |
1741 | ||
ddf5a08d | 1742 | AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h]) |
42172dbe TL |
1743 | # GNU libiconv #define's iconv_open to libiconv_open, so we need to search for that symbol |
1744 | AST_EXT_LIB_CHECK([ICONV], [iconv], [libiconv_open], [iconv.h]) | |
ddf5a08d TL |
1745 | # Some versions of Linux package iconv in glibc |
1746 | AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h]) | |
b1c35179 | 1747 | |
0f9e53b6 | 1748 | # If ical.h is NOT in the libical directory, then it is of a version insufficient for us. |
13f15cae | 1749 | AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}]) |
a7498ae0 | 1750 | |
d5b7bf2a | 1751 | AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h]) |
574e14cb | 1752 | |
d5b7bf2a | 1753 | if test "${USE_IMAP_TK}" != "no"; then |
cd7f33a3 MM |
1754 | saved_cppflags="${CPPFLAGS}" |
1755 | saved_libs="${LIBS}" | |
d3b1054f | 1756 | switch_to_system_on_failure="no" |
f92d8421 | 1757 | if test "${IMAP_TK_DIR}" = ""; then |
7a04947a | 1758 | IMAP_TK_DIR="`pwd`/../imap-2004g" |
d3b1054f | 1759 | switch_to_system_on_failure="yes" |
f92d8421 | 1760 | fi |
f92d8421 MM |
1761 | if test "${IMAP_TK_DIR}" != "system"; then |
1762 | AC_MSG_CHECKING(for UW IMAP Toolkit c-client library) | |
1763 | if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then | |
1764 | imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS` | |
1765 | fi | |
1766 | imap_libs="${IMAP_TK_DIR}/c-client/c-client.a" | |
1767 | imap_include="-I${IMAP_TK_DIR}/c-client" | |
1768 | CPPFLAGS="${CPPFLAGS} ${imap_include}" | |
1769 | LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}` | |
1770 | AC_LINK_IFELSE( | |
35a5b042 | 1771 | [AC_LANG_PROGRAM( |
f92d8421 MM |
1772 | [#include "c-client.h" |
1773 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
1774 | { | |
1775 | } | |
1776 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
1777 | { | |
1778 | } | |
1779 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
1780 | { | |
1781 | } | |
1782 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
1783 | { | |
1784 | } | |
1785 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
1786 | { | |
1787 | } | |
1788 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1789 | { | |
1790 | } | |
1791 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1792 | { | |
1793 | } | |
1794 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
1795 | { | |
1796 | } | |
1797 | void mm_log (char *string,long errflg) | |
1798 | { | |
1799 | } | |
1800 | void mm_dlog (char *string) | |
1801 | { | |
1802 | } | |
1803 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
1804 | { | |
1805 | } | |
1806 | void mm_critical (MAILSTREAM *stream) | |
1807 | { | |
1808 | } | |
1809 | void mm_nocritical (MAILSTREAM *stream) | |
1810 | { | |
1811 | } | |
1812 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
1813 | { | |
1814 | } | |
1815 | void mm_fatal (char *string) | |
1816 | { | |
1817 | }], | |
1818 | [ | |
1819 | MAILSTREAM *foo = mail_open(NULL, "", 0); | |
1820 | ] | |
35a5b042 | 1821 | )], |
f92d8421 MM |
1822 | [ac_cv_imap_tk="yes"], |
1823 | [ac_cv_imap_tk="no"] | |
1824 | ) | |
1825 | if test "${ac_cv_imap_tk}" = "yes"; then | |
1826 | AC_LINK_IFELSE( | |
35a5b042 | 1827 | [AC_LANG_PROGRAM( |
f92d8421 MM |
1828 | [#include "c-client.h" |
1829 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
1830 | { | |
1831 | } | |
1832 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
1833 | { | |
1834 | } | |
1835 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
1836 | { | |
1837 | } | |
1838 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
1839 | { | |
1840 | } | |
1841 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
1842 | { | |
1843 | } | |
1844 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1845 | { | |
1846 | } | |
1847 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1848 | { | |
1849 | } | |
1850 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
1851 | { | |
1852 | } | |
1853 | void mm_log (char *string,long errflg) | |
1854 | { | |
1855 | } | |
1856 | void mm_dlog (char *string) | |
1857 | { | |
1858 | } | |
1859 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
1860 | { | |
1861 | } | |
1862 | void mm_critical (MAILSTREAM *stream) | |
1863 | { | |
1864 | } | |
1865 | void mm_nocritical (MAILSTREAM *stream) | |
1866 | { | |
1867 | } | |
1868 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
1869 | { | |
1870 | } | |
1871 | void mm_fatal (char *string) | |
1872 | { | |
1873 | }], | |
1874 | [ | |
1875 | long check = mail_expunge_full(NULL, "", 0); | |
1876 | ] | |
35a5b042 | 1877 | )], |
f92d8421 MM |
1878 | [ac_cv_imap_tk2006="yes"], |
1879 | [ac_cv_imap_tk2006="no"] | |
1880 | ) | |
1881 | fi | |
1882 | CPPFLAGS="${saved_cppflags}" | |
1883 | LIBS="${saved_libs}" | |
d3b1054f | 1884 | if test "${ac_cv_imap_tk}" = "no"; then |
f92d8421 | 1885 | AC_MSG_RESULT(no) |
d3b1054f MM |
1886 | if test "${switch_to_system_on_failure}" = "yes"; then |
1887 | IMAP_TK_DIR="system" | |
6923be5f MM |
1888 | else #This means they specified a directory. Search for a package installation there too |
1889 | AC_MSG_CHECKING([for system c-client library...]) | |
1890 | CPPFLAGS="${saved_cppflags}" | |
1891 | LIBS="${saved_libs}" | |
1892 | imap_include="-I${IMAP_TK_DIR}/include" | |
90786d21 | 1893 | imap_ldflags="-L${IMAP_TK_DIR}/lib" |
6923be5f MM |
1894 | imap_libs="-lc-client" |
1895 | CPPFLAGS="${CPPFLAGS} ${imap_include}" | |
1896 | LIBS="${LIBS} ${imap_libs} ${imap_ldflags}" | |
1897 | AC_LINK_IFELSE( | |
35a5b042 | 1898 | [AC_LANG_PROGRAM( |
6923be5f MM |
1899 | [#include "c-client.h" |
1900 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
1901 | { | |
1902 | } | |
1903 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
1904 | { | |
1905 | } | |
1906 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
1907 | { | |
1908 | } | |
1909 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
1910 | { | |
1911 | } | |
1912 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
1913 | { | |
1914 | } | |
1915 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1916 | { | |
1917 | } | |
1918 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1919 | { | |
1920 | } | |
1921 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
1922 | { | |
1923 | } | |
1924 | void mm_log (char *string,long errflg) | |
1925 | { | |
1926 | } | |
1927 | void mm_dlog (char *string) | |
1928 | { | |
1929 | } | |
1930 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
1931 | { | |
1932 | } | |
1933 | void mm_critical (MAILSTREAM *stream) | |
1934 | { | |
1935 | } | |
1936 | void mm_nocritical (MAILSTREAM *stream) | |
1937 | { | |
1938 | } | |
1939 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
1940 | { | |
1941 | } | |
1942 | void mm_fatal (char *string) | |
1943 | { | |
1944 | }], | |
1945 | [ | |
1946 | MAILSTREAM *foo = mail_open(NULL, "", 0); | |
1947 | ] | |
35a5b042 | 1948 | )], |
6923be5f MM |
1949 | [ac_cv_imap_tk="yes"], |
1950 | [ac_cv_imap_tk="no"] | |
1951 | ) | |
1952 | if test "${ac_cv_imap_tk}" = "yes"; then | |
1953 | AC_LINK_IFELSE( | |
35a5b042 | 1954 | [AC_LANG_PROGRAM( |
6923be5f MM |
1955 | [#include "c-client.h" |
1956 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
1957 | { | |
1958 | } | |
1959 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
1960 | { | |
1961 | } | |
1962 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
1963 | { | |
1964 | } | |
1965 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
1966 | { | |
1967 | } | |
1968 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
1969 | { | |
1970 | } | |
1971 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1972 | { | |
1973 | } | |
1974 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
1975 | { | |
1976 | } | |
1977 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
1978 | { | |
1979 | } | |
1980 | void mm_log (char *string,long errflg) | |
1981 | { | |
1982 | } | |
1983 | void mm_dlog (char *string) | |
1984 | { | |
1985 | } | |
1986 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
1987 | { | |
1988 | } | |
1989 | void mm_critical (MAILSTREAM *stream) | |
1990 | { | |
1991 | } | |
1992 | void mm_nocritical (MAILSTREAM *stream) | |
1993 | { | |
1994 | } | |
1995 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
1996 | { | |
1997 | } | |
1998 | void mm_fatal (char *string) | |
1999 | { | |
2000 | }], | |
2001 | [ | |
2002 | long check = mail_expunge_full(NULL, "", 0); | |
2003 | ] | |
35a5b042 | 2004 | )], |
6923be5f MM |
2005 | [ac_cv_imap_tk2006="yes"], |
2006 | [ac_cv_imap_tk2006="no"] | |
2007 | ) | |
2008 | fi | |
d3b1054f | 2009 | fi |
f92d8421 | 2010 | fi |
92ef8a6f | 2011 | fi |
f92d8421 MM |
2012 | if test "${IMAP_TK_DIR}" = "system"; then |
2013 | #We will enter here if user specified "system" or if any of above checks failed | |
2014 | AC_MSG_CHECKING([for system c-client library...]) | |
6923be5f MM |
2015 | CPPFLAGS="${saved_cppflags}" |
2016 | LIBS="${saved_libs}" | |
f92d8421 | 2017 | imap_ldflags="" |
d9776870 | 2018 | imap_libs="-lcrypto -lssl -lc-client" |
f92d8421 MM |
2019 | imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first |
2020 | CPPFLAGS="${CPPFLAGS} ${imap_include}" | |
2021 | LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}` | |
2022 | AC_LINK_IFELSE( | |
35a5b042 | 2023 | [AC_LANG_PROGRAM( |
f92d8421 MM |
2024 | [#include <stdio.h> |
2025 | #include <imap/c-client.h> | |
2026 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
2027 | { | |
2028 | } | |
2029 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
2030 | { | |
2031 | } | |
2032 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
2033 | { | |
2034 | } | |
2035 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
2036 | { | |
2037 | } | |
2038 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
2039 | { | |
2040 | } | |
2041 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2042 | { | |
2043 | } | |
2044 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2045 | { | |
2046 | } | |
2047 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
2048 | { | |
2049 | } | |
2050 | void mm_log (char *string,long errflg) | |
2051 | { | |
2052 | } | |
2053 | void mm_dlog (char *string) | |
2054 | { | |
2055 | } | |
2056 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
2057 | { | |
2058 | } | |
2059 | void mm_critical (MAILSTREAM *stream) | |
2060 | { | |
2061 | } | |
2062 | void mm_nocritical (MAILSTREAM *stream) | |
2063 | { | |
2064 | } | |
2065 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
2066 | { | |
2067 | } | |
2068 | void mm_fatal (char *string) | |
2069 | { | |
2070 | }], | |
2071 | [ | |
2072 | MAILSTREAM *foo = mail_open(NULL, "", 0); | |
2073 | ] | |
35a5b042 | 2074 | )], |
f92d8421 MM |
2075 | [ac_cv_imap_tk="yes"], |
2076 | [ac_cv_imap_tk="no"] | |
2077 | ) | |
2078 | if test "${ac_cv_imap_tk}" = "yes"; then | |
2079 | AC_LINK_IFELSE( | |
35a5b042 | 2080 | [AC_LANG_PROGRAM( |
f92d8421 MM |
2081 | [#include <stdio.h> |
2082 | #include <imap/c-client.h> | |
2083 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
2084 | { | |
2085 | } | |
2086 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
2087 | { | |
2088 | } | |
2089 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
2090 | { | |
2091 | } | |
2092 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
2093 | { | |
2094 | } | |
2095 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
2096 | { | |
2097 | } | |
2098 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2099 | { | |
2100 | } | |
2101 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2102 | { | |
2103 | } | |
2104 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
2105 | { | |
2106 | } | |
2107 | void mm_log (char *string,long errflg) | |
2108 | { | |
2109 | } | |
2110 | void mm_dlog (char *string) | |
2111 | { | |
2112 | } | |
2113 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
2114 | { | |
2115 | } | |
2116 | void mm_critical (MAILSTREAM *stream) | |
2117 | { | |
2118 | } | |
2119 | void mm_nocritical (MAILSTREAM *stream) | |
2120 | { | |
2121 | } | |
2122 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
2123 | { | |
2124 | } | |
2125 | void mm_fatal (char *string) | |
2126 | { | |
2127 | }], | |
2128 | [ | |
2129 | long check = mail_expunge_full(NULL, "", 0); | |
2130 | ] | |
35a5b042 | 2131 | )], |
f92d8421 MM |
2132 | [ac_cv_imap_tk2006="yes"], |
2133 | [ac_cv_imap_tk2006="no"] | |
2134 | ) | |
2135 | else #looking in imap directory didn't work, try c-client | |
2136 | imap_ldflags="" | |
c674efa9 | 2137 | imap_libs="-lcrypto -lssl -lc-client" |
f92d8421 MM |
2138 | imap_include="-DUSE_SYSTEM_CCLIENT" |
2139 | CPPFLAGS="${saved_cppflags}" | |
2140 | LIBS="${saved_libs}" | |
2141 | CPPFLAGS="${CPPFLAGS} ${imap_include}" | |
2142 | LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}` | |
2143 | AC_LINK_IFELSE( | |
35a5b042 | 2144 | [AC_LANG_PROGRAM( |
f92d8421 MM |
2145 | [#include <stdio.h> |
2146 | #include <c-client/c-client.h> | |
2147 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
2148 | { | |
2149 | } | |
2150 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
2151 | { | |
2152 | } | |
2153 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
2154 | { | |
2155 | } | |
2156 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
2157 | { | |
2158 | } | |
2159 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
2160 | { | |
2161 | } | |
2162 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2163 | { | |
2164 | } | |
2165 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2166 | { | |
2167 | } | |
2168 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
2169 | { | |
2170 | } | |
2171 | void mm_log (char *string,long errflg) | |
2172 | { | |
2173 | } | |
2174 | void mm_dlog (char *string) | |
2175 | { | |
2176 | } | |
2177 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
2178 | { | |
2179 | } | |
2180 | void mm_critical (MAILSTREAM *stream) | |
2181 | { | |
2182 | } | |
2183 | void mm_nocritical (MAILSTREAM *stream) | |
2184 | { | |
2185 | } | |
2186 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
2187 | { | |
2188 | } | |
2189 | void mm_fatal (char *string) | |
2190 | { | |
2191 | }], | |
2192 | [ | |
2193 | MAILSTREAM *foo = mail_open(NULL, "", 0); | |
2194 | ] | |
35a5b042 | 2195 | )], |
f92d8421 MM |
2196 | [ac_cv_imap_tk="yes"], |
2197 | [ac_cv_imap_tk="no"] | |
2198 | ) | |
fe072f44 AT |
2199 | if test "${ac_cv_imap_tk}" = "no"; then |
2200 | imap_libs="-lcrypto -lssl -lc-client4" | |
2201 | LIBS="${saved_libs} ${imap_libs} "`echo ${imap_ldflags}` | |
2202 | AC_LINK_IFELSE( | |
2203 | [AC_LANG_PROGRAM( | |
2204 | [#include <stdio.h> | |
2205 | #include <c-client/c-client.h> | |
2206 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
2207 | { | |
2208 | } | |
2209 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
2210 | { | |
2211 | } | |
2212 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
2213 | { | |
2214 | } | |
2215 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
2216 | { | |
2217 | } | |
2218 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
2219 | { | |
2220 | } | |
2221 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2222 | { | |
2223 | } | |
2224 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2225 | { | |
2226 | } | |
2227 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
2228 | { | |
2229 | } | |
2230 | void mm_log (char *string,long errflg) | |
2231 | { | |
2232 | } | |
2233 | void mm_dlog (char *string) | |
2234 | { | |
2235 | } | |
2236 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
2237 | { | |
2238 | } | |
2239 | void mm_critical (MAILSTREAM *stream) | |
2240 | { | |
2241 | } | |
2242 | void mm_nocritical (MAILSTREAM *stream) | |
2243 | { | |
2244 | } | |
2245 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
2246 | { | |
2247 | } | |
2248 | void mm_fatal (char *string) | |
2249 | { | |
2250 | }], | |
2251 | [ | |
2252 | MAILSTREAM *foo = mail_open(NULL, "", 0); | |
2253 | ] | |
2254 | )], | |
2255 | [ac_cv_imap_tk="yes"], | |
2256 | [ac_cv_imap_tk="no"] | |
2257 | ) | |
2258 | fi | |
f92d8421 MM |
2259 | if test "${ac_cv_imap_tk}" = "yes"; then |
2260 | AC_LINK_IFELSE( | |
35a5b042 | 2261 | [AC_LANG_PROGRAM( |
f92d8421 MM |
2262 | [#include <stdio.h> |
2263 | #include <c-client/c-client.h> | |
2264 | void mm_searched (MAILSTREAM *stream,unsigned long number) | |
2265 | { | |
2266 | } | |
2267 | void mm_exists (MAILSTREAM *stream,unsigned long number) | |
2268 | { | |
2269 | } | |
2270 | void mm_expunged (MAILSTREAM *stream,unsigned long number) | |
2271 | { | |
2272 | } | |
2273 | void mm_flags (MAILSTREAM *stream,unsigned long number) | |
2274 | { | |
2275 | } | |
2276 | void mm_notify (MAILSTREAM *stream,char *string,long errflg) | |
2277 | { | |
2278 | } | |
2279 | void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2280 | { | |
2281 | } | |
2282 | void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes) | |
2283 | { | |
2284 | } | |
2285 | void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status) | |
2286 | { | |
2287 | } | |
2288 | void mm_log (char *string,long errflg) | |
2289 | { | |
2290 | } | |
2291 | void mm_dlog (char *string) | |
2292 | { | |
2293 | } | |
2294 | void mm_login (NETMBX *mb,char *user,char *pwd,long trial) | |
2295 | { | |
2296 | } | |
2297 | void mm_critical (MAILSTREAM *stream) | |
2298 | { | |
2299 | } | |
2300 | void mm_nocritical (MAILSTREAM *stream) | |
2301 | { | |
2302 | } | |
2303 | long mm_diskerror (MAILSTREAM *stream,long errcode,long serious) | |
2304 | { | |
2305 | } | |
2306 | void mm_fatal (char *string) | |
2307 | { | |
2308 | }], | |
2309 | [ | |
2310 | long check = mail_expunge_full(NULL, "", 0); | |
2311 | ] | |
35a5b042 | 2312 | )], |
f92d8421 MM |
2313 | [ac_cv_imap_tk2006="yes"], |
2314 | [ac_cv_imap_tk2006="no"] | |
2315 | ) | |
2316 | fi | |
2317 | fi | |
d3b1054f MM |
2318 | fi |
2319 | if test "${ac_cv_imap_tk}" = "yes"; then | |
2320 | AC_MSG_RESULT(yes) | |
d3b1054f MM |
2321 | IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}` |
2322 | IMAP_TK_INCLUDE="${imap_include}" | |
2323 | PBX_IMAP_TK=1 | |
2324 | AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.]) | |
2325 | if test "${ac_cv_imap_tk2006}" = "yes"; then | |
2326 | AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.]) | |
f92d8421 | 2327 | fi |
d3b1054f | 2328 | else |
92ef8a6f | 2329 | AC_MSG_RESULT(no) |
f92d8421 | 2330 | fi |
cd7f33a3 MM |
2331 | CPPFLAGS="${saved_cppflags}" |
2332 | LIBS="${saved_libs}" | |
d5b7bf2a | 2333 | fi |
e61d3d91 | 2334 | |
13f15cae | 2335 | AST_EXT_LIB_CHECK([IODBC], [iodbc], [SQLConnect], [sql.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}]) |
4560279c | 2336 | |
4ac2fd4c TL |
2337 | AST_EXT_LIB_CHECK([INOTIFY], [c], [inotify_init], [sys/inotify.h]) |
2338 | ||
d20cb305 RB |
2339 | AST_EXT_LIB_CHECK([JACK], [jack], [jack_activate], [jack/jack.h]) |
2340 | ||
8d6ee962 TL |
2341 | # BSD (and OS X) equivalent of inotify |
2342 | AST_EXT_LIB_CHECK([KQUEUE], [c], [kqueue], [sys/event.h]) | |
2343 | ||
2344 | # 64-bit version of kevent (from kqueue) on OS X | |
2345 | AC_CHECK_FUNCS([kevent64]) | |
2346 | ||
85c7af38 | 2347 | AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h]) |
cfa0ec1f | 2348 | |
c511a267 RB |
2349 | AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config]) |
2350 | ||
ed394ce5 JC |
2351 | if test "${PBX_MYSQLCLIENT}" = 1; then |
2352 | AC_MSG_CHECKING(for MySQL client bool support) | |
2353 | AC_LINK_IFELSE( | |
2354 | [AC_LANG_PROGRAM([#include <mysql/mysql.h>], | |
2355 | [bool test = 1;])], | |
2356 | AC_MSG_RESULT(yes) | |
2357 | AC_DEFINE(HAVE_MYSQLCLIENT_BOOL, 1, [Define to 1 if mysql/mysql.h has bool defined.]), | |
2358 | AC_MSG_RESULT(no) | |
2359 | ) | |
2360 | AC_MSG_CHECKING(for MySQL client my_bool support) | |
2361 | AC_LINK_IFELSE( | |
2362 | [AC_LANG_PROGRAM([#include <mysql/mysql.h>], | |
2363 | [my_bool test = 1;])], | |
2364 | AC_MSG_RESULT(yes) | |
2365 | AC_DEFINE(HAVE_MYSQLCLIENT_MY_BOOL, 1, [Define to 1 if mysql/mysql.h has my_bool defined.]), | |
2366 | AC_MSG_RESULT(no) | |
2367 | ) | |
2368 | fi | |
2369 | ||
c511a267 | 2370 | AST_EXT_TOOL_CHECK([NEON], [neon-config]) |
71a3a2eb | 2371 | |
f1503b9e TW |
2372 | AST_EXT_TOOL_CHECK([NEON29], [neon-config], , [--libs], |
2373 | [#include <ne_auth.h>], | |
2374 | [#ifndef NE_AUTH_NTLM | |
2375 | #error Need libneon >= 0.29.0 | |
2376 | #endif]) | |
2377 | ||
d1163653 | 2378 | AST_PKG_CONFIG_CHECK(NETSNMP, netsnmp-agent) |
c511a267 | 2379 | AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs], |
f2d31ec0 JP |
2380 | [#include <net-snmp/net-snmp-config.h> |
2381 | #include <net-snmp/net-snmp-includes.h> | |
2382 | #include <net-snmp/agent/net-snmp-agent-includes.h>], | |
2383 | [int callback = snmp_register_callback(0, 0, NULL, NULL)]) | |
e61d3d91 | 2384 | |
d5b7bf2a KF |
2385 | AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h]) |
2386 | ||
1ba51b00 GJ |
2387 | # Check that unbound is installed and the version code fragment compiles |
2388 | AST_EXT_LIB_EXTRA_CHECK([UNBOUND], [unbound], [ub_ctx_delete], [unbound.h], | |
2389 | [], [], [ | |
2390 | AC_LANG_PROGRAM( [#include <unbound.h>], | |
2391 | [ | |
2392 | #if (UNBOUND_VERSION_MAJOR < 1 || (UNBOUND_VERSION_MAJOR == 1 && UNBOUND_VERSION_MINOR < 5 )) | |
2393 | #error "Unbound version must be >= 1.5" | |
2394 | #endif | |
2395 | ] | |
2396 | ) | |
2397 | ], [unbound version >= 1.5]) | |
abf3e409 | 2398 | |
bfefde5b | 2399 | AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h]) |
d5b7bf2a | 2400 | |
e61b50b6 | 2401 | AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_stream_init], [ogg/ogg.h]) |
d5b7bf2a | 2402 | |
8fd1e10d | 2403 | # Non-glibc platforms require libexecinfo for backtrace support |
6dfc36b6 | 2404 | AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h]) |
8fd1e10d TL |
2405 | # Linux, however, has backtrace directly in glibc |
2406 | AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h]) | |
badb8129 | 2407 | |
c511a267 RB |
2408 | AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h]) |
2409 | ||
4559cd0e NS |
2410 | AST_EXT_LIB_CHECK([BEANSTALK], [beanstalk], [bs_version], [beanstalk.h]) |
2411 | ||
5d8e0a65 | 2412 | PG_CONFIG=":" |
92ef8a6f | 2413 | if test "${USE_PGSQL}" != "no"; then |
d5b7bf2a | 2414 | if test "x${PGSQL_DIR}" != "x"; then |
5d8e0a65 AT |
2415 | AC_PATH_TOOL([PG_CONFIG], [pg_config], :, [${PGSQL_DIR}/bin]) |
2416 | if test "${PG_CONFIG}" = ":"; then | |
a40b78b8 KF |
2417 | AC_MSG_NOTICE([***]) |
2418 | AC_MSG_NOTICE([*** pg_config was not found in the path you specified:]) | |
2419 | AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin]) | |
2420 | AC_MSG_NOTICE([*** Either correct the installation, or run configure]) | |
2421 | AC_MSG_NOTICE([*** including --without-postgres]) | |
574e14cb KF |
2422 | exit 1 |
2423 | fi | |
2424 | else | |
5d8e0a65 | 2425 | AC_PATH_TOOL([PG_CONFIG], [pg_config], :) |
574e14cb KF |
2426 | fi |
2427 | fi | |
5d8e0a65 | 2428 | if test "x${PG_CONFIG}" != "x:"; then |
ecfc328d KF |
2429 | PGSQL_libdir=`${PG_CONFIG} --libdir` |
2430 | PGSQL_includedir=`${PG_CONFIG} --includedir` | |
a3478071 RB |
2431 | if test "x$?" != "x0" ; then |
2432 | if test -n "${PGSQL_MANDATORY}" ; then | |
2433 | AC_MSG_NOTICE([***]) | |
2434 | AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.]) | |
2435 | AC_MSG_NOTICE([*** Either correct the installation, or run configure]) | |
2436 | AC_MSG_NOTICE([*** including --without-postgres]) | |
2437 | exit 1 | |
2438 | fi | |
92ef8a6f | 2439 | else |
2d93695f | 2440 | AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1, |
a3478071 RB |
2441 | [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz) |
2442 | ||
f8180257 TL |
2443 | AC_MSG_CHECKING(for pg_encoding_to_char within Postgres headers) |
2444 | old_CFLAGS=${CFLAGS} | |
2445 | CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror" | |
2446 | old_LDFLAGS=${LDFLAGS} | |
2447 | LDFLAGS="${LDFLAGS} -L${PGSQL_libdir} -lpq -lz" | |
2448 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>], | |
2449 | [const char *foo = pg_encoding_to_char(1)])], | |
2450 | [AC_MSG_RESULT(yes) | |
2451 | AC_DEFINE_UNQUOTED([HAVE_PGSQL_pg_encoding_to_char], 1, [Define to indicate presence of the pg_encoding_to_char API.])], | |
2452 | [AC_MSG_RESULT(no)]) | |
2453 | CFLAGS=${old_CFLAGS} | |
2454 | LDFLAGS=${old_LDFLAGS} | |
2455 | ||
2d93695f | 2456 | if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then |
a3478071 RB |
2457 | PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz" |
2458 | PGSQL_INCLUDE="-I${PGSQL_includedir}" | |
2459 | PBX_PGSQL=1 | |
2460 | elif test -n "${PGSQL_MANDATORY}"; | |
2461 | then | |
2462 | AC_MSG_NOTICE([***]) | |
2463 | AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.]) | |
2464 | AC_MSG_NOTICE([*** Either correct the installation, or run configure]) | |
2465 | AC_MSG_NOTICE([*** including --without-postgres]) | |
2466 | exit 1 | |
2467 | fi | |
574e14cb | 2468 | fi |
13dc7ac7 | 2469 | fi |
574e14cb | 2470 | |
3173e91b | 2471 | if test "$USE_PJPROJECT" != "no" ; then |
5fb848ee | 2472 | if test "$PJPROJECT_BUNDLED" = "no" ; then |
3173e91b | 2473 | AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject]) |
ef580f96 AT |
2474 | if test "x$PBX_PJPROJECT" = "x1" ; then |
2475 | AST_EXT_LIB_CHECK([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [pjsip], [pjsip_dlg_create_uas_and_inc_lock], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2476 | AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2477 | ||
2478 | saved_cppflags="${CPPFLAGS}" | |
2479 | saved_libs="${LIBS}" | |
2480 | CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}" | |
2481 | LIBS="${LIBS} ${PJPROJECT_LIB}" | |
2482 | AST_C_COMPILE_CHECK([PJSIP_REPLACE_MEDIA_STREAM], [pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE], [pjmedia.h]) | |
2483 | LIBS="${saved_libs}" | |
2484 | CPPFLAGS="${saved_cppflags}" | |
2485 | ||
2486 | AST_EXT_LIB_CHECK([PJSIP_GET_DEST_INFO], [pjsip], [pjsip_get_dest_info], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2487 | AST_EXT_LIB_CHECK([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj], [pj_ssl_cert_load_from_files2], [pjlib.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2488 | AST_EXT_LIB_CHECK([PJSIP_EXTERNAL_RESOLVER], [pjsip], [pjsip_endpt_set_ext_resolver], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2489 | ||
2490 | saved_cppflags="${CPPFLAGS}" | |
2491 | saved_libs="${LIBS}" | |
2492 | CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}" | |
2493 | LIBS="${LIBS} ${PJPROJECT_LIB}" | |
2494 | AST_C_COMPILE_CHECK([PJSIP_TLS_TRANSPORT_PROTO], [struct pjsip_tls_setting setting; int proto; proto = setting.proto;], [pjsip.h]) | |
c52b4ce1 SB |
2495 | AST_C_COMPILE_CHECK([PJSIP_TLS_1_1], [enum pjsip_ssl_method method = PJSIP_TLSV1_1_METHOD;], [pjsip.h]) |
2496 | AST_C_COMPILE_CHECK([PJSIP_TLS_1_2], [enum pjsip_ssl_method method = PJSIP_TLSV1_2_METHOD;], [pjsip.h]) | |
2497 | AST_C_COMPILE_CHECK([PJSIP_TLS_1_3], [enum pjsip_ssl_method method = PJSIP_TLSV1_3_METHOD;], [pjsip.h]) | |
ef580f96 AT |
2498 | AST_C_COMPILE_CHECK([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;], [pjsip.h]) |
2499 | AST_C_COMPILE_CHECK([PJSIP_ENDPOINT_COMPACT_FORM], [pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;], [pjsip.h]) | |
2500 | AST_C_COMPILE_CHECK([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;], [pjsip.h]) | |
2501 | AST_C_COMPILE_CHECK([PJSIP_OAUTH_AUTHENTICATION], [struct pjsip_oauth_credential credential;], [pjsip.h]) | |
2502 | AC_MSG_CHECKING(for pjproject on_valid_pair callback) | |
2503 | AC_LINK_IFELSE( | |
2504 | [AC_LANG_PROGRAM( | |
2505 | [#include <pjsip.h> | |
2506 | #include <pjsip_ua.h> | |
2507 | #include <pjnath.h> | |
2508 | void on_valid_pair(pj_ice_sess *ice) {} | |
2509 | void on_ice_complete(pj_ice_sess *ice, pj_status_t status) {} | |
2510 | void on_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) {} | |
2511 | pj_status_t on_tx_pkt(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) {}], | |
2512 | [pj_ice_sess_cb ice_sess_cb = { | |
2513 | .on_valid_pair = on_valid_pair, | |
2514 | .on_ice_complete = on_ice_complete, | |
2515 | .on_rx_data = on_rx_data, | |
2516 | .on_tx_pkt = on_tx_pkt, | |
2517 | };])], | |
2518 | AC_MSG_RESULT(yes) | |
2519 | AC_DEFINE(HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK, 1, [Define to 1 if on_valid_pair callback is present.]), | |
2520 | AC_MSG_RESULT(no) | |
2521 | ) | |
2522 | LIBS="${saved_libs}" | |
2523 | CPPFLAGS="${saved_cppflags}" | |
2524 | ||
2525 | AST_EXT_LIB_CHECK([PJSIP_EVSUB_GRP_LOCK], [pjsip], [pjsip_evsub_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2526 | AST_EXT_LIB_CHECK([PJSIP_INV_SESSION_REF], [pjsip], [pjsip_inv_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2527 | AST_EXT_LIB_CHECK([PJSIP_AUTH_CLT_DEINIT], [pjsip], [pjsip_auth_clt_deinit], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
2528 | AST_EXT_LIB_CHECK([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip], [pjsip_tsx_layer_find_tsx2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) | |
cffaf12d | 2529 | AST_EXT_LIB_CHECK([PJSIP_TLS_TRANSPORT_RESTART], [pjsip], [pjsip_tls_transport_restart], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) |
ef580f96 | 2530 | fi |
3173e91b | 2531 | fi |
0e631a54 | 2532 | |
610e0581 AT |
2533 | if test "x$PBX_PJPROJECT" = "x1" ; then |
2534 | if test "x${AST_DEVMODE}" = "xyes" ; then | |
2535 | AC_SUBST([PYTHONDEV_LIB]) | |
2536 | AC_SUBST([PYTHONDEV_INCLUDE]) | |
2537 | AST_PKG_CONFIG_CHECK([PYTHONDEV], [python-2.7]) | |
2538 | AST_PKG_CONFIG_CHECK([PYTHONDEV], [python2]) | |
2539 | AST_PKG_CONFIG_CHECK([PYTHONDEV], [python]) | |
2540 | # The PJProject offers a C extension to Python. That wrapper is used by the | |
2541 | # Asterisk Test Framework, which requires Asterisk to be in Developer Mode. | |
2542 | # However, the used wrapper (called 'PJSUA Python') is deprecated and was not | |
2543 | # ported from Python 2.7 to Python 3.x. This is confirmed; it simply does not | |
2544 | # build. For more see <http://www.pjsip.org/trac/wiki/Python_SIP_Tutorial>. | |
2545 | # Therefore, the C libraries for Python 3 are of no help in Asterisk: | |
2546 | #AST_PKG_CONFIG_CHECK([PYTHONDEV], [python3]) | |
2547 | fi | |
2548 | fi | |
2549 | fi | |
facce6f6 | 2550 | |
d5b7bf2a | 2551 | AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h]) |
574e14cb | 2552 | |
16f6e940 | 2553 | AST_PKG_CONFIG_CHECK([PORTAUDIO], [portaudio-2.0]) |
7d0eacfb RB |
2554 | AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h]) |
2555 | ||
4ae5535d | 2556 | AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h]) |
4ef5ba58 AT |
2557 | if test "x$PBX_PRI" = "x1" ; then |
2558 | AST_EXT_LIB_CHECK([PRI_SETUP_ACK_INBAND], [pri], [pri_setup_ack], [libpri.h]) | |
2559 | AST_EXT_LIB_CHECK([PRI_L2_PERSISTENCE], [pri], [pri_persistent_layer2_option], [libpri.h]) | |
2560 | AST_EXT_LIB_CHECK([PRI_DATETIME_SEND], [pri], [pri_date_time_send_option], [libpri.h]) | |
2561 | AST_EXT_LIB_CHECK([PRI_MWI_V2], [pri], [pri_mwi_indicate_v2], [libpri.h]) | |
2562 | AST_EXT_LIB_CHECK([PRI_DISPLAY_TEXT], [pri], [pri_display_text], [libpri.h]) | |
2563 | AST_EXT_LIB_CHECK([PRI_MWI], [pri], [pri_mwi_indicate], [libpri.h]) | |
2564 | AST_EXT_LIB_CHECK([PRI_MCID], [pri], [pri_mcid_enable], [libpri.h]) | |
2565 | AST_EXT_LIB_CHECK([PRI_CALL_WAITING], [pri], [pri_connect_ack_enable], [libpri.h]) | |
2566 | AST_EXT_LIB_CHECK([PRI_AOC_EVENTS], [pri], [pri_aoc_events_enable], [libpri.h]) | |
2567 | AST_EXT_LIB_CHECK([PRI_TRANSFER], [pri], [pri_transfer_enable], [libpri.h]) | |
2568 | AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h]) | |
2569 | AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h]) | |
2570 | AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h]) | |
2571 | AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h]) | |
2572 | AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h]) | |
2573 | AST_EXT_LIB_CHECK([PRI_SETUP_KEYPAD], [pri], [pri_sr_set_keypad_digits], [libpri.h]) | |
2574 | ||
2575 | # ------------------------------------v | |
2576 | # TODO: The code can be changed to always include these features now. | |
2577 | # These features will always be present if pri_connected_line_update is available. | |
2578 | AST_EXT_LIB_CHECK([PRI_PROG_W_CAUSE], [pri], [pri_progress_with_cause], [libpri.h]) | |
2579 | AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h]) | |
2580 | AST_EXT_LIB_CHECK([PRI_SERVICE_MESSAGES], [pri], [pri_maintenance_service], [libpri.h]) | |
2581 | AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libpri.h]) | |
2582 | # ------------------------------------^ | |
2583 | fi | |
ee0cd5a3 | 2584 | |
c87f901c | 2585 | AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm]) |
804d931f | 2586 | AST_EXT_LIB_CHECK([FFTW3], [fftw3], [fftw_malloc], [fftw3.h]) |
094c26aa | 2587 | AST_EXT_LIB_CHECK([SNDFILE], [sndfile], [sf_open], [sndfile.h]) |
c87f901c | 2588 | |
ef4a7eaf RB |
2589 | AST_C_COMPILE_CHECK([SPANDSP], [ |
2590 | #if SPANDSP_RELEASE_DATE < 20080516 | |
2591 | #error "spandsp 0.0.5 or greater is required" | |
2592 | #endif | |
8fb0564c | 2593 | ], [spandsp/version.h], , [minimum version of SpanDSP]) |
ef4a7eaf | 2594 | |
64ee2bd3 RB |
2595 | if test "x${PBX_SPANDSP}" = "x1" ; then |
2596 | # We found the correct version in the header, now let's make sure it links | |
2597 | # properly, and that libtiff is available | |
2598 | PBX_SPANDSP=0 | |
2599 | AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [span_set_message_handler], [spandsp.h], [-ltiff]) | |
2600 | fi | |
2601 | ||
3d8fb2d8 TL |
2602 | if test "x${PBX_SPANDSP}" = "x1" ; then |
2603 | # We also need t38_terminal_init() | |
2604 | PBX_SPANDSP=0 | |
2605 | AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [t38_terminal_init], [spandsp.h], [-ltiff]) | |
2606 | fi | |
2607 | ||
0c896d8b RM |
2608 | # Check for libss7 v2.0 branch compatible version. |
2609 | AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h]) | |
bd76cda6 | 2610 | |
77a6840f RB |
2611 | AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h]) |
2612 | ||
ef8cdd40 | 2613 | AST_EXT_LIB_CHECK([OPUS], [opus], [opus_encoder_create], [opus/opus.h]) |
4013bfa5 CF |
2614 | # opusfile.h includes <opus_multistream.h> so we need to make sure that |
2615 | # either $OPUS_INCLUDE or /usr/include/opus is added to the search path. | |
2616 | __opus_include=${OPUS_INCLUDE} | |
2617 | if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then | |
2618 | __opus_include=-I/usr/include/opus | |
2619 | fi | |
2620 | AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include]) | |
ef8cdd40 | 2621 | |
4e038c1e | 2622 | for ver in ${LUA_VERSIONS:-5.4 5.3 5.2 5.1}; do |
66f13ed6 CF |
2623 | AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm]) |
2624 | if test "x${PBX_LUA}" = "x1" ; then | |
2625 | if test x"${LUA_DIR}" = x; then | |
2626 | LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}" | |
2627 | else | |
2628 | LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}" | |
2629 | fi | |
2630 | break; | |
a7498ae0 | 2631 | fi |
66f13ed6 | 2632 | done |
92ef8a6f | 2633 | |
ef79e583 | 2634 | # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix. |
4e038c1e JK |
2635 | if test "x${LUA_VERSIONS}" = "x"; then |
2636 | AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm]) | |
2637 | fi | |
e8c781b2 | 2638 | |
ade5c8a2 KH |
2639 | # Accept either RADIUS client library, their APIs are fully compatible, |
2640 | # just different header filenames and different SONAMEs | |
2641 | AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h]) | |
2642 | if test "x${PBX_RADIUS}" = "x1"; then | |
97a75e38 | 2643 | AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header]) |
ade5c8a2 KH |
2644 | else |
2645 | AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h]) | |
97a75e38 TC |
2646 | if test "x${PBX_RADIUS}" = "x1"; then |
2647 | AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header]) | |
2648 | else | |
2649 | AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h]) | |
2650 | if test "x${PBX_RADIUS}" = "x1"; then | |
2651 | AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header]) | |
2652 | fi | |
2653 | fi | |
ade5c8a2 | 2654 | fi |
d5b7bf2a | 2655 | |
2e79f52d AT |
2656 | AST_EXT_LIB_CHECK([CODEC2], [codec2], [codec2_create], [codec2/codec2.h]) |
2657 | ||
f4798faa | 2658 | AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg]) |
eebdf351 | 2659 | AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg]) |
661a2201 | 2660 | |
d5b7bf2a KF |
2661 | AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm]) |
2662 | ||
fc120bf8 | 2663 | # See if the main speex library contains the preprocess functions |
2090cff7 | 2664 | AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm]) |
fc120bf8 JC |
2665 | if test "${PBX_SPEEX_PREPROCESS}" = 1; then |
2666 | PBX_SPEEX_PREPROCESS=1 | |
2667 | fi | |
2668 | ||
c692e1ca | 2669 | AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm]) |
fc120bf8 JC |
2670 | if test "${PBX_SPEEXDSP}" = 1; then |
2671 | PBX_SPEEX_PREPROCESS=1 | |
2672 | fi | |
2673 | ||
2674 | AC_SUBST(PBX_SPEEX_PREPROCESS) | |
c692e1ca | 2675 | |
7ad1f994 | 2676 | AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}]) |
5bea998a | 2677 | |
efd040cd | 2678 | if test "${PBX_SQLITE3}" != 1; then |
ced84d7e MJ |
2679 | AC_MSG_ERROR(*** Asterisk now uses SQLite3 for the internal Asterisk database.) |
2680 | AC_MSG_ERROR(*** Please install the SQLite3 development package.) | |
efd040cd TW |
2681 | exit 1 |
2682 | fi | |
2683 | ||
dcf03554 DL |
2684 | # Find crypt support |
2685 | # * -lcrypt on *NIX | |
2686 | # * in libsystem on OS X | |
2687 | AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h]) | |
2688 | AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=""]) | |
2689 | ||
2690 | if test "x$LIBCRYPT_LIB" != "x" ; then | |
2691 | CRYPT_LIB="$LIBCRYPT_LIB" | |
2692 | CRYPT_INCLUDE="$LIBCRYPT_INCLUDE" | |
3173e91b | 2693 | AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.]) |
dcf03554 DL |
2694 | elif test "x$SYSCRYPT" != "x" ; then |
2695 | CRYPT_LIB="" | |
2696 | CRYPT_INCLUDE="" | |
3173e91b | 2697 | AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.]) |
dcf03554 DL |
2698 | fi |
2699 | ||
2700 | AC_SUBST(CRYPT_LIB) | |
2701 | AC_SUBST(CRYPT_INCLUDE) | |
2702 | ||
2703 | # Find crypt_r support | |
2704 | AC_CHECK_LIB([crypt], [crypt_r], | |
3173e91b | 2705 | [AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the 'crypt_r' function.])]) |
dcf03554 | 2706 | |
1f136fe8 SB |
2707 | AST_EXT_LIB_CHECK([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [2]) |
2708 | AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [], [ | |
2709 | AC_MSG_WARN([***]) | |
2710 | AC_MSG_WARN([*** libsrtp2 could not be linked as a shared object.]) | |
2711 | AC_MSG_WARN([*** Try compiling libsrtp2 manually. Configure libsrtp2]) | |
2712 | AC_MSG_WARN([*** with ./configure --prefix=/usr replacing /usr with]) | |
2713 | AC_MSG_WARN([*** the prefix of your choice, and then make with]) | |
2714 | AC_MSG_WARN([*** 'make libsrtp2.so']) | |
2715 | AC_MSG_WARN([***]) | |
2716 | AC_MSG_WARN([*** After re-installing libsrtp2, re-run the Asterisk]) | |
2717 | AC_MSG_WARN([*** configure script.]) | |
2718 | AC_MSG_WARN([***]) | |
2719 | AC_MSG_WARN([*** If you do not need SRTP support re-run configure]) | |
2720 | AC_MSG_WARN([*** with the --without-srtp option.]) | |
2721 | exit 1 | |
2722 | ]) | |
857814f4 | 2723 | |
1f136fe8 | 2724 | if test "x$PBX_SRTP" = x1; |
75033d07 | 2725 | then |
1f136fe8 | 2726 | AST_EXT_LIB_CHECK([SRTP_256], [srtp2], [srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80]) |
95b45d1c | 2727 | AST_EXT_LIB_CHECK([SRTP_192], [srtp2], [srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80]) |
1f136fe8 SB |
2728 | AST_EXT_LIB_CHECK([SRTP_GCM], [srtp2], [srtp_crypto_policy_set_aes_gcm_128_8_auth]) |
2729 | AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h]) | |
3d9deb35 | 2730 | AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp2], [srtp_get_version_string], [srtp2/srtp.h]) |
1f136fe8 SB |
2731 | |
2732 | # libsrtp2 removed support for PRNG, so we require OpenSSL | |
2733 | if test "x$PBX_OPENSSL" != x1; | |
2734 | then | |
2735 | AC_MSG_WARN([***]) | |
2736 | AC_MSG_WARN([*** OpenSSL required when using libsrtp2, checking for libsrtp instead.]) | |
2737 | AC_MSG_WARN([***]) | |
2738 | PBX_SRTP=0 | |
2739 | fi | |
75033d07 TW |
2740 | fi |
2741 | ||
1f136fe8 | 2742 | if test "x$PBX_SRTP" != x1; |
1d2173c7 | 2743 | then |
1f136fe8 SB |
2744 | AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [1]) |
2745 | AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [], [ | |
2746 | AC_MSG_WARN([***]) | |
2747 | AC_MSG_WARN([*** libsrtp could not be linked as a shared object.]) | |
2748 | AC_MSG_WARN([*** Try compiling libsrtp manually. Configure libsrtp]) | |
2749 | AC_MSG_WARN([*** with ./configure CFLAGS=-fPIC --prefix=/usr]) | |
2750 | AC_MSG_WARN([*** replacing /usr with the prefix of your choice.]) | |
2751 | AC_MSG_WARN([*** After re-installing libsrtp, re-run the Asterisk]) | |
2752 | AC_MSG_WARN([*** configure script.]) | |
2753 | AC_MSG_WARN([***]) | |
2754 | AC_MSG_WARN([*** If you do not need SRTP support re-run configure]) | |
2755 | AC_MSG_WARN([*** with the --without-srtp option.]) | |
2756 | exit 1 | |
2757 | ]) | |
2758 | ||
2759 | if test "x$PBX_SRTP" = x1; | |
2760 | then | |
2761 | AST_EXT_LIB_CHECK([SRTP_256], [srtp], [crypto_policy_set_aes_cm_256_hmac_sha1_80]) | |
2762 | AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80]) | |
2763 | AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [crypto_policy_set_aes_gcm_128_8_auth]) | |
2764 | AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h]) | |
3d9deb35 | 2765 | AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp], [srtp_get_version_string], [srtp/srtp.h]) |
1f136fe8 | 2766 | fi |
1d2173c7 AT |
2767 | fi |
2768 | ||
f824cd6a | 2769 | for ver in 3.0 2.6 2.4 2.2 2.0; do |
c79bafa9 TC |
2770 | AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver) |
2771 | if test "$PBX_GMIME" = 1; then | |
938290cf | 2772 | break; |
c79bafa9 TC |
2773 | fi |
2774 | done | |
2640afa4 | 2775 | |
6cf6d9ec SB |
2776 | AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], []) |
2777 | ||
19830f33 | 2778 | AST_EXT_LIB_CHECK([FREETDS], [sybdb], [dbinit], [sybdb.h]) |
98a465fc | 2779 | |
94172b4b TL |
2780 | AC_CHECK_LIB([tonezone], [tone_zone_find_by_num], tonezone_does_not_need_lm=yes, tonezone_does_not_need_lm=no) |
2781 | ||
2782 | if test "${tonezone_does_not_need_lm}" = "no" ; then | |
d5b7bf2a | 2783 | tonezone_extra="-lm" |
e61d3d91 KF |
2784 | fi |
2785 | ||
e99eece4 | 2786 | AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra} ${DAHDI_INCLUDE}]) |
d5b7bf2a | 2787 | |
02fa145a | 2788 | AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile]) |
7093cf27 | 2789 | AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h]) |
e61d3d91 | 2790 | |
d5b7bf2a | 2791 | AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h]) |
e61d3d91 | 2792 | |
c9dd40c1 TL |
2793 | if test "x${PBX_UNIXODBC}" = "x1" -o "x${PBX_IODBC}" = "x1"; then |
2794 | # Does ODBC support wide characters? | |
2795 | AC_MSG_CHECKING(whether ODBC has support for Unicode types) | |
2796 | AC_LINK_IFELSE( | |
35a5b042 | 2797 | [AC_LANG_PROGRAM( |
c9dd40c1 TL |
2798 | [#include <sql.h> |
2799 | #include <sqlext.h>], | |
35a5b042 | 2800 | [int foo = SQL_WCHAR])], |
c9dd40c1 TL |
2801 | AC_MSG_RESULT(yes) |
2802 | AC_DEFINE([HAVE_ODBC_WCHAR], [1], [Define to 1 if your ODBC library has wide (Unicode) types.]), | |
2803 | AC_MSG_RESULT(no) | |
2804 | ) | |
2805 | fi | |
2806 | ||
2d3f9ce2 JC |
2807 | AC_CHECK_HEADER([linux/compiler.h], |
2808 | [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])]) | |
2809 | ||
aa9ec67f | 2810 | |
c511a267 | 2811 | AST_EXT_TOOL_CHECK([SDL], [sdl-config]) |
52619b6e | 2812 | AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}]) |
13f15cae | 2813 | AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [${PTHREAD_LIBS} -lz -lm], [${PTHREAD_CFLAGS}]) |
732c1d30 | 2814 | |
2ff174e6 LR |
2815 | # possible places for video4linux version 1 |
2816 | AC_CHECK_HEADER([linux/videodev.h], | |
2817 | [AC_DEFINE_UNQUOTED([HAVE_VIDEODEV_H], 1, [Define to 1 if your system has linux/videodev.h.])]) | |
2818 | ||
b4ab6b56 LR |
2819 | # possible places for X11 |
2820 | AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path]) | |
2821 | AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6]) | |
2822 | ||
e3873889 | 2823 | PBX_LAUNCHD=0 |
c3a1ec6d JC |
2824 | if test "${cross_compiling}" = "no"; |
2825 | then | |
965777cc DL |
2826 | AC_CHECK_FILE(/sbin/launchd, |
2827 | [PBX_LAUNCHD=1] | |
2828 | AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.])) | |
c3a1ec6d | 2829 | fi |
e3873889 | 2830 | AC_SUBST(PBX_LAUNCHD) |
1dc86caf | 2831 | |
c79bafa9 | 2832 | AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0]) |
7f31b58b | 2833 | |
9a7efae8 KF |
2834 | # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred) |
2835 | # or iODBC | |
2836 | ||
2837 | PBX_GENERIC_ODBC=0 | |
2838 | ||
2839 | if test "${PBX_UNIXODBC}" = 1; then | |
2840 | PBX_GENERIC_ODBC=1 | |
2841 | GENERIC_ODBC_LIB="${UNIXODBC_LIB}" | |
2842 | GENERIC_ODBC_INCLUDE="${UNIXODBC_INCLUDE}" | |
2843 | elif test "${PBX_IODBC}" = 1; then | |
2844 | PBX_GENERIC_ODBC=1 | |
2845 | GENERIC_ODBC_LIB="${IODBC_LIB}" | |
2846 | GENERIC_ODBC_INCLUDE="${IODBC_INCLUDE}" | |
2847 | fi | |
2848 | ||
2849 | AC_SUBST([GENERIC_ODBC_LIB]) | |
2850 | AC_SUBST([GENERIC_ODBC_INCLUDE]) | |
2851 | AC_SUBST([PBX_GENERIC_ODBC]) | |
2852 | ||
07b95f7c TC |
2853 | AC_SUBST([PBX_SYSTEMD]) |
2854 | AC_SUBST([SYSTEMD_LIB]) | |
2855 | AC_SUBST([SYSTEMD_INCLUDE]) | |
2856 | AST_PKG_CONFIG_CHECK([SYSTEMD], [libsystemd]) | |
2857 | ||
a4284a50 SB |
2858 | PBX_SYSLOG=0 |
2859 | ||
2f88262a SB |
2860 | if test "${ac_cv_header_syslog_h}" = "yes"; then |
2861 | # syslog facilities | |
2862 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTH], [LOG_AUTH], [syslog.h]) | |
2863 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTHPRIV], [LOG_AUTHPRIV], [syslog.h]) | |
2864 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_CRON], [LOG_CRON], [syslog.h]) | |
2865 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_DAEMON], [LOG_DAEMON], [syslog.h]) | |
2866 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_FTP], [LOG_FTP], [syslog.h]) | |
2867 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_KERN], [LOG_KERN], [syslog.h]) | |
2868 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_LPR], [LOG_LPR], [syslog.h]) | |
2869 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_MAIL], [LOG_MAIL], [syslog.h]) | |
2870 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_NEWS], [LOG_NEWS], [syslog.h]) | |
2871 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_SYSLOG], [LOG_SYSLOG], [syslog.h]) | |
2872 | AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_UUCP], [LOG_UUCP], [syslog.h]) | |
a4284a50 | 2873 | PBX_SYSLOG=1 |
2f88262a SB |
2874 | fi |
2875 | ||
a4284a50 SB |
2876 | AC_SUBST([PBX_SYSLOG]) |
2877 | ||
bb8fe716 | 2878 | if test -f makeopts; then |
a00aa10f | 2879 | ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak |
bb8fe716 | 2880 | else |
a00aa10f | 2881 | touch makeopts.acbak |
bb8fe716 TL |
2882 | fi |
2883 | ||
094c26aa | 2884 | # conf_bridge (binaural rendering): check if HRIRs are available |
d9fae4a8 JA |
2885 | # this check does not work when cross-compiling |
2886 | if test "${cross_compiling}" = "no"; then | |
2887 | AC_CHECK_FILES([bridges/bridge_softmix/include/hrirs.h]) | |
2888 | fi | |
094c26aa | 2889 | |
0e844b75 | 2890 | AC_CONFIG_FILES([build_tools/menuselect-deps makeopts]) |
f4cd569b LR |
2891 | AST_CHECK_MANDATORY |
2892 | ||
448562af KF |
2893 | if test -f build_tools/menuselect-deps; then |
2894 | # extract old values of all PBX_ variables from menuselect-deps | |
2895 | # and preserve them so that menuselect can determine whether | |
2896 | # any previously-met dependencies are no longer met and warn | |
2897 | # the user appropriately | |
2898 | while IFS="=:" read var val old_val; do | |
2899 | eval "PBX_${var}=\${PBX_${var}}:${val}" | |
2900 | done < build_tools/menuselect-deps | |
2901 | fi | |
2902 | ||
574e14cb KF |
2903 | AC_OUTPUT |
2904 | ||
a00aa10f | 2905 | ${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak2 |
5d8e0a65 | 2906 | if test "${ac_cv_path_CMP}" = ":"; then |
7a04947a | 2907 | ( cd "`pwd`/menuselect" && ./configure ) |
66f13ed6 | 2908 | elif ${ac_cv_path_CMP} -s makeopts.acbak makeopts.acbak2; then : ; else |
7a04947a | 2909 | ( cd "`pwd`/menuselect" && ./configure ) |
66f13ed6 | 2910 | fi |
bb8fe716 | 2911 | |
a00aa10f | 2912 | rm makeopts.acbak makeopts.acbak2 |
bb8fe716 TL |
2913 | |
2914 | ||
7d63b7d9 | 2915 | if test "x${silent}" != "xyes" ; then |
574e14cb KF |
2916 | echo |
2917 | echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. " | |
2918 | echo " .\$7\$7.. .7\$\$7:. " | |
2919 | echo " .\$\$:. ,\$7.7 " | |
2920 | echo " .\$7. 7\$\$\$\$ .\$\$77 " | |
2921 | echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 " | |
2922 | echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$." | |
2923 | echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$." | |
2924 | echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$," | |
2925 | echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$." | |
2926 | echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$." | |
2927 | echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 " | |
2928 | echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. " | |
2929 | echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. " | |
2930 | echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. " | |
2931 | echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. " | |
2932 | echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ " | |
2933 | echo " \$\$\$\$\$ \$\$\$ " | |
2934 | echo " \$\$\$\$7. \$\$ (TM) " | |
2935 | echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ " | |
2936 | echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ " | |
2937 | echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. " | |
2938 | echo | |
7d63b7d9 | 2939 | fi |
574e14cb | 2940 | |
80219580 KM |
2941 | if test "x${AST_IODBC_FOUND}" = "xyes"; then |
2942 | echo "WARNING: iodbc libs/headers found!" | |
2943 | echo | |
2944 | echo " If you plan to use ODBC functionality, you should consider" | |
2945 | echo " switching to unixodbc instead." | |
2946 | echo " See: https://issues.asterisk.org/jira/browse/ASTERISK-22459" | |
2947 | echo | |
2948 | fi | |
2949 | ||
7d63b7d9 | 2950 | AC_MSG_NOTICE(Package configured for: ) |
0a27d8bf | 2951 | AC_MSG_NOTICE( OS type : $host_os) |
7d63b7d9 | 2952 | AC_MSG_NOTICE( Host CPU : $host_cpu) |
92ef8a6f KF |
2953 | AC_MSG_NOTICE( build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :) |
2954 | AC_MSG_NOTICE( host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :) | |
0a27d8bf | 2955 | if test "${cross_compiling}" = "yes"; then |
7d63b7d9 | 2956 | AC_MSG_NOTICE( Cross Compilation = YES) |
574e14cb | 2957 | fi |