1 # Process this file with autoconf to produce a configure script.
5 AC_INIT(asterisk, 1.4, www.asterisk.org)
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$)
21 AC_USE_SYSTEM_EXTENSIONS # note- does not work on FreeBSD
25 ac_default_prefix=/usr/local
26 CPPFLAGS=-I/usr/local/include
27 LDFLAGS=-L/usr/local/lib
30 ac_default_prefix=/usr
31 if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
32 if test ${sysconfdir} = '${prefix}/etc'; then
35 if test ${mandir} = '${prefix}/man'; then
42 if test ${localstatedir} = '${prefix}/var'; then
46 BUILD_PLATFORM=${build}
47 BUILD_CPU=${build_cpu}
48 BUILD_VENDOR=${build_vendor}
51 AC_SUBST(BUILD_PLATFORM)
53 AC_SUBST(BUILD_VENDOR)
58 HOST_VENDOR=${host_vendor}
61 AC_SUBST(HOST_PLATFORM)
87 AC_PATH_TOOL([UNAME], [uname], No)
88 if test ! x"${UNAME}" = xNo; then
89 PBX_OSREV=$(${UNAME} -r)
94 #ifndef ASTERISK_AUTOCONFIG_H
95 #define ASTERISK_AUTOCONFIG_H
97 #include "asterisk/buildopts.h"
105 # cross-compile checks
106 if test "${cross_compiling}" = "yes";
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.
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
128 AC_PATH_TOOL([STRIP], [strip], :)
129 AC_PATH_TOOL([AR], [ar], :)
132 if test "x$with_gnu_ld" = "xyes" ; then
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
151 AC_PATH_PROG([FETCH], [fetch], [:])
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.])
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) ;;
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
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])
230 # Checks for typedefs, structures, and compiler characteristics.
239 AC_CHECK_MEMBERS([struct stat.st_blksize])
243 AC_CHECK_TYPES([ptrdiff_t])
245 # Checks for library functions.
247 AC_FUNC_CLOSEDIR_VOID
248 AC_FUNC_ERROR_AT_LINE
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
258 AC_FUNC_SELECT_ARGTYPES
259 AC_FUNC_SETVBUF_REVERSED
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)
275 AC_LANG_PROGRAM([#include <stdlib.h>
277 [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);]),
279 AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
283 AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
285 AC_LANG_PROGRAM([#include <stdlib.h>
287 [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);]),
289 AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
293 AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
295 AC_LANG_PROGRAM([#include <pthread.h>],
296 [int foo = PTHREAD_RWLOCK_INITIALIZER;]),
298 AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
302 AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
304 AC_LANG_PROGRAM([#include <pthread.h>],
305 [int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
307 AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
311 AC_MSG_CHECKING(for compiler atomic operations)
313 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
315 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
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"
330 AC_LANG_PROGRAM([], [int x = 1;]),
332 [saved_LDFLAGS="${LDFLAGS}"]
333 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
334 AC_MSG_CHECKING(for --gc-sections support)
336 AC_LANG_PROGRAM([], [int x = 1;]),
338 [GC_CFLAGS="-ffunction-sections"]
339 [[GC_LDFLAGS="-Wl,--gc-sections"]],
342 [LDFLAGS="${saved_LDFLAGS}"],
345 CFLAGS="${saved_CFLAGS}"
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
352 AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
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
362 AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
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)
373 #ifdef HAVE_SYS_SOCKET_H
374 #include <sys/socket.h>
376 #ifdef HAVE_NETINET_IN_H
377 #include <netinet/in.h>
379 #ifdef HAVE_ARPA_NAMESER_H
380 #include <arpa/nameser.h>
382 #include <resolv.h>],
383 [int foo = res_ninit(NULL);]),
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)
390 #ifdef HAVE_SYS_SOCKET_H
391 #include <sys/socket.h>
393 #ifdef HAVE_NETINET_IN_H
394 #include <netinet/in.h>
396 #ifdef HAVE_ARPA_NAMESER_H
397 #include <arpa/nameser.h>
399 #include <resolv.h>],
400 [res_ndestroy(NULL);]),
402 AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
408 AC_MSG_CHECKING(for RTLD_NOLOAD)
410 AC_LANG_PROGRAM([#include <dlfcn.h>],
411 [int foo = RTLD_NOLOAD;]),
413 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
417 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
419 AC_LANG_PROGRAM([#include <netinet/in.h>],
420 [int foo = IP_MTU_DISCOVER;]),
422 AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
426 AC_CHECK_HEADER([libkern/OSAtomic.h],
427 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
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_ZAPTEL_TRANSCODE=1
445 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
449 AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
452 AC_SUBST(GSM_INTERNAL)
454 if test "${USE_GSM}" != "no"; then
455 if test "${GSM_DIR}" = "internal"; then
457 elif test "${GSM_DIR}" != ""; then
460 if test "${GSM_SYSTEM}" = "yes"; then
462 if test "x${GSM_DIR}" != "x"; then
463 if test -d ${GSM_DIR}/lib; then
464 gsmlibdir="-L${GSM_DIR}/lib"
466 gsmlibdir="-L${GSM_DIR}"
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])
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])
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
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}])
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])
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])
500 if test "${GSM_OK}" = "1" ; then
502 if test "x${GSM_DIR}" != "x"; then
503 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
504 GSM_INCLUDE="-I${GSM_DIR}/include"
511 if test "${GSM_INTERNAL}" = "yes"; then
513 AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
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}"
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"
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`
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}`
542 [#include "c-client.h"
543 void mm_searched (MAILSTREAM *stream,unsigned long number)
546 void mm_exists (MAILSTREAM *stream,unsigned long number)
549 void mm_expunged (MAILSTREAM *stream,unsigned long number)
552 void mm_flags (MAILSTREAM *stream,unsigned long number)
555 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
558 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
561 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
564 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
567 void mm_log (char *string,long errflg)
570 void mm_dlog (char *string)
573 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
576 void mm_critical (MAILSTREAM *stream)
579 void mm_nocritical (MAILSTREAM *stream)
582 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
585 void mm_fatal (char *string)
589 MAILSTREAM *foo = mail_open(NULL, "", 0);
592 [ac_cv_imap_tk="yes"],
595 if test "${ac_cv_imap_tk}" = "yes"; then
598 [#include "c-client.h"
599 void mm_searched (MAILSTREAM *stream,unsigned long number)
602 void mm_exists (MAILSTREAM *stream,unsigned long number)
605 void mm_expunged (MAILSTREAM *stream,unsigned long number)
608 void mm_flags (MAILSTREAM *stream,unsigned long number)
611 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
614 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
617 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
620 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
623 void mm_log (char *string,long errflg)
626 void mm_dlog (char *string)
629 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
632 void mm_critical (MAILSTREAM *stream)
635 void mm_nocritical (MAILSTREAM *stream)
638 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
641 void mm_fatal (char *string)
645 long check = mail_expunge_full(NULL, "", 0);
648 [ac_cv_imap_tk2006="yes"],
649 [ac_cv_imap_tk2006="no"]
652 CPPFLAGS="${saved_cppflags}"
654 if test "${ac_cv_imap_tk}" = "no"; then
656 if test "${switch_to_system_on_failure}" = "yes"; then
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}"
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}"
669 [#include "c-client.h"
670 void mm_searched (MAILSTREAM *stream,unsigned long number)
673 void mm_exists (MAILSTREAM *stream,unsigned long number)
676 void mm_expunged (MAILSTREAM *stream,unsigned long number)
679 void mm_flags (MAILSTREAM *stream,unsigned long number)
682 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
685 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
688 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
691 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
694 void mm_log (char *string,long errflg)
697 void mm_dlog (char *string)
700 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
703 void mm_critical (MAILSTREAM *stream)
706 void mm_nocritical (MAILSTREAM *stream)
709 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
712 void mm_fatal (char *string)
716 MAILSTREAM *foo = mail_open(NULL, "", 0);
719 [ac_cv_imap_tk="yes"],
722 if test "${ac_cv_imap_tk}" = "yes"; then
725 [#include "c-client.h"
726 void mm_searched (MAILSTREAM *stream,unsigned long number)
729 void mm_exists (MAILSTREAM *stream,unsigned long number)
732 void mm_expunged (MAILSTREAM *stream,unsigned long number)
735 void mm_flags (MAILSTREAM *stream,unsigned long number)
738 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
741 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
744 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
747 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
750 void mm_log (char *string,long errflg)
753 void mm_dlog (char *string)
756 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
759 void mm_critical (MAILSTREAM *stream)
762 void mm_nocritical (MAILSTREAM *stream)
765 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
768 void mm_fatal (char *string)
772 long check = mail_expunge_full(NULL, "", 0);
775 [ac_cv_imap_tk2006="yes"],
776 [ac_cv_imap_tk2006="no"]
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}"
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}`
795 #include <imap/c-client.h>
796 void mm_searched (MAILSTREAM *stream,unsigned long number)
799 void mm_exists (MAILSTREAM *stream,unsigned long number)
802 void mm_expunged (MAILSTREAM *stream,unsigned long number)
805 void mm_flags (MAILSTREAM *stream,unsigned long number)
808 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
811 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
814 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
817 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
820 void mm_log (char *string,long errflg)
823 void mm_dlog (char *string)
826 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
829 void mm_critical (MAILSTREAM *stream)
832 void mm_nocritical (MAILSTREAM *stream)
835 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
838 void mm_fatal (char *string)
842 MAILSTREAM *foo = mail_open(NULL, "", 0);
845 [ac_cv_imap_tk="yes"],
848 if test "${ac_cv_imap_tk}" = "yes"; then
852 #include <imap/c-client.h>
853 void mm_searched (MAILSTREAM *stream,unsigned long number)
856 void mm_exists (MAILSTREAM *stream,unsigned long number)
859 void mm_expunged (MAILSTREAM *stream,unsigned long number)
862 void mm_flags (MAILSTREAM *stream,unsigned long number)
865 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
868 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
871 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
874 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
877 void mm_log (char *string,long errflg)
880 void mm_dlog (char *string)
883 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
886 void mm_critical (MAILSTREAM *stream)
889 void mm_nocritical (MAILSTREAM *stream)
892 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
895 void mm_fatal (char *string)
899 long check = mail_expunge_full(NULL, "", 0);
902 [ac_cv_imap_tk2006="yes"],
903 [ac_cv_imap_tk2006="no"]
905 else #looking in imap directory didn't work, try c-client
907 imap_libs="-lc-client"
908 imap_include="-DUSE_SYSTEM_CCLIENT"
909 CPPFLAGS="${saved_cppflags}"
911 CPPFLAGS="${CPPFLAGS} ${imap_include}"
912 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
916 #include <c-client/c-client.h>
917 void mm_searched (MAILSTREAM *stream,unsigned long number)
920 void mm_exists (MAILSTREAM *stream,unsigned long number)
923 void mm_expunged (MAILSTREAM *stream,unsigned long number)
926 void mm_flags (MAILSTREAM *stream,unsigned long number)
929 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
932 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
935 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
938 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
941 void mm_log (char *string,long errflg)
944 void mm_dlog (char *string)
947 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
950 void mm_critical (MAILSTREAM *stream)
953 void mm_nocritical (MAILSTREAM *stream)
956 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
959 void mm_fatal (char *string)
963 MAILSTREAM *foo = mail_open(NULL, "", 0);
966 [ac_cv_imap_tk="yes"],
969 if test "${ac_cv_imap_tk}" = "yes"; then
973 #include <c-client/c-client.h>
974 void mm_searched (MAILSTREAM *stream,unsigned long number)
977 void mm_exists (MAILSTREAM *stream,unsigned long number)
980 void mm_expunged (MAILSTREAM *stream,unsigned long number)
983 void mm_flags (MAILSTREAM *stream,unsigned long number)
986 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
989 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
992 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
995 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
998 void mm_log (char *string,long errflg)
1001 void mm_dlog (char *string)
1004 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
1007 void mm_critical (MAILSTREAM *stream)
1010 void mm_nocritical (MAILSTREAM *stream)
1013 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
1016 void mm_fatal (char *string)
1020 long check = mail_expunge_full(NULL, "", 0);
1023 [ac_cv_imap_tk2006="yes"],
1024 [ac_cv_imap_tk2006="no"]
1029 if test "${ac_cv_imap_tk}" = "yes"; then
1031 IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
1032 IMAP_TK_INCLUDE="${imap_include}"
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.])
1038 elif test -n "${IMAP_TK_MANDATORY}"; then
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.])
1048 CPPFLAGS="${saved_cppflags}"
1049 LIBS="${saved_libs}"
1052 # Needed by unixodbc
1053 AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], [])
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"
1065 kdelibdir="${KDE_DIR}"
1067 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
1071 [#include "kcrash.h"],
1072 [KCrash::defaultCrashHandler(1);])
1074 [ac_cv_lib_kde_crash="yes"],
1075 [ac_cv_lib_kde_crash="no"])
1077 LIBS="${saved_libs}"
1078 CPPFLAGS="${saved_cppflags}"
1080 if test "${ac_cv_lib_kde_crash}" = "yes"; then
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"
1088 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
1089 elif test -n "${KDE_MANDATORY}"; then
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.])
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})
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])
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])
1136 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
1139 if test x"${NETSNMP_CONFIG}" != xNo; then
1140 NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
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}"
1148 elif test -n "${NETSNMP_MANDATORY}";
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])
1156 elif test -n "${NETSNMP_MANDATORY}";
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])
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
1173 AC_CHECK_HEADER([linux/soundcard.h],
1176 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1178 if test "$PBX_OSS" = "0"; then
1179 AC_CHECK_HEADER([sys/soundcard.h],
1182 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1185 if test "$PBX_OSS" = "0"; then
1186 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
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])
1203 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
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])
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}"
1226 elif test -n "${PGSQL_MANDATORY}";
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])
1235 elif test -n "${PGSQL_MANDATORY}";
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])
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}"
1257 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
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();])
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])
1279 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
1280 if test -n "${OPENH323_DIR}"; then
1281 OPENH323DIR="${OPENH323_DIR}"
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.],
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])
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";
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";
1331 if test "${FREETDS_DIR}x" = "x";
1333 for tds_dir in /usr /usr/local;
1335 if test -f "${tds_dir}/include/tdsver.h";
1337 FREETDS_DIR="${tds_dir}"
1341 case `${GREP} TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
1343 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
1346 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
1349 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
1352 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
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}"
1371 tonezone_dir="zaptel"
1372 if test "x${ZAPTEL_DIR}" != "x"; then
1373 tonezone_extra_inc="${ZAPTEL_INCLUDE}"
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])
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
1393 vpblibdir=${VPB_DIR}
1395 LIBS="${LIBS} -L${vpblibdir}"
1396 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
1398 LIBS="${LIBS} -lvpb -lpthread"
1402 [#include <vpbapi.h>],
1403 [int q = vpb_open(0,0);])
1405 [ AC_MSG_RESULT(yes)
1406 ac_cv_lib_vpb_vpb_open="yes"
1409 ac_cv_lib_vpb_vpb_open="no"
1412 LIBS="${saved_libs}"
1413 CPPFLAGS="${saved_cppflags}"
1414 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
1416 if test "${VPB_DIR}" != ""; then
1417 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
1418 VPB_INCLUDE="-I${VPB_DIR}/include"
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.])
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"
1444 [#include <zaptel/zaptel.h>],
1445 [int foo = ZT_DIAL_OP_CANCEL;])
1447 [ AC_MSG_RESULT(yes)
1448 ac_cv_zaptel_h="yes"
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"
1460 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
1461 elif test -n "${ZAPTEL_MANDATORY}";
1463 AC_MSG_NOTICE([***])
1464 AC_MSG_NOTICE([*** The Zaptel installation on this system appears to be broken.])
1465 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1466 AC_MSG_NOTICE([*** including --without-zaptel.])
1471 if test "${PBX_ZAPTEL}" = 1 && test "x${PBX_DAHDI}" != "x1"; then
1472 AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
1473 saved_cppflags="${CPPFLAGS}"
1474 if test "x${ZAPTEL_DIR}" != "x"; then
1475 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1480 [#include <zaptel/zaptel.h>],
1481 [int foo = ZT_EVENT_REMOVED;])
1483 [ AC_MSG_RESULT(yes)
1484 ac_cv_zaptel_vldtmf="yes"
1487 ac_cv_zaptel_vldtmf="no"
1490 CPPFLAGS="${saved_cppflags}"
1491 if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
1494 AC_MSG_CHECKING(for ZT_TCOP_ALLOCATE in zaptel/zaptel.h)
1495 saved_cppflags="${CPPFLAGS}"
1496 if test "x${ZAPTEL_DIR}" != "x"; then
1497 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1502 [#include <zaptel/zaptel.h>],
1503 [int foo = ZT_TCOP_ALLOCATE;])
1505 [ AC_MSG_RESULT(yes)
1506 ac_cv_zaptel_transcode="yes"
1509 ac_cv_zaptel_transcode="no"
1512 CPPFLAGS="${saved_cppflags}"
1513 if test "${ac_cv_zaptel_transcode}" = "yes"; then
1514 PBX_ZAPTEL_TRANSCODE=1
1517 AC_SUBST(PBX_ZAPTEL_VLDTMF)
1518 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
1520 if test "x${PBX_ZAPTEL}" = "x1" ; then
1526 if test "x$TERMCAP_LIB" != "x" ; then
1527 EDITLINE_LIB="$TERMCAP_LIB"
1528 elif test "x$TINFO_LIB" != "x" ; then
1529 EDITLINE_LIB="$TINFO_LIB"
1530 elif test "x$CURSES_LIB" != "x" ; then
1531 EDITLINE_LIB="$CURSES_LIB"
1532 elif test "x$NCURSES_LIB" != "x" ; then
1533 EDITLINE_LIB="$NCURSES_LIB"
1535 AC_MSG_ERROR(*** termcap support not found)
1537 AC_SUBST(EDITLINE_LIB)
1539 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1542 AC_CHECK_HEADER([linux/compiler.h],
1543 [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
1545 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1546 #include <linux/version.h>
1547 #ifdef HAVE_LINUX_COMPILER_H
1548 #include <linux/compiler.h>
1551 AC_SUBST(PBX_IXJUSER)
1553 if test "${cross_compiling}" = "no";
1555 AC_CHECK_FILE(/sbin/launchd, AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
1559 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1560 if test ! "x${GTKCONFIG}" = xNo; then
1561 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1562 GTK_LIB=$(${GTKCONFIG} --libs gthread)
1564 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1567 AC_SUBST(GTK_INCLUDE)
1571 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
1572 if test ! "x${PKGCONFIG}" = xNo; then
1573 GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
1574 GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
1576 AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
1579 AC_SUBST(GTK2_INCLUDE)
1582 if test "${USE_CURL}" != "no"; then
1583 AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
1584 if test ! x"${CURL_CONFIG}" = xNo; then
1586 if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
1587 CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
1588 CURL_LIB=$(${CURL_CONFIG} --libs)
1590 AC_MSG_CHECKING(for curl_version() in curl/curl.h)
1591 saved_cppflags="${CPPFLAGS}"
1592 CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}"
1595 [#include <curl/curl.h>],
1605 CPPFLAGS="${saved_cppflags}"
1606 if test "${ac_cv_curl_h}" = "yes"; then
1608 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1614 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1617 if test "x${silent}" != "xyes" ; then
1619 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1620 echo " .\$7\$7.. .7\$\$7:. "
1621 echo " .\$\$:. ,\$7.7 "
1622 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1623 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1624 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1625 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1626 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1627 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1628 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1629 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1630 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1631 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1632 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1633 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1634 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1635 echo " \$\$\$\$\$ \$\$\$ "
1636 echo " \$\$\$\$7. \$\$ (TM) "
1637 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1638 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1639 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1643 AC_MSG_NOTICE(Package configured for: )
1644 AC_MSG_NOTICE( OS type : $host_os)
1645 AC_MSG_NOTICE( Host CPU : $host_cpu)
1646 if test "${cross_compiling}" = "yes"; then
1647 AC_MSG_NOTICE( Cross Compilation = YES)