Let's also include aclocal.m4
[asterisk-bristuff.git] / configure.ac
blobd73b99d130c91b4c26ffc543a47f9cc7f9129f73
1 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.60)
5 AC_INIT(asterisk, 1.4, www.asterisk.org)
7 # cross-compile macros
8 AC_CANONICAL_BUILD
9 AC_CANONICAL_HOST
11 # check existence of the package
12 AC_CONFIG_SRCDIR([main/asterisk.c])
14 # specify output header file
15 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
17 AC_COPYRIGHT("Asterisk")
18 AC_REVISION($Revision$)
20 AC_GNU_SOURCE
21 AC_USE_SYSTEM_EXTENSIONS        # note- does not work on FreeBSD
23 case "${host_os}" in
24      freebsd*)
25      ac_default_prefix=/usr/local
26      CPPFLAGS=-I/usr/local/include
27      LDFLAGS=-L/usr/local/lib
28      ;;
29      *)
30      ac_default_prefix=/usr
31      if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
32         if test ${sysconfdir} = '${prefix}/etc'; then
33            sysconfdir=/etc
34         fi
35         if test ${mandir} = '${prefix}/man'; then
36            mandir=/usr/share/man
37         fi
38      fi
39      ;;
40 esac
42 if test ${localstatedir} = '${prefix}/var'; then
43      localstatedir=/var
46 BUILD_PLATFORM=${build}
47 BUILD_CPU=${build_cpu}
48 BUILD_VENDOR=${build_vendor}
49 BUILD_OS=${build_os}
51 AC_SUBST(BUILD_PLATFORM)
52 AC_SUBST(BUILD_CPU)
53 AC_SUBST(BUILD_VENDOR)
54 AC_SUBST(BUILD_OS)
56 HOST_PLATFORM=${host}
57 HOST_CPU=${host_cpu}
58 HOST_VENDOR=${host_vendor}
59 HOST_OS=${host_os}
61 AC_SUBST(HOST_PLATFORM)
62 AC_SUBST(HOST_CPU)
63 AC_SUBST(HOST_VENDOR)
64 AC_SUBST(HOST_OS)
66 case "${host_os}" in
67      freebsd*)
68      OSARCH=FreeBSD
69      ;;
70      netbsd*)
71      OSARCH=NetBSD
72      ;;
73      openbsd*)
74      OSARCH=OpenBSD
75      ;;
76      solaris*)
77      OSARCH=SunOS
78      ;;
79      *)
80      OSARCH=${HOST_OS}
81      ;;
82 esac
84 AC_SUBST(OSARCH)
86 #  check for uname
87 AC_PATH_TOOL([UNAME], [uname], No)
88 if test ! x"${UNAME}" = xNo; then
89    PBX_OSREV=$(${UNAME} -r)
91 AC_SUBST(PBX_OSREV)
93 AH_TOP(
94 #ifndef ASTERISK_AUTOCONFIG_H
95 #define ASTERISK_AUTOCONFIG_H
97 #include "asterisk/buildopts.h"
101 AH_BOTTOM(
102 #endif
105 # cross-compile checks
106 if test "${cross_compiling}" = "yes"; 
107 then
108    AC_CHECK_TOOL(CC, gcc, :)
109    AC_CHECK_TOOL(CXX, g++, :)
110    AC_CHECK_TOOL(LD, ld, :)
111    AC_CHECK_TOOL(RANLIB, ranlib, :)
114 # Checks for programs.
115 AC_PROG_CC
116 AC_PROG_CXX
117 AC_PROG_CPP
118 AC_PROG_CXXCPP
119 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
120 # the developers regenerating the configure script don't have to install libtool.
121 AST_PROG_LD     # note - does not work on freebsd
122 AC_PROG_AWK
123 AC_PROG_INSTALL
124 AC_PROG_LN_S
125 AC_PROG_RANLIB
126 AST_CHECK_GNU_MAKE
128 AC_PATH_TOOL([STRIP], [strip], :)
129 AC_PATH_TOOL([AR], [ar], :)
131 GNU_LD=0
132 if test "x$with_gnu_ld" = "xyes" ; then
133    GNU_LD=1
135 AC_SUBST(GNU_LD)
137 AC_PATH_PROG([AWK], [awk], :)
138 AC_PATH_PROG([GREP], [grep], :)
139 AC_PATH_PROG([FIND], [find], :)
140 AC_PATH_PROG([COMPRESS], [compress], :)
141 AC_PATH_PROG([BASENAME], [basename], :)
142 AC_PATH_PROG([ID], [id], :)
143 AC_PATH_PROG([DIRNAME], [dirname], :)
144 AC_PATH_PROG([SHELL], [sh], :)
145 AC_PATH_PROG([LN], [ln], :)
146 AC_PATH_PROG([DOT], [dot], :)
147 AC_PATH_PROG([WGET], [wget], :)
148 if test "${WGET}" != ":" ; then
149   DOWNLOAD=${WGET}
150 else
151   AC_PATH_PROG([FETCH], [fetch], [:])
152   DOWNLOAD=${FETCH}
154 AC_SUBST(DOWNLOAD)
156 AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
157 if test "${SOXMIX}" != ":" ; then
158         AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
161 ACX_PTHREAD
163 AC_LANG(C)
165 AC_ARG_ENABLE(dev-mode,
166         [  --enable-dev-mode    Turn on developer mode],
167         [case "${enableval}" in
168               y|ye|yes) AST_DEVMODE=yes ;;
169               n|no)  AST_DEVMODE=no ;;
170               *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
171         esac])
172 AC_SUBST(AST_DEVMODE)
174 # package option names should be in alphabetical order
175 # by the --with option name, to make things easier for the users :-)
177 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
178 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
179 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
180 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
181 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
182 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
183 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
184 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
185 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
186 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
187 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
188 AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl])
189 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
190 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
191 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
192 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
193 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
194 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
195 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
196 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
197 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
198 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
199 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
200 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
201 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
202 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
203 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
204 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
205 AST_EXT_LIB_SETUP([SPEEXDSP], [Speexdsp], [speexdsp])
206 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
207 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
208 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
209 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
210 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
211 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
212 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
213 AST_EXT_LIB_SETUP([USB], [usb], [usb])
214 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
215 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
216 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
217 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
219 # check for basic system features and functionality before
220 # checking for package libraries
222 AC_FUNC_ALLOCA
223 AC_HEADER_DIRENT
224 AC_HEADER_STDC
225 AC_HEADER_SYS_WAIT
226 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h])
228 AC_SYS_LARGEFILE
230 # Checks for typedefs, structures, and compiler characteristics.
231 AC_HEADER_STDBOOL
232 AC_C_CONST
233 AC_TYPE_UID_T
234 AC_C_INLINE
235 AC_TYPE_MODE_T
236 AC_TYPE_OFF_T
237 AC_TYPE_PID_T
238 AC_TYPE_SIZE_T
239 AC_CHECK_MEMBERS([struct stat.st_blksize])
240 AC_HEADER_TIME
241 AC_STRUCT_TM
242 AC_C_VOLATILE
243 AC_CHECK_TYPES([ptrdiff_t])
245 # Checks for library functions.
246 AC_FUNC_CHOWN
247 AC_FUNC_CLOSEDIR_VOID
248 AC_FUNC_ERROR_AT_LINE
249 AST_FUNC_FORK
250 AC_FUNC_FSEEKO
251 AC_PROG_GCC_TRADITIONAL
252 # XXX: these are commented out until we determine whether it matters if our malloc()
253 # acts exactly like glibc's or not
254 # AC_FUNC_MALLOC
255 # AC_FUNC_REALLOC
256 AC_FUNC_MEMCMP
257 AC_FUNC_MMAP
258 AC_FUNC_SELECT_ARGTYPES
259 AC_FUNC_SETVBUF_REVERSED
260 AC_TYPE_SIGNAL
261 AC_FUNC_STAT
262 AC_FUNC_STRCOLL
263 AC_FUNC_STRFTIME
264 AC_FUNC_STRNLEN
265 AC_FUNC_STRTOD
266 AC_FUNC_UTIME_NULL
267 AC_FUNC_VPRINTF
268 AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
270 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
271 AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
273 AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
274 AC_LINK_IFELSE(
275         AC_LANG_PROGRAM([#include <stdlib.h>
276                          #include <netdb.h>],
277                         [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);]),
278         AC_MSG_RESULT(yes)
279         AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
280         AC_MSG_RESULT(no)
283 AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
284 AC_LINK_IFELSE(
285         AC_LANG_PROGRAM([#include <stdlib.h>
286                          #include <netdb.h>],
287                         [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);]),
288         AC_MSG_RESULT(yes)
289         AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
290         AC_MSG_RESULT(no)
293 AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
294 AC_LINK_IFELSE(
295         AC_LANG_PROGRAM([#include <pthread.h>],
296                         [int foo = PTHREAD_RWLOCK_INITIALIZER;]),
297         AC_MSG_RESULT(yes)
298         AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
299         AC_MSG_RESULT(no)
302 AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
303 AC_LINK_IFELSE(
304         AC_LANG_PROGRAM([#include <pthread.h>],
305                         [int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
306         AC_MSG_RESULT(yes)
307         AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
308         AC_MSG_RESULT(no)
311 AC_MSG_CHECKING(for compiler atomic operations)
312 AC_LINK_IFELSE(
313 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
314 AC_MSG_RESULT(yes)
315 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
316 AC_MSG_RESULT(no)
319 AST_GCC_ATTRIBUTE(pure)
320 AST_GCC_ATTRIBUTE(malloc)
321 AST_GCC_ATTRIBUTE(const)
322 AST_GCC_ATTRIBUTE(unused)
323 AST_GCC_ATTRIBUTE(always_inline)
324 AST_GCC_ATTRIBUTE(deprecated)
326 AC_MSG_CHECKING(for -ffunction-sections support)
327 saved_CFLAGS="${CFLAGS}"
328 CFLAGS="${CFLAGS} -ffunction-sections"
329 AC_COMPILE_IFELSE(
330         AC_LANG_PROGRAM([], [int x = 1;]),
331         AC_MSG_RESULT(yes)
332         [saved_LDFLAGS="${LDFLAGS}"]
333         [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
334         AC_MSG_CHECKING(for --gc-sections support)
335         AC_LINK_IFELSE(
336                 AC_LANG_PROGRAM([], [int x = 1;]),
337                 AC_MSG_RESULT(yes)
338                 [GC_CFLAGS="-ffunction-sections"]
339                 [[GC_LDFLAGS="-Wl,--gc-sections"]],
340                 AC_MSG_RESULT(no)
341         )
342         [LDFLAGS="${saved_LDFLAGS}"],
343         AC_MSG_RESULT(no)
345 CFLAGS="${saved_CFLAGS}"
346 AC_SUBST(GC_CFLAGS)
347 AC_SUBST(GC_LDFLAGS)
349 AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
350 if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
351    AC_MSG_RESULT(yes)
352    AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
353 else
354         AC_MSG_RESULT(no)
355         AST_DECLARATION_AFTER_STATEMENT=
357 AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
359 AC_MSG_CHECKING(for -fno-strict-overflow)
360 if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
361    AC_MSG_RESULT(yes)
362    AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
363 else
364         AC_MSG_RESULT(no)
365         AST_NO_STRICT_OVERFLOW=
367 AC_SUBST(AST_NO_STRICT_OVERFLOW)
369 AC_SEARCH_LIBS(res_9_ninit, resolv)
370 AC_MSG_CHECKING(for res_ninit)
371 AC_LINK_IFELSE(
372         AC_LANG_PROGRAM([
373                         #ifdef HAVE_SYS_SOCKET_H
374                         #include <sys/socket.h>
375                         #endif
376                         #ifdef HAVE_NETINET_IN_H
377                         #include <netinet/in.h>
378                         #endif
379                         #ifdef HAVE_ARPA_NAMESER_H
380                         #include <arpa/nameser.h>
381                         #endif
382                         #include <resolv.h>],
383                         [int foo = res_ninit(NULL);]),
384         AC_MSG_RESULT(yes)
385         AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
386         AC_SEARCH_LIBS(res_9_ndestroy, resolv)
387         AC_MSG_CHECKING(for res_ndestroy)
388         AC_LINK_IFELSE(
389                 AC_LANG_PROGRAM([
390                                 #ifdef HAVE_SYS_SOCKET_H
391                                 #include <sys/socket.h>
392                                 #endif
393                                 #ifdef HAVE_NETINET_IN_H
394                                 #include <netinet/in.h>
395                                 #endif
396                                 #ifdef HAVE_ARPA_NAMESER_H
397                                 #include <arpa/nameser.h>
398                                 #endif
399                                 #include <resolv.h>],
400                                 [res_ndestroy(NULL);]),
401                 AC_MSG_RESULT(yes)
402                 AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
403                 AC_MSG_RESULT(no)
404         ),
405         AC_MSG_RESULT(no)
408 AC_MSG_CHECKING(for RTLD_NOLOAD)
409 AC_LINK_IFELSE(
410         AC_LANG_PROGRAM([#include <dlfcn.h>],
411                         [int foo = RTLD_NOLOAD;]),
412         AC_MSG_RESULT(yes)
413         AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
414         AC_MSG_RESULT(no)
417 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
418 AC_LINK_IFELSE(
419         AC_LANG_PROGRAM([#include <netinet/in.h>],
420                         [int foo = IP_MTU_DISCOVER;]),
421         AC_MSG_RESULT(yes)
422         AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
423         AC_MSG_RESULT(no)
426 AC_CHECK_HEADER([libkern/OSAtomic.h],
427                 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
429 AC_CHECK_SIZEOF(int)
431 # do the package library checks now
433 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
435 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
437 if test "x${host_os}" = "xlinux-gnu" ; then
438   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
441 if test "${USE_DAHDI}" != "no" ; then
442         AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
443         if test "x${PBX_DAHDI}" = "x1" ; then
444                 PBX_DAHDI_TRANSCODE=1
445                 AC_SUBST(PBX_DAHDI_TRANSCODE)
446         fi
449 AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
451 GSM_INTERNAL="yes"
452 AC_SUBST(GSM_INTERNAL)
453 GSM_SYSTEM="yes"
454 if test "${USE_GSM}" != "no"; then
455    if test "${GSM_DIR}" = "internal"; then
456       GSM_SYSTEM="no"
457    elif test "${GSM_DIR}" != ""; then
458       GSM_INTERNAL="no"
459    fi
460    if test "${GSM_SYSTEM}" = "yes"; then
461       gsmlibdir=""
462       if test "x${GSM_DIR}" != "x"; then
463          if test -d ${GSM_DIR}/lib; then
464             gsmlibdir="-L${GSM_DIR}/lib"
465          else
466             gsmlibdir="-L${GSM_DIR}"
467          fi
468       fi
469       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
470       [Define to indicate the GSM library]), [], ${gsmlibdir})
471       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
472          if test "x${GSM_DIR}" != "x" ; then
473             AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
474             AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
475          else
476             AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
477             AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
478          fi
479          if test "${GSM_HEADER_FOUND}" = "0" ; then
480             if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
481                if test "x${GSM_MANDATORY}" = "xyes" ; then
482                   AC_MSG_NOTICE([***])
483                   AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
484                   AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
485                   AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
486                   exit 1
487                fi
488             fi
489          fi
490          GSM_OK=0
491          if test "${GSM_HEADER_FOUND}" = "1" ; then
492             AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
493             GSM_OK=1
494          else
495             if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
496                AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
497                GSM_OK=1
498             fi
499          fi
500          if test "${GSM_OK}" = "1" ; then
501             GSM_LIB="-lgsm"
502             if test "x${GSM_DIR}" != "x"; then
503                GSM_LIB="${gsmlibdir} ${GSM_LIB}"
504                GSM_INCLUDE="-I${GSM_DIR}/include"
505             fi
506             PBX_GSM=1
507             GSM_INTERNAL="no"
508          fi
509       fi
510    fi
511    if test "${GSM_INTERNAL}" = "yes"; then
512       PBX_GSM=1
513       AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
514    fi
517 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
519 if test "${PBX_IKSEMEL}" = 1; then
520    AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye], [gnutls/gnutls.h], [-lz -lgcrypt -lgpg-error])
523 if test "${USE_IMAP_TK}" != "no"; then
524         saved_cppflags="${CPPFLAGS}"
525         saved_libs="${LIBS}"
526         switch_to_system_on_failure="no"
527         if test "${IMAP_TK_DIR}" = ""; then
528                 IMAP_TK_DIR=`pwd`"/../imap-2004g"
529                 switch_to_system_on_failure="yes"
530         fi
531         if test "${IMAP_TK_DIR}" != "system"; then
532                 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
533                 if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
534                 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
535                 fi
536                 imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
537                 imap_include="-I${IMAP_TK_DIR}/c-client"
538         CPPFLAGS="${CPPFLAGS} ${imap_include}"
539                 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
540                 AC_LINK_IFELSE(
541                 AC_LANG_PROGRAM(
542                                 [#include "c-client.h"
543                                 void mm_searched (MAILSTREAM *stream,unsigned long number)
544                                 {
545                                 }
546                                 void mm_exists (MAILSTREAM *stream,unsigned long number)
547                                 {
548                                 }
549                                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
550                                 {
551                                 }
552                                 void mm_flags (MAILSTREAM *stream,unsigned long number)
553                                 {
554                                 }
555                                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
556                                 {
557                                 }
558                                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
559                                 {
560                                 }
561                                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
562                                 {
563                                 }
564                                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
565                                 {
566                                 }
567                                 void mm_log (char *string,long errflg)
568                                 {
569                                 }
570                                 void mm_dlog (char *string)
571                                 {
572                                 }
573                                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
574                                 {
575                                 }
576                                 void mm_critical (MAILSTREAM *stream)
577                                 {
578                                 }
579                                 void mm_nocritical (MAILSTREAM *stream)
580                                 {
581                                 }
582                                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
583                                 {
584                                 }
585                                 void mm_fatal (char *string)
586                                 {
587                                 }],
588                                 [
589                                 MAILSTREAM *foo = mail_open(NULL, "", 0);
590                                 ]
591                         ),
592                         [ac_cv_imap_tk="yes"],
593                         [ac_cv_imap_tk="no"]
594                 )
595                 if test "${ac_cv_imap_tk}" = "yes"; then
596                         AC_LINK_IFELSE(
597                                 AC_LANG_PROGRAM(
598                                         [#include "c-client.h"
599                                         void mm_searched (MAILSTREAM *stream,unsigned long number)
600                                         {
601                                         }
602                                         void mm_exists (MAILSTREAM *stream,unsigned long number)
603                                         {
604                                         }
605                                         void mm_expunged (MAILSTREAM *stream,unsigned long number)
606                                         {
607                                         }
608                                         void mm_flags (MAILSTREAM *stream,unsigned long number)
609                                         {
610                                         }
611                                         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
612                                         {
613                                         }
614                                         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
615                                         {
616                                         }
617                                         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
618                                         {
619                                         }
620                                         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
621                                         {
622                                         }
623                                         void mm_log (char *string,long errflg)
624                                         {
625                                         }
626                                         void mm_dlog (char *string)
627                                         {
628                                         }
629                                         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
630                                         {
631                                         }
632                                         void mm_critical (MAILSTREAM *stream)
633                                         {
634                                         }
635                                         void mm_nocritical (MAILSTREAM *stream)
636                                         {
637                                         }
638                                         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
639                                         {
640                                         }
641                                         void mm_fatal (char *string)
642                                         {
643                                         }],
644                                         [
645                                         long check = mail_expunge_full(NULL, "", 0);
646                                         ]
647                                 ),
648                                 [ac_cv_imap_tk2006="yes"],
649                                 [ac_cv_imap_tk2006="no"]
650                         )
651                 fi
652                 CPPFLAGS="${saved_cppflags}"
653                 LIBS="${saved_libs}"
654                 if test "${ac_cv_imap_tk}" = "no"; then
655                         AC_MSG_RESULT(no)
656                         if test "${switch_to_system_on_failure}" = "yes"; then 
657                                 IMAP_TK_DIR="system"
658                         else #This means they specified a directory. Search for a package installation there too
659                                 AC_MSG_CHECKING([for system c-client library...])
660                                 CPPFLAGS="${saved_cppflags}"
661                                 LIBS="${saved_libs}"
662                                 imap_include="-I${IMAP_TK_DIR}/include"
663                                 imap_ldflags="-L${IMAP_TK_DIR}/lib"
664                                 imap_libs="-lc-client"
665                                 CPPFLAGS="${CPPFLAGS} ${imap_include}"
666                                 LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
667                                 AC_LINK_IFELSE(
668                                 AC_LANG_PROGRAM(
669                                                 [#include "c-client.h"
670                                                 void mm_searched (MAILSTREAM *stream,unsigned long number)
671                                                 {
672                                                 }
673                                                 void mm_exists (MAILSTREAM *stream,unsigned long number)
674                                                 {
675                                                 }
676                                                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
677                                                 {
678                                                 }
679                                                 void mm_flags (MAILSTREAM *stream,unsigned long number)
680                                                 {
681                                                 }
682                                                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
683                                                 {
684                                                 }
685                                                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
686                                                 {
687                                                 }
688                                                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
689                                                 {
690                                                 }
691                                                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
692                                                 {
693                                                 }
694                                                 void mm_log (char *string,long errflg)
695                                                 {
696                                                 }
697                                                 void mm_dlog (char *string)
698                                                 {
699                                                 }
700                                                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
701                                                 {
702                                                 }
703                                                 void mm_critical (MAILSTREAM *stream)
704                                                 {
705                                                 }
706                                                 void mm_nocritical (MAILSTREAM *stream)
707                                                 {
708                                                 }
709                                                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
710                                                 {
711                                                 }
712                                                 void mm_fatal (char *string)
713                                                 {
714                                                 }],
715                                                 [
716                                                 MAILSTREAM *foo = mail_open(NULL, "", 0);
717                                                 ]
718                                         ),
719                                         [ac_cv_imap_tk="yes"],
720                                         [ac_cv_imap_tk="no"]
721                                 )
722                                 if test "${ac_cv_imap_tk}" = "yes"; then
723                                         AC_LINK_IFELSE(
724                                                 AC_LANG_PROGRAM(
725                                                         [#include "c-client.h"
726                                                         void mm_searched (MAILSTREAM *stream,unsigned long number)
727                                                         {
728                                                         }
729                                                         void mm_exists (MAILSTREAM *stream,unsigned long number)
730                                                         {
731                                                         }
732                                                         void mm_expunged (MAILSTREAM *stream,unsigned long number)
733                                                         {
734                                                         }
735                                                         void mm_flags (MAILSTREAM *stream,unsigned long number)
736                                                         {
737                                                         }
738                                                         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
739                                                         {
740                                                         }
741                                                         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
742                                                         {
743                                                         }
744                                                         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
745                                                         {
746                                                         }
747                                                         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
748                                                         {
749                                                         }
750                                                         void mm_log (char *string,long errflg)
751                                                         {
752                                                         }
753                                                         void mm_dlog (char *string)
754                                                         {
755                                                         }
756                                                         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
757                                                         {
758                                                         }
759                                                         void mm_critical (MAILSTREAM *stream)
760                                                         {
761                                                         }
762                                                         void mm_nocritical (MAILSTREAM *stream)
763                                                         {
764                                                         }
765                                                         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
766                                                         {
767                                                         }
768                                                         void mm_fatal (char *string)
769                                                         {
770                                                         }],
771                                                         [
772                                                         long check = mail_expunge_full(NULL, "", 0);
773                                                         ]
774                                                 ),
775                                                 [ac_cv_imap_tk2006="yes"],
776                                                 [ac_cv_imap_tk2006="no"]
777                                         )
778                                 fi
779                         fi
780                 fi
781         fi 
782         if test "${IMAP_TK_DIR}" = "system"; then
783                 #We will enter here if user specified "system" or if any of above checks failed
784                 AC_MSG_CHECKING([for system c-client library...])
785                 CPPFLAGS="${saved_cppflags}"
786                 LIBS="${saved_libs}"
787                 imap_ldflags=""
788                 imap_libs="-lc-client"
789                 imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
790                 CPPFLAGS="${CPPFLAGS} ${imap_include}"
791                 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
792                 AC_LINK_IFELSE(
793                 AC_LANG_PROGRAM(
794                                 [#include <stdio.h>
795                                 #include <imap/c-client.h>
796                                 void mm_searched (MAILSTREAM *stream,unsigned long number)
797                                 {
798                                 }
799                                 void mm_exists (MAILSTREAM *stream,unsigned long number)
800                                 {
801                                 }
802                                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
803                                 {
804                                 }
805                                 void mm_flags (MAILSTREAM *stream,unsigned long number)
806                                 {
807                                 }
808                                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
809                                 {
810                                 }
811                                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
812                                 {
813                                 }
814                                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
815                                 {
816                                 }
817                                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
818                                 {
819                                 }
820                                 void mm_log (char *string,long errflg)
821                                 {
822                                 }
823                                 void mm_dlog (char *string)
824                                 {
825                                 }
826                                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
827                                 {
828                                 }
829                                 void mm_critical (MAILSTREAM *stream)
830                                 {
831                                 }
832                                 void mm_nocritical (MAILSTREAM *stream)
833                                 {
834                                 }
835                                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
836                                 {
837                                 }
838                                 void mm_fatal (char *string)
839                                 {
840                                 }],
841                                 [
842                                 MAILSTREAM *foo = mail_open(NULL, "", 0);
843                                 ]
844                         ),
845                         [ac_cv_imap_tk="yes"],
846                         [ac_cv_imap_tk="no"]
847                 )
848                 if test "${ac_cv_imap_tk}" = "yes"; then
849                         AC_LINK_IFELSE(
850                                 AC_LANG_PROGRAM(
851                                         [#include <stdio.h>
852                                         #include <imap/c-client.h>
853                                         void mm_searched (MAILSTREAM *stream,unsigned long number)
854                                         {
855                                         }
856                                         void mm_exists (MAILSTREAM *stream,unsigned long number)
857                                         {
858                                         }
859                                         void mm_expunged (MAILSTREAM *stream,unsigned long number)
860                                         {
861                                         }
862                                         void mm_flags (MAILSTREAM *stream,unsigned long number)
863                                         {
864                                         }
865                                         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
866                                         {
867                                         }
868                                         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
869                                         {
870                                         }
871                                         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
872                                         {
873                                         }
874                                         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
875                                         {
876                                         }
877                                         void mm_log (char *string,long errflg)
878                                         {
879                                         }
880                                         void mm_dlog (char *string)
881                                         {
882                                         }
883                                         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
884                                         {
885                                         }
886                                         void mm_critical (MAILSTREAM *stream)
887                                         {
888                                         }
889                                         void mm_nocritical (MAILSTREAM *stream)
890                                         {
891                                         }
892                                         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
893                                         {
894                                         }
895                                         void mm_fatal (char *string)
896                                         {
897                                         }],
898                                         [
899                                         long check = mail_expunge_full(NULL, "", 0);
900                                         ]
901                                 ),
902                                 [ac_cv_imap_tk2006="yes"],
903                                 [ac_cv_imap_tk2006="no"]
904                         )
905                 else #looking in imap directory didn't work, try c-client
906                         imap_ldflags=""
907                         imap_libs="-lc-client"
908                         imap_include="-DUSE_SYSTEM_CCLIENT"
909                         CPPFLAGS="${saved_cppflags}"
910                         LIBS="${saved_libs}"
911                         CPPFLAGS="${CPPFLAGS} ${imap_include}"
912                         LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
913                         AC_LINK_IFELSE(
914                         AC_LANG_PROGRAM(
915                                         [#include <stdio.h>
916                                         #include <c-client/c-client.h>
917                                         void mm_searched (MAILSTREAM *stream,unsigned long number)
918                                         {
919                                         }
920                                         void mm_exists (MAILSTREAM *stream,unsigned long number)
921                                         {
922                                         }
923                                         void mm_expunged (MAILSTREAM *stream,unsigned long number)
924                                         {
925                                         }
926                                         void mm_flags (MAILSTREAM *stream,unsigned long number)
927                                         {
928                                         }
929                                         void mm_notify (MAILSTREAM *stream,char *string,long errflg)
930                                         {
931                                         }
932                                         void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
933                                         {
934                                         }
935                                         void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
936                                         {
937                                         }
938                                         void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
939                                         {
940                                         }
941                                         void mm_log (char *string,long errflg)
942                                         {
943                                         }
944                                         void mm_dlog (char *string)
945                                         {
946                                         }
947                                         void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
948                                         {
949                                         }
950                                         void mm_critical (MAILSTREAM *stream)
951                                         {
952                                         }
953                                         void mm_nocritical (MAILSTREAM *stream)
954                                         {
955                                         }
956                                         long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
957                                         {
958                                         }
959                                         void mm_fatal (char *string)
960                                         {
961                                         }],
962                                         [
963                                         MAILSTREAM *foo = mail_open(NULL, "", 0);
964                                         ]
965                                 ),
966                                 [ac_cv_imap_tk="yes"],
967                                 [ac_cv_imap_tk="no"]
968                         )
969                         if test "${ac_cv_imap_tk}" = "yes"; then
970                                 AC_LINK_IFELSE(
971                                         AC_LANG_PROGRAM(
972                                                 [#include <stdio.h>
973                                                 #include <c-client/c-client.h>
974                                                 void mm_searched (MAILSTREAM *stream,unsigned long number)
975                                                 {
976                                                 }
977                                                 void mm_exists (MAILSTREAM *stream,unsigned long number)
978                                                 {
979                                                 }
980                                                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
981                                                 {
982                                                 }
983                                                 void mm_flags (MAILSTREAM *stream,unsigned long number)
984                                                 {
985                                                 }
986                                                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
987                                                 {
988                                                 }
989                                                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
990                                                 {
991                                                 }
992                                                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
993                                                 {
994                                                 }
995                                                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
996                                                 {
997                                                 }
998                                                 void mm_log (char *string,long errflg)
999                                                 {
1000                                                 }
1001                                                 void mm_dlog (char *string)
1002                                                 {
1003                                                 }
1004                                                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
1005                                                 {
1006                                                 }
1007                                                 void mm_critical (MAILSTREAM *stream)
1008                                                 {
1009                                                 }
1010                                                 void mm_nocritical (MAILSTREAM *stream)
1011                                                 {
1012                                                 }
1013                                                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
1014                                                 {
1015                                                 }
1016                                                 void mm_fatal (char *string)
1017                                                 {
1018                                                 }],
1019                                                 [
1020                                                 long check = mail_expunge_full(NULL, "", 0);
1021                                                 ]
1022                                         ),
1023                                         [ac_cv_imap_tk2006="yes"],
1024                                         [ac_cv_imap_tk2006="no"]
1025                                 )
1026                         fi
1027                 fi
1028         fi
1029         if test "${ac_cv_imap_tk}" = "yes"; then
1030                 AC_MSG_RESULT(yes)
1031                 IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
1032                 IMAP_TK_INCLUDE="${imap_include}"
1033                 PBX_IMAP_TK=1
1034                 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
1035                 if test "${ac_cv_imap_tk2006}" = "yes"; then
1036                         AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
1037                 fi
1038         elif test -n "${IMAP_TK_MANDATORY}"; then
1039                 AC_MSG_RESULT(no) 
1040                 AC_MSG_NOTICE([***])
1041                 AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
1042                 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1043                 AC_MSG_NOTICE([*** including --without-imap.])
1044                 exit 1
1045         else
1046                 AC_MSG_RESULT(no)
1047         fi
1048         CPPFLAGS="${saved_cppflags}"
1049         LIBS="${saved_libs}"
1052 # Needed by unixodbc
1053 AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], [])
1055 AC_LANG_PUSH(C++)
1057 if test "${USE_KDE}" != "no"; then
1058    AC_MSG_CHECKING(for crashHandler in -lkdecore)
1059    saved_libs="${LIBS}"
1060    saved_cppflags="${CPPFLAGS}"
1061    CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
1062    if test -d ${KDE_DIR}/lib; then
1063       kdelibdir="${KDE_DIR}/lib"
1064    else
1065       kdelibdir="${KDE_DIR}"
1066    fi
1067    LIBS="${LIBS} -L${kdelibdir} -lkdecore"
1069    AC_LINK_IFELSE(
1070         [AC_LANG_PROGRAM(
1071                         [#include "kcrash.h"],
1072                         [KCrash::defaultCrashHandler(1);])
1073         ],
1074         [ac_cv_lib_kde_crash="yes"],
1075         [ac_cv_lib_kde_crash="no"])
1076                 
1077    LIBS="${saved_libs}"
1078    CPPFLAGS="${saved_cppflags}"
1079         
1080    if test "${ac_cv_lib_kde_crash}" = "yes"; then
1081       AC_MSG_RESULT(yes) 
1082       KDE_LIB="-lkdecore -lkdeui"
1083       if test "${KDE_DIR}" != ""; then
1084          KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
1085          KDE_INCLUDE="-I${KDE_DIR}/include"
1086       fi
1087       PBX_KDE=1
1088       AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
1089    elif test -n "${KDE_MANDATORY}"; then
1090       AC_MSG_RESULT(no) 
1091       AC_MSG_NOTICE([***])
1092       AC_MSG_NOTICE([*** The KDE installation on this system appears to be broken.])
1093       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1094       AC_MSG_NOTICE([*** including --without-kde.])
1095       exit 1
1096    else
1097       AC_MSG_RESULT(no) 
1098    fi
1100 if test "${PBX_KDE}" = 1; then
1101    AC_PATH_TOOL(KDEINIT, kdeinit, No)
1102    if test ! x"${KDEINIT}" = xNo; then
1103       KDEDIR=$(${DIRNAME} ${KDEINIT})
1104       KDEDIR=$(${DIRNAME} ${KDEDIR})
1105    fi
1106    AC_SUBST([KDEDIR])
1109 AC_LANG_POP
1111 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
1113 if test "${PBX_MISDN}" = 1; then
1114    AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
1115    AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
1116    AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
1119 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
1121 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
1123 NETSNMP_CONFIG=No
1124 if test "${USE_NETSNMP}" != "no"; then  
1125    if test "x${NETSNMP_DIR}" != "x"; then
1126       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
1127       if test x"${NETSNMP_CONFIG}" = xNo; then
1128          AC_MSG_NOTICE([***])
1129          AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
1130          AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
1131          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1132          AC_MSG_NOTICE([*** including --without-netsnmp])
1133          exit 1
1134       fi
1135    else
1136       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
1137    fi
1139 if test x"${NETSNMP_CONFIG}" != xNo; then
1140    NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
1141    
1142    AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
1143    [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
1145    if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
1146       NETSNMP_LIB="${NETSNMP_libs}"
1147       PBX_NETSNMP=1
1148    elif test -n "${NETSNMP_MANDATORY}";
1149    then
1150       AC_MSG_NOTICE([***])
1151       AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
1152       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1153       AC_MSG_NOTICE([*** including --without-netsnmp])
1154       exit 1
1155    fi
1156 elif test -n "${NETSNMP_MANDATORY}";
1157 then
1158    AC_MSG_NOTICE([***])
1159    AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
1160    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1161    AC_MSG_NOTICE([*** including --without-netsnmp])
1162    exit 1
1165 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
1167 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [])
1169 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
1171 if test "${USE_OSS}" != "no"; then
1172 PBX_OSS=0
1173 AC_CHECK_HEADER([linux/soundcard.h],
1174                 [
1175                 PBX_OSS=1
1176                 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1177                 ])
1178 if test "$PBX_OSS" = "0"; then
1179    AC_CHECK_HEADER([sys/soundcard.h],
1180                    [
1181                    PBX_OSS=1
1182                    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1183                    ])
1185 if test "$PBX_OSS" = "0"; then
1186    AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
1190 PG_CONFIG=No
1191 if test "${USE_PGSQL}" != "no"; then    
1192    if test "x${PGSQL_DIR}" != "x"; then
1193       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
1194       if test x"${PG_CONFIG}" = xNo; then
1195          AC_MSG_NOTICE([***])
1196          AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
1197          AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
1198          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1199          AC_MSG_NOTICE([*** including --without-postgres])
1200          exit 1
1201       fi
1202    else
1203       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
1204    fi
1206 if test "${PG_CONFIG}" != No; then
1207    PGSQL_libdir=`${PG_CONFIG} --libdir`
1208    PGSQL_includedir=`${PG_CONFIG} --includedir`
1210    if test "x$?" != "x0" ; then
1211       if test -n "${PGSQL_MANDATORY}" ; then
1212          AC_MSG_NOTICE([***])
1213          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1214          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1215          AC_MSG_NOTICE([*** including --without-postgres])
1216          exit 1
1217           fi
1218    else 
1219       AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
1220       [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
1222       if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
1223          PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
1224          PGSQL_INCLUDE="-I${PGSQL_includedir}"
1225          PBX_PGSQL=1
1226       elif test -n "${PGSQL_MANDATORY}";
1227       then
1228          AC_MSG_NOTICE([***])
1229          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1230          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1231          AC_MSG_NOTICE([*** including --without-postgres])
1232          exit 1
1233       fi
1234    fi
1235 elif test -n "${PGSQL_MANDATORY}";
1236 then
1237    AC_MSG_NOTICE([***])
1238    AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1239    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1240    AC_MSG_NOTICE([*** including --without-postgres])
1241    exit 1
1244 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
1246 AST_EXT_LIB_CHECK([PRI], [pri], [pri_keypad_facility], [libpri.h])
1248 AST_EXT_LIB_CHECK([PRI_VERSION], [pri], [pri_get_version], [libpri.h])
1250 AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h])
1252 if test "${USE_PWLIB}" != "no"; then
1253         if test -n "${PWLIB_DIR}"; then
1254                 PWLIBDIR="${PWLIB_DIR}"
1255         fi
1256         AST_CHECK_PWLIB()
1257         AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
1258                 
1259         if test "${HAS_PWLIB:-unset}" != "unset"; then
1260                 AST_CHECK_OPENH323_PLATFORM()
1262                 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
1264                 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
1265                         [Define if your system has the PWLib libraries.],
1266                         [#include "ptlib.h"],
1267                         [BOOL q = PTime::IsDaylightSavings();])
1268         fi
1271 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a -n "${PWLIB_MANDATORY}"; then
1272    AC_MSG_NOTICE([***])
1273    AC_MSG_NOTICE([*** The PWLIB installation on this system appears to be broken.])
1274    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1275    AC_MSG_NOTICE([*** including --without-pwlib])
1276    exit 1
1279 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
1280         if test -n "${OPENH323_DIR}"; then
1281                 OPENH323DIR="${OPENH323_DIR}"
1282         fi
1283         AST_CHECK_OPENH323()
1284         AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
1285         AST_CHECK_OPENH323_BUILD()
1286         PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
1287         AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
1288                 [Define if your system has the OpenH323 libraries.],
1289                 [#include "ptlib.h"
1290                 #include "h323.h"
1291                 #include "h323ep.h"],
1292                 [H323EndPoint ep = H323EndPoint();],
1293                 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
1295 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a -n "${OPENH323_MANDATORY}"; then
1296    AC_MSG_NOTICE([***])
1297    AC_MSG_NOTICE([*** The OPENH323 installation on this system appears to be broken.])
1298    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1299    AC_MSG_NOTICE([*** including --without-h323])
1300    exit 1
1303 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
1305 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
1307 # See if the main speex library contains the preprocess functions
1308 AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
1309 if test "${PBX_SPEEX_PREPROCESS}" = 1; then
1310    PBX_SPEEX_PREPROCESS=1
1313 AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
1314 if test "${PBX_SPEEXDSP}" = 1; then
1315    PBX_SPEEX_PREPROCESS=1
1318 AC_SUBST(PBX_SPEEX_PREPROCESS)
1320 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
1322 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
1323 if test "$PBX_OPENSSL" = "1";
1324 then
1325     AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
1328 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
1329 if test "${PBX_FREETDS}" != "0";
1330 then
1331     if test "${FREETDS_DIR}x" = "x";
1332     then
1333         for tds_dir in /usr /usr/local;
1334         do
1335             if test -f "${tds_dir}/include/tdsver.h";
1336             then
1337                 FREETDS_DIR="${tds_dir}"
1338             fi
1339         done
1340     fi
1341     case `${GREP} TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
1342     *0.64*)
1343         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
1344         ;;
1345     *0.63*)
1346         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
1347         ;;
1348     *0.62*)
1349         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
1350         ;;
1351     *)
1352         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
1353         ;;
1354     esac
1357 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
1359 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
1361 if test "${host_os}" != "linux-gnu" ; then
1362   tonezone_extra_lib="-lm"
1365 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
1366   tonezone_dir="dahdi"
1367    if test "x${DAHDI_DIR}" != "x"; then
1368       tonezone_extra_inc="${DAHDI_INCLUDE}"
1369    fi
1370 else
1371   tonezone_dir="zaptel"
1372    if test "x${ZAPTEL_DIR}" != "x"; then
1373       tonezone_extra_inc="${ZAPTEL_INCLUDE}"
1374    fi
1377 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [${tonezone_dir}/tonezone.h], [${tonezone_extra_lib}], [${tonezone_extra_inc}])
1379 AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [])
1381 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
1383 AC_LANG_PUSH(C++)
1385 if test "${USE_VPB}" != "no"; then
1386    AC_MSG_CHECKING(for vpb_open in -lvpb)
1387    saved_libs="${LIBS}"
1388    saved_cppflags="${CPPFLAGS}"
1389    if test "x${VPB_DIR}" != "x"; then
1390       if test -d ${VPB_DIR}/lib; then
1391          vpblibdir=${VPB_DIR}/lib
1392       else
1393          vpblibdir=${VPB_DIR}
1394       fi
1395       LIBS="${LIBS} -L${vpblibdir}"
1396       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
1397    fi
1398    LIBS="${LIBS} -lvpb -lpthread"
1399    AC_LINK_IFELSE(
1400         [
1401         AC_LANG_PROGRAM(
1402         [#include <vpbapi.h>],
1403         [int q = vpb_open(0,0);])
1404         ],
1405         [       AC_MSG_RESULT(yes) 
1406                 ac_cv_lib_vpb_vpb_open="yes" 
1407         ],
1408         [       AC_MSG_RESULT(no) 
1409                 ac_cv_lib_vpb_vpb_open="no" 
1410         ]
1411         )
1412    LIBS="${saved_libs}"
1413    CPPFLAGS="${saved_cppflags}"
1414    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
1415         VPB_LIB="-lvpb"
1416         if test "${VPB_DIR}" != ""; then
1417            VPB_LIB="-L${vpblibdir}  ${VPB_LIB}"
1418            VPB_INCLUDE="-I${VPB_DIR}/include"
1419         fi
1420         PBX_VPB=1
1421         AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
1422    elif test -n "${VPB_MANDATORY}"; then
1423       AC_MSG_NOTICE([***])
1424       AC_MSG_NOTICE([*** The VoiceTronix (vpb) installation on this system appears to be broken.])
1425       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1426       AC_MSG_NOTICE([*** including --without-vpb.])
1427       exit 1
1428    fi
1431 AC_LANG_POP
1433 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
1435 if test "${USE_ZAPTEL}" != "no" && test "x${PBX_DAHDI}" != "x1"; then
1436    AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
1437    saved_cppflags="${CPPFLAGS}"
1438    if test "x${ZAPTEL_DIR}" != "x"; then
1439       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1440    fi
1441    AC_COMPILE_IFELSE(
1442         [
1443         AC_LANG_PROGRAM(
1444         [#include <zaptel/zaptel.h>],
1445         [int foo = ZT_DIAL_OP_CANCEL;])
1446         ],
1447         [       AC_MSG_RESULT(yes) 
1448                 ac_cv_zaptel_h="yes" 
1449         ],
1450         [       AC_MSG_RESULT(no) 
1451                 ac_cv_zaptel_h="no" 
1452         ]
1453         )
1454    CPPFLAGS="${saved_cppflags}"
1455    if test "${ac_cv_zaptel_h}" = "yes"; then
1456         if test "${ZAPTEL_DIR}" != ""; then
1457            ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
1458         fi
1459         PBX_ZAPTEL=1
1460         AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
1461         saved_cppflags="${CPPFLAGS}"
1462         CPPFLAGS="${CPPFLAGS} ${ZAPTEL_INCLUDE}"
1463         AC_CHECK_MEMBER([ZT_PARAMS.chan_alarms],,,[#include <zaptel/zaptel.h>])
1464         CPPFLAGS="${saved_cppflags}"
1465         if test "${ac_cv_member_ZT_PARAMS_chan_alarms}" = "yes"; then
1466              AC_DEFINE([HAVE_ZAPTEL_CHANALARMS], 1, [Define if your Zaptel drivers have chan_alarms.])
1467         else
1468              AC_DEFINE([HAVE_ZAPTEL_CHANALARMS], 0, [Define if your Zaptel drivers have chan_alarms.])
1469         fi
1470    elif test -n "${ZAPTEL_MANDATORY}"; 
1471    then
1472       AC_MSG_NOTICE([***])
1473       AC_MSG_NOTICE([*** The Zaptel installation on this system appears to be broken.])
1474       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1475       AC_MSG_NOTICE([*** including --without-zaptel.])
1476       exit 1
1477    fi
1480 if test "${PBX_ZAPTEL}" = 1 && test "x${PBX_DAHDI}" != "x1"; then
1481    AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
1482    saved_cppflags="${CPPFLAGS}"
1483    if test "x${ZAPTEL_DIR}" != "x"; then
1484       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1485    fi
1486    AC_COMPILE_IFELSE(
1487         [
1488         AC_LANG_PROGRAM(
1489         [#include <zaptel/zaptel.h>],
1490         [int foo = ZT_EVENT_REMOVED;])
1491         ],
1492         [       AC_MSG_RESULT(yes) 
1493                 ac_cv_zaptel_vldtmf="yes" 
1494         ],
1495         [       AC_MSG_RESULT(no) 
1496                 ac_cv_zaptel_vldtmf="no" 
1497         ]
1498         )
1499    CPPFLAGS="${saved_cppflags}"
1500    if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
1501         PBX_ZAPTEL_VLDTMF=1
1502    fi
1503    AC_MSG_CHECKING(for zt_transcoder_info in zaptel/zaptel.h)
1504    saved_cppflags="${CPPFLAGS}"
1505    if test "x${ZAPTEL_DIR}" != "x"; then
1506       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1507    fi
1508    AC_COMPILE_IFELSE(
1509         [
1510         AC_LANG_PROGRAM(
1511         [#include <zaptel/zaptel.h>],
1512         [int foo = sizeof(struct zt_transcoder_info);])
1513         ],
1514         [       AC_MSG_RESULT(yes) 
1515                 ac_cv_zaptel_transcode="yes" 
1516         ],
1517         [       AC_MSG_RESULT(no) 
1518                 ac_cv_zaptel_transcode="no" 
1519         ]
1520         )
1521    CPPFLAGS="${saved_cppflags}"
1522    if test "${ac_cv_zaptel_transcode}" = "yes"; then
1523         PBX_DAHDI_TRANSCODE=1
1524    fi
1526 AC_SUBST(PBX_ZAPTEL_VLDTMF)
1527 AC_SUBST(PBX_DAHDI_TRANSCODE)
1529 if test "x${PBX_ZAPTEL}" = "x1" ; then
1530         PBX_DAHDI=1
1531         DAHDI_INCLUDE=${ZAPTEL_INCLUDE}
1532         DAHDI_LIB=${ZAPTEL_LIB}
1533         AC_SUBST(PBX_DAHDI)
1534         AC_SUBST(DAHDI_INCLUDE)
1535         AC_SUBST(DAHDI_LIB)
1538 EDITLINE_LIB=""
1539 if test "x$TERMCAP_LIB" != "x" ; then
1540   EDITLINE_LIB="$TERMCAP_LIB"
1541 elif test "x$TINFO_LIB" != "x" ; then
1542   EDITLINE_LIB="$TINFO_LIB"
1543 elif test "x$CURSES_LIB" != "x" ; then
1544   EDITLINE_LIB="$CURSES_LIB"
1545 elif test "x$NCURSES_LIB" != "x" ; then
1546   EDITLINE_LIB="$NCURSES_LIB"
1547 else
1548   AC_MSG_ERROR(*** termcap support not found)
1550 AC_SUBST(EDITLINE_LIB)
1552 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1553 AC_SUBST(PBX_H323)
1555 AC_CHECK_HEADER([linux/compiler.h],
1556                 [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
1558 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1559                                    #include <linux/version.h>
1560                                    #ifdef HAVE_LINUX_COMPILER_H
1561                                    #include <linux/compiler.h>
1562                                    #endif
1563                                    ])
1564 AC_SUBST(PBX_IXJUSER)
1566 if test "${cross_compiling}" = "no";
1567 then
1568   AC_CHECK_FILE(/sbin/launchd, AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
1571 PBX_GTK=0
1572 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1573 if test ! "x${GTKCONFIG}" = xNo; then
1574    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1575    GTK_LIB=$(${GTKCONFIG} --libs gthread)
1576    PBX_GTK=1
1577    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1579 AC_SUBST(PBX_GTK)
1580 AC_SUBST(GTK_INCLUDE)
1581 AC_SUBST(GTK_LIB)
1583 PBX_GTK2=0
1584 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
1585 if test ! "x${PKGCONFIG}" = xNo; then
1586    GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
1587    GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
1588    PBX_GTK2=1
1589    AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
1591 AC_SUBST(PBX_GTK2)
1592 AC_SUBST(GTK2_INCLUDE)
1593 AC_SUBST(GTK2_LIB)
1595 if test "${USE_CURL}" != "no"; then
1596    AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
1597    if test ! x"${CURL_CONFIG}" = xNo; then
1598    # check for version
1599       if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
1600          CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
1601          CURL_LIB=$(${CURL_CONFIG} --libs)
1603          AC_MSG_CHECKING(for curl_version() in curl/curl.h)
1604          saved_cppflags="${CPPFLAGS}"
1605          CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}"
1606          AC_COMPILE_IFELSE(
1607             [AC_LANG_PROGRAM(
1608                 [#include <curl/curl.h>],
1609                     [curl_version();])
1610             ],[
1611                 AC_MSG_RESULT(yes)
1612                 ac_cv_curl_h="yes"
1613             ],[
1614                 AC_MSG_RESULT(no)
1615                 ac_cv_curl_h="no"
1616             ]
1617          )
1618          CPPFLAGS="${saved_cppflags}"
1619          if test "${ac_cv_curl_h}" = "yes"; then
1620              PBX_CURL=1
1621              AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1622          fi
1623       fi
1624    fi
1627 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1628 AC_OUTPUT
1630 if test "x${silent}" != "xyes" ; then
1631 echo
1632 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
1633 echo "            .\$7\$7..          .7\$\$7:.    "
1634 echo "          .\$\$:.                 ,\$7.7   "
1635 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
1636 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
1637 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
1638 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
1639 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
1640 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
1641 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
1642 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
1643 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
1644 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
1645 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
1646 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
1647 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
1648 echo " \$\$\$\$\$                        \$\$\$       "
1649 echo "  \$\$\$\$7.                       \$\$  (TM)     "
1650 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
1651 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
1652 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
1653 echo
1656 AC_MSG_NOTICE(Package configured for: )
1657 AC_MSG_NOTICE( OS type  : $host_os)
1658 AC_MSG_NOTICE( Host CPU : $host_cpu)
1659 if test "${cross_compiling}" = "yes"; then
1660    AC_MSG_NOTICE( Cross Compilation = YES)