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 ${sysconfdir} = '${prefix}/etc'; then
34 if test ${mandir} = '${prefix}/man'; then
40 if test ${localstatedir} = '${prefix}/var'; then
44 BUILD_PLATFORM=${build}
45 BUILD_CPU=${build_cpu}
46 BUILD_VENDOR=${build_vendor}
49 AC_SUBST(BUILD_PLATFORM)
51 AC_SUBST(BUILD_VENDOR)
56 HOST_VENDOR=${host_vendor}
59 AC_SUBST(HOST_PLATFORM)
85 AC_PATH_TOOL([UNAME], [uname], No)
86 if test ! x"${UNAME}" = xNo; then
87 PBX_OSREV=$(${UNAME} -r)
92 #ifndef ASTERISK_AUTOCONFIG_H
93 #define ASTERISK_AUTOCONFIG_H
95 #include "asterisk/buildopts.h"
103 # cross-compile checks
104 if test "${cross_compiling}" = "yes";
106 AC_CHECK_TOOL(CC, gcc, :)
107 AC_CHECK_TOOL(CXX, g++, :)
108 AC_CHECK_TOOL(LD, ld, :)
109 AC_CHECK_TOOL(RANLIB, ranlib, :)
112 # Checks for programs.
117 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
118 # the developers regenerating the configure script don't have to install libtool.
119 AST_PROG_LD # note - does not work on freebsd
126 AC_PATH_TOOL([STRIP], [strip], :)
127 AC_PATH_TOOL([AR], [ar], :)
130 if test "x$with_gnu_ld" = "xyes" ; then
135 AC_PATH_PROG([AWK], [awk], :)
136 AC_PATH_PROG([GREP], [grep], :)
137 AC_PATH_PROG([FIND], [find], :)
138 AC_PATH_PROG([COMPRESS], [compress], :)
139 AC_PATH_PROG([BASENAME], [basename], :)
140 AC_PATH_PROG([ID], [id], :)
141 AC_PATH_PROG([DIRNAME], [dirname], :)
142 AC_PATH_PROG([SHELL], [sh], :)
143 AC_PATH_PROG([LN], [ln], :)
144 AC_PATH_PROG([DOT], [dot], :)
145 AC_PATH_PROG([WGET], [wget], :)
146 if test "${WGET}" != ":" ; then
149 AC_PATH_PROG([FETCH], [fetch], [:])
154 AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
155 if test "${SOXMIX}" != ":" ; then
156 AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
163 AC_ARG_ENABLE(dev-mode,
164 [ --enable-dev-mode Turn on developer mode],
165 [case "${enableval}" in
166 y|ye|yes) AST_DEVMODE=yes ;;
167 n|no) AST_DEVMODE=no ;;
168 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
170 AC_SUBST(AST_DEVMODE)
172 # package option names should be in alphabetical order
173 # by the --with option name, to make things easier for the users :-)
175 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
176 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
177 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
178 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
179 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
180 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
181 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
182 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
183 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
184 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
185 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
186 AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl])
187 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
188 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
189 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
190 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
191 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
192 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
193 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
194 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
195 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
196 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
197 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
198 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
199 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
200 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
201 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
202 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
203 AST_EXT_LIB_SETUP([SPEEXDSP], [Speexdsp], [speexdsp])
204 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
205 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
206 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
207 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
208 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
209 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
210 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
211 AST_EXT_LIB_SETUP([USB], [usb], [usb])
212 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
213 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
214 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
215 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
217 # check for basic system features and functionality before
218 # checking for package libraries
224 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 # Checks for typedefs, structures, and compiler characteristics.
237 AC_CHECK_MEMBERS([struct stat.st_blksize])
241 AC_CHECK_TYPES([ptrdiff_t])
243 # Checks for library functions.
245 AC_FUNC_CLOSEDIR_VOID
246 AC_FUNC_ERROR_AT_LINE
249 AC_PROG_GCC_TRADITIONAL
250 # XXX: these are commented out until we determine whether it matters if our malloc()
251 # acts exactly like glibc's or not
256 AC_FUNC_SELECT_ARGTYPES
257 AC_FUNC_SETVBUF_REVERSED
266 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])
268 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
269 AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
271 AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
273 AC_LANG_PROGRAM([#include <stdlib.h>
275 [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);]),
277 AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
281 AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
283 AC_LANG_PROGRAM([#include <stdlib.h>
285 [struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);]),
287 AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
291 AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
293 AC_LANG_PROGRAM([#include <pthread.h>],
294 [int foo = PTHREAD_RWLOCK_INITIALIZER;]),
296 AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
300 AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
302 AC_LANG_PROGRAM([#include <pthread.h>],
303 [int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
305 AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
309 AC_MSG_CHECKING(for compiler atomic operations)
311 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
313 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
317 AST_GCC_ATTRIBUTE(pure)
318 AST_GCC_ATTRIBUTE(malloc)
319 AST_GCC_ATTRIBUTE(const)
320 AST_GCC_ATTRIBUTE(unused)
321 AST_GCC_ATTRIBUTE(always_inline)
322 AST_GCC_ATTRIBUTE(deprecated)
324 AC_MSG_CHECKING(for -ffunction-sections support)
325 saved_CFLAGS="${CFLAGS}"
326 CFLAGS="${CFLAGS} -ffunction-sections"
328 AC_LANG_PROGRAM([], [int x = 1;]),
330 [saved_LDFLAGS="${LDFLAGS}"]
331 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
332 AC_MSG_CHECKING(for --gc-sections support)
334 AC_LANG_PROGRAM([], [int x = 1;]),
336 [GC_CFLAGS="-ffunction-sections"]
337 [[GC_LDFLAGS="-Wl,--gc-sections"]],
340 [LDFLAGS="${saved_LDFLAGS}"],
343 CFLAGS="${saved_CFLAGS}"
347 AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
348 if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
350 AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
353 AST_DECLARATION_AFTER_STATEMENT=
355 AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
357 AC_MSG_CHECKING(for -fno-strict-overflow)
358 if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
360 AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
363 AST_NO_STRICT_OVERFLOW=
365 AC_SUBST(AST_NO_STRICT_OVERFLOW)
367 AC_SEARCH_LIBS(res_9_ninit, resolv)
368 AC_MSG_CHECKING(for res_ninit)
371 #ifdef HAVE_SYS_SOCKET_H
372 #include <sys/socket.h>
374 #ifdef HAVE_NETINET_IN_H
375 #include <netinet/in.h>
377 #ifdef HAVE_ARPA_NAMESER_H
378 #include <arpa/nameser.h>
380 #include <resolv.h>],
381 [int foo = res_ninit(NULL);]),
383 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
384 AC_SEARCH_LIBS(res_9_ndestroy, resolv)
385 AC_MSG_CHECKING(for res_ndestroy)
388 #ifdef HAVE_SYS_SOCKET_H
389 #include <sys/socket.h>
391 #ifdef HAVE_NETINET_IN_H
392 #include <netinet/in.h>
394 #ifdef HAVE_ARPA_NAMESER_H
395 #include <arpa/nameser.h>
397 #include <resolv.h>],
398 [res_ndestroy(NULL);]),
400 AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
406 AC_MSG_CHECKING(for RTLD_NOLOAD)
408 AC_LANG_PROGRAM([#include <dlfcn.h>],
409 [int foo = RTLD_NOLOAD;]),
411 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
415 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
417 AC_LANG_PROGRAM([#include <netinet/in.h>],
418 [int foo = IP_MTU_DISCOVER;]),
420 AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
424 AC_CHECK_HEADER([libkern/OSAtomic.h],
425 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
429 # do the package library checks now
431 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
433 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
435 if test "x${host_os}" = "xlinux-gnu" ; then
436 AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
439 if test "${USE_DAHDI}" != "no" ; then
440 AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
441 if test "x${PBX_DAHDI}" = "x1" ; then
442 PBX_ZAPTEL_TRANSCODE=1
443 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
447 AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
450 AC_SUBST(GSM_INTERNAL)
452 if test "${USE_GSM}" != "no"; then
453 if test "${GSM_DIR}" = "internal"; then
455 elif test "${GSM_DIR}" != ""; then
458 if test "${GSM_SYSTEM}" = "yes"; then
460 if test "x${GSM_DIR}" != "x"; then
461 if test -d ${GSM_DIR}/lib; then
462 gsmlibdir="-L${GSM_DIR}/lib"
464 gsmlibdir="-L${GSM_DIR}"
467 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
468 [Define to indicate the GSM library]), [], ${gsmlibdir})
469 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
470 if test "x${GSM_DIR}" != "x" ; then
471 AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
472 AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
474 AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
475 AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
477 if test "${GSM_HEADER_FOUND}" = "0" ; then
478 if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
479 if test "x${GSM_MANDATORY}" = "xyes" ; then
481 AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
482 AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
483 AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
489 if test "${GSM_HEADER_FOUND}" = "1" ; then
490 AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
493 if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
494 AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
498 if test "${GSM_OK}" = "1" ; then
500 if test "x${GSM_DIR}" != "x"; then
501 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
502 GSM_INCLUDE="-I${GSM_DIR}/include"
509 if test "${GSM_INTERNAL}" = "yes"; then
511 AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
515 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
517 if test "${PBX_IKSEMEL}" = 1; then
518 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye], [gnutls/gnutls.h], [-lz -lgcrypt -lgpg-error])
521 if test "${USE_IMAP_TK}" != "no"; then
522 saved_cppflags="${CPPFLAGS}"
524 switch_to_system_on_failure="no"
525 if test "${IMAP_TK_DIR}" = ""; then
526 IMAP_TK_DIR=`pwd`"/../imap-2004g"
527 switch_to_system_on_failure="yes"
529 if test "${IMAP_TK_DIR}" != "system"; then
530 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
531 if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
532 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
534 imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
535 imap_include="-I${IMAP_TK_DIR}/c-client"
536 CPPFLAGS="${CPPFLAGS} ${imap_include}"
537 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
540 [#include "c-client.h"
541 void mm_searched (MAILSTREAM *stream,unsigned long number)
544 void mm_exists (MAILSTREAM *stream,unsigned long number)
547 void mm_expunged (MAILSTREAM *stream,unsigned long number)
550 void mm_flags (MAILSTREAM *stream,unsigned long number)
553 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
556 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
559 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
562 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
565 void mm_log (char *string,long errflg)
568 void mm_dlog (char *string)
571 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
574 void mm_critical (MAILSTREAM *stream)
577 void mm_nocritical (MAILSTREAM *stream)
580 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
583 void mm_fatal (char *string)
587 MAILSTREAM *foo = mail_open(NULL, "", 0);
590 [ac_cv_imap_tk="yes"],
593 if test "${ac_cv_imap_tk}" = "yes"; then
596 [#include "c-client.h"
597 void mm_searched (MAILSTREAM *stream,unsigned long number)
600 void mm_exists (MAILSTREAM *stream,unsigned long number)
603 void mm_expunged (MAILSTREAM *stream,unsigned long number)
606 void mm_flags (MAILSTREAM *stream,unsigned long number)
609 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
612 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
615 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
618 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
621 void mm_log (char *string,long errflg)
624 void mm_dlog (char *string)
627 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
630 void mm_critical (MAILSTREAM *stream)
633 void mm_nocritical (MAILSTREAM *stream)
636 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
639 void mm_fatal (char *string)
643 long check = mail_expunge_full(NULL, "", 0);
646 [ac_cv_imap_tk2006="yes"],
647 [ac_cv_imap_tk2006="no"]
650 CPPFLAGS="${saved_cppflags}"
652 if test "${ac_cv_imap_tk}" = "no"; then
654 if test "${switch_to_system_on_failure}" = "yes"; then
656 else #This means they specified a directory. Search for a package installation there too
657 AC_MSG_CHECKING([for system c-client library...])
658 CPPFLAGS="${saved_cppflags}"
660 imap_include="-I${IMAP_TK_DIR}/include"
661 imap_ldflags="-L${IMAP_TK_DIR}/lib"
662 imap_libs="-lc-client"
663 CPPFLAGS="${CPPFLAGS} ${imap_include}"
664 LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
667 [#include "c-client.h"
668 void mm_searched (MAILSTREAM *stream,unsigned long number)
671 void mm_exists (MAILSTREAM *stream,unsigned long number)
674 void mm_expunged (MAILSTREAM *stream,unsigned long number)
677 void mm_flags (MAILSTREAM *stream,unsigned long number)
680 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
683 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
686 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
689 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
692 void mm_log (char *string,long errflg)
695 void mm_dlog (char *string)
698 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
701 void mm_critical (MAILSTREAM *stream)
704 void mm_nocritical (MAILSTREAM *stream)
707 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
710 void mm_fatal (char *string)
714 MAILSTREAM *foo = mail_open(NULL, "", 0);
717 [ac_cv_imap_tk="yes"],
720 if test "${ac_cv_imap_tk}" = "yes"; then
723 [#include "c-client.h"
724 void mm_searched (MAILSTREAM *stream,unsigned long number)
727 void mm_exists (MAILSTREAM *stream,unsigned long number)
730 void mm_expunged (MAILSTREAM *stream,unsigned long number)
733 void mm_flags (MAILSTREAM *stream,unsigned long number)
736 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
739 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
742 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
745 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
748 void mm_log (char *string,long errflg)
751 void mm_dlog (char *string)
754 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
757 void mm_critical (MAILSTREAM *stream)
760 void mm_nocritical (MAILSTREAM *stream)
763 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
766 void mm_fatal (char *string)
770 long check = mail_expunge_full(NULL, "", 0);
773 [ac_cv_imap_tk2006="yes"],
774 [ac_cv_imap_tk2006="no"]
780 if test "${IMAP_TK_DIR}" = "system"; then
781 #We will enter here if user specified "system" or if any of above checks failed
782 AC_MSG_CHECKING([for system c-client library...])
783 CPPFLAGS="${saved_cppflags}"
786 imap_libs="-lc-client"
787 imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
788 CPPFLAGS="${CPPFLAGS} ${imap_include}"
789 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
793 #include <imap/c-client.h>
794 void mm_searched (MAILSTREAM *stream,unsigned long number)
797 void mm_exists (MAILSTREAM *stream,unsigned long number)
800 void mm_expunged (MAILSTREAM *stream,unsigned long number)
803 void mm_flags (MAILSTREAM *stream,unsigned long number)
806 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
809 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
812 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
815 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
818 void mm_log (char *string,long errflg)
821 void mm_dlog (char *string)
824 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
827 void mm_critical (MAILSTREAM *stream)
830 void mm_nocritical (MAILSTREAM *stream)
833 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
836 void mm_fatal (char *string)
840 MAILSTREAM *foo = mail_open(NULL, "", 0);
843 [ac_cv_imap_tk="yes"],
846 if test "${ac_cv_imap_tk}" = "yes"; then
850 #include <imap/c-client.h>
851 void mm_searched (MAILSTREAM *stream,unsigned long number)
854 void mm_exists (MAILSTREAM *stream,unsigned long number)
857 void mm_expunged (MAILSTREAM *stream,unsigned long number)
860 void mm_flags (MAILSTREAM *stream,unsigned long number)
863 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
866 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
869 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
872 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
875 void mm_log (char *string,long errflg)
878 void mm_dlog (char *string)
881 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
884 void mm_critical (MAILSTREAM *stream)
887 void mm_nocritical (MAILSTREAM *stream)
890 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
893 void mm_fatal (char *string)
897 long check = mail_expunge_full(NULL, "", 0);
900 [ac_cv_imap_tk2006="yes"],
901 [ac_cv_imap_tk2006="no"]
903 else #looking in imap directory didn't work, try c-client
905 imap_libs="-lc-client"
906 imap_include="-DUSE_SYSTEM_CCLIENT"
907 CPPFLAGS="${saved_cppflags}"
909 CPPFLAGS="${CPPFLAGS} ${imap_include}"
910 LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
914 #include <c-client/c-client.h>
915 void mm_searched (MAILSTREAM *stream,unsigned long number)
918 void mm_exists (MAILSTREAM *stream,unsigned long number)
921 void mm_expunged (MAILSTREAM *stream,unsigned long number)
924 void mm_flags (MAILSTREAM *stream,unsigned long number)
927 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
930 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
933 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
936 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
939 void mm_log (char *string,long errflg)
942 void mm_dlog (char *string)
945 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
948 void mm_critical (MAILSTREAM *stream)
951 void mm_nocritical (MAILSTREAM *stream)
954 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
957 void mm_fatal (char *string)
961 MAILSTREAM *foo = mail_open(NULL, "", 0);
964 [ac_cv_imap_tk="yes"],
967 if test "${ac_cv_imap_tk}" = "yes"; then
971 #include <c-client/c-client.h>
972 void mm_searched (MAILSTREAM *stream,unsigned long number)
975 void mm_exists (MAILSTREAM *stream,unsigned long number)
978 void mm_expunged (MAILSTREAM *stream,unsigned long number)
981 void mm_flags (MAILSTREAM *stream,unsigned long number)
984 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
987 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
990 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
993 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
996 void mm_log (char *string,long errflg)
999 void mm_dlog (char *string)
1002 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
1005 void mm_critical (MAILSTREAM *stream)
1008 void mm_nocritical (MAILSTREAM *stream)
1011 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
1014 void mm_fatal (char *string)
1018 long check = mail_expunge_full(NULL, "", 0);
1021 [ac_cv_imap_tk2006="yes"],
1022 [ac_cv_imap_tk2006="no"]
1027 if test "${ac_cv_imap_tk}" = "yes"; then
1029 IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
1030 IMAP_TK_INCLUDE="${imap_include}"
1032 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
1033 if test "${ac_cv_imap_tk2006}" = "yes"; then
1034 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
1036 elif test -n "${IMAP_TK_MANDATORY}"; then
1038 AC_MSG_NOTICE([***])
1039 AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
1040 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1041 AC_MSG_NOTICE([*** including --without-imap.])
1046 CPPFLAGS="${saved_cppflags}"
1047 LIBS="${saved_libs}"
1050 # Needed by unixodbc
1051 AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], [])
1055 if test "${USE_KDE}" != "no"; then
1056 AC_MSG_CHECKING(for crashHandler in -lkdecore)
1057 saved_libs="${LIBS}"
1058 saved_cppflags="${CPPFLAGS}"
1059 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
1060 if test -d ${KDE_DIR}/lib; then
1061 kdelibdir="${KDE_DIR}/lib"
1063 kdelibdir="${KDE_DIR}"
1065 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
1069 [#include "kcrash.h"],
1070 [KCrash::defaultCrashHandler(1);])
1072 [ac_cv_lib_kde_crash="yes"],
1073 [ac_cv_lib_kde_crash="no"])
1075 LIBS="${saved_libs}"
1076 CPPFLAGS="${saved_cppflags}"
1078 if test "${ac_cv_lib_kde_crash}" = "yes"; then
1080 KDE_LIB="-lkdecore -lkdeui"
1081 if test "${KDE_DIR}" != ""; then
1082 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
1083 KDE_INCLUDE="-I${KDE_DIR}/include"
1086 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
1087 elif test -n "${KDE_MANDATORY}"; then
1089 AC_MSG_NOTICE([***])
1090 AC_MSG_NOTICE([*** The KDE installation on this system appears to be broken.])
1091 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1092 AC_MSG_NOTICE([*** including --without-kde.])
1098 if test "${PBX_KDE}" = 1; then
1099 AC_PATH_TOOL(KDEINIT, kdeinit, No)
1100 if test ! x"${KDEINIT}" = xNo; then
1101 KDEDIR=$(${DIRNAME} ${KDEINIT})
1102 KDEDIR=$(${DIRNAME} ${KDEDIR})
1109 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
1111 if test "${PBX_MISDN}" = 1; then
1112 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
1113 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
1114 AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
1117 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
1119 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
1122 if test "${USE_NETSNMP}" != "no"; then
1123 if test "x${NETSNMP_DIR}" != "x"; then
1124 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
1125 if test x"${NETSNMP_CONFIG}" = xNo; then
1126 AC_MSG_NOTICE([***])
1127 AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
1128 AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
1129 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1130 AC_MSG_NOTICE([*** including --without-netsnmp])
1134 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
1137 if test x"${NETSNMP_CONFIG}" != xNo; then
1138 NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
1140 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
1141 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
1143 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
1144 NETSNMP_LIB="${NETSNMP_libs}"
1146 elif test -n "${NETSNMP_MANDATORY}";
1148 AC_MSG_NOTICE([***])
1149 AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
1150 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1151 AC_MSG_NOTICE([*** including --without-netsnmp])
1154 elif test -n "${NETSNMP_MANDATORY}";
1156 AC_MSG_NOTICE([***])
1157 AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
1158 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1159 AC_MSG_NOTICE([*** including --without-netsnmp])
1163 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
1165 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [])
1167 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
1169 if test "${USE_OSS}" != "no"; then
1171 AC_CHECK_HEADER([linux/soundcard.h],
1174 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1176 if test "$PBX_OSS" = "0"; then
1177 AC_CHECK_HEADER([sys/soundcard.h],
1180 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
1183 if test "$PBX_OSS" = "0"; then
1184 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
1189 if test "${USE_PGSQL}" != "no"; then
1190 if test "x${PGSQL_DIR}" != "x"; then
1191 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
1192 if test x"${PG_CONFIG}" = xNo; then
1193 AC_MSG_NOTICE([***])
1194 AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
1195 AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
1196 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1197 AC_MSG_NOTICE([*** including --without-postgres])
1201 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
1204 if test "${PG_CONFIG}" != No; then
1205 PGSQL_libdir=`${PG_CONFIG} --libdir`
1206 PGSQL_includedir=`${PG_CONFIG} --includedir`
1208 if test "x$?" != "x0" ; then
1209 if test -n "${PGSQL_MANDATORY}" ; then
1210 AC_MSG_NOTICE([***])
1211 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1212 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1213 AC_MSG_NOTICE([*** including --without-postgres])
1217 AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
1218 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
1220 if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
1221 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
1222 PGSQL_INCLUDE="-I${PGSQL_includedir}"
1224 elif test -n "${PGSQL_MANDATORY}";
1226 AC_MSG_NOTICE([***])
1227 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1228 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1229 AC_MSG_NOTICE([*** including --without-postgres])
1233 elif test -n "${PGSQL_MANDATORY}";
1235 AC_MSG_NOTICE([***])
1236 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
1237 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1238 AC_MSG_NOTICE([*** including --without-postgres])
1242 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
1244 AST_EXT_LIB_CHECK([PRI], [pri], [pri_keypad_facility], [libpri.h])
1246 AST_EXT_LIB_CHECK([PRI_VERSION], [pri], [pri_get_version], [libpri.h])
1248 AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h])
1250 if test "${USE_PWLIB}" != "no"; then
1251 if test -n "${PWLIB_DIR}"; then
1252 PWLIBDIR="${PWLIB_DIR}"
1255 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
1257 if test "${HAS_PWLIB:-unset}" != "unset"; then
1258 AST_CHECK_OPENH323_PLATFORM()
1260 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
1262 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
1263 [Define if your system has the PWLib libraries.],
1264 [#include "ptlib.h"],
1265 [BOOL q = PTime::IsDaylightSavings();])
1269 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a -n "${PWLIB_MANDATORY}"; then
1270 AC_MSG_NOTICE([***])
1271 AC_MSG_NOTICE([*** The PWLIB installation on this system appears to be broken.])
1272 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1273 AC_MSG_NOTICE([*** including --without-pwlib])
1277 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
1278 if test -n "${OPENH323_DIR}"; then
1279 OPENH323DIR="${OPENH323_DIR}"
1281 AST_CHECK_OPENH323()
1282 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
1283 AST_CHECK_OPENH323_BUILD()
1284 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
1285 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
1286 [Define if your system has the OpenH323 libraries.],
1289 #include "h323ep.h"],
1290 [H323EndPoint ep = H323EndPoint();],
1291 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
1293 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a -n "${OPENH323_MANDATORY}"; then
1294 AC_MSG_NOTICE([***])
1295 AC_MSG_NOTICE([*** The OPENH323 installation on this system appears to be broken.])
1296 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1297 AC_MSG_NOTICE([*** including --without-h323])
1301 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
1303 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
1305 # See if the main speex library contains the preprocess functions
1306 AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
1307 if test "${PBX_SPEEX_PREPROCESS}" = 1; then
1308 PBX_SPEEX_PREPROCESS=1
1311 AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
1312 if test "${PBX_SPEEXDSP}" = 1; then
1313 PBX_SPEEX_PREPROCESS=1
1316 AC_SUBST(PBX_SPEEX_PREPROCESS)
1318 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
1320 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
1321 if test "$PBX_OPENSSL" = "1";
1323 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
1326 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
1327 if test "${PBX_FREETDS}" != "0";
1329 if test "${FREETDS_DIR}x" = "x";
1331 for tds_dir in /usr /usr/local;
1333 if test -f "${tds_dir}/include/tdsver.h";
1335 FREETDS_DIR="${tds_dir}"
1339 case `${GREP} TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
1341 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
1344 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
1347 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
1350 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
1355 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
1357 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
1359 if test "${host_os}" != "linux-gnu" ; then
1360 tonezone_extra_lib="-lm"
1363 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
1364 tonezone_dir="dahdi"
1365 if test "x${DAHDI_DIR}" != "x"; then
1366 tonezone_extra_inc="${DAHDI_INCLUDE}"
1369 tonezone_dir="zaptel"
1370 if test "x${ZAPTEL_DIR}" != "x"; then
1371 tonezone_extra_inc="${ZAPTEL_INCLUDE}"
1375 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [${tonezone_dir}/tonezone.h], [${tonezone_extra_lib}], [${tonezone_extra_inc}])
1377 AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h], [])
1379 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
1383 if test "${USE_VPB}" != "no"; then
1384 AC_MSG_CHECKING(for vpb_open in -lvpb)
1385 saved_libs="${LIBS}"
1386 saved_cppflags="${CPPFLAGS}"
1387 if test "x${VPB_DIR}" != "x"; then
1388 if test -d ${VPB_DIR}/lib; then
1389 vpblibdir=${VPB_DIR}/lib
1391 vpblibdir=${VPB_DIR}
1393 LIBS="${LIBS} -L${vpblibdir}"
1394 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
1396 LIBS="${LIBS} -lvpb -lpthread"
1400 [#include <vpbapi.h>],
1401 [int q = vpb_open(0,0);])
1403 [ AC_MSG_RESULT(yes)
1404 ac_cv_lib_vpb_vpb_open="yes"
1407 ac_cv_lib_vpb_vpb_open="no"
1410 LIBS="${saved_libs}"
1411 CPPFLAGS="${saved_cppflags}"
1412 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
1414 if test "${VPB_DIR}" != ""; then
1415 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
1416 VPB_INCLUDE="-I${VPB_DIR}/include"
1419 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
1420 elif test -n "${VPB_MANDATORY}"; then
1421 AC_MSG_NOTICE([***])
1422 AC_MSG_NOTICE([*** The VoiceTronix (vpb) installation on this system appears to be broken.])
1423 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1424 AC_MSG_NOTICE([*** including --without-vpb.])
1431 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
1433 if test "${USE_ZAPTEL}" != "no" && test "x${PBX_DAHDI}" != "x1"; then
1434 AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
1435 saved_cppflags="${CPPFLAGS}"
1436 if test "x${ZAPTEL_DIR}" != "x"; then
1437 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1442 [#include <zaptel/zaptel.h>],
1443 [int foo = ZT_DIAL_OP_CANCEL;])
1445 [ AC_MSG_RESULT(yes)
1446 ac_cv_zaptel_h="yes"
1452 CPPFLAGS="${saved_cppflags}"
1453 if test "${ac_cv_zaptel_h}" = "yes"; then
1454 if test "${ZAPTEL_DIR}" != ""; then
1455 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
1458 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
1459 elif test -n "${ZAPTEL_MANDATORY}";
1461 AC_MSG_NOTICE([***])
1462 AC_MSG_NOTICE([*** The Zaptel installation on this system appears to be broken.])
1463 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1464 AC_MSG_NOTICE([*** including --without-zaptel.])
1469 if test "${PBX_ZAPTEL}" = 1 && test "x${PBX_DAHDI}" != "x1"; then
1470 AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
1471 saved_cppflags="${CPPFLAGS}"
1472 if test "x${ZAPTEL_DIR}" != "x"; then
1473 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1478 [#include <zaptel/zaptel.h>],
1479 [int foo = ZT_EVENT_REMOVED;])
1481 [ AC_MSG_RESULT(yes)
1482 ac_cv_zaptel_vldtmf="yes"
1485 ac_cv_zaptel_vldtmf="no"
1488 CPPFLAGS="${saved_cppflags}"
1489 if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
1492 AC_MSG_CHECKING(for ZT_TCOP_ALLOCATE in zaptel/zaptel.h)
1493 saved_cppflags="${CPPFLAGS}"
1494 if test "x${ZAPTEL_DIR}" != "x"; then
1495 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1500 [#include <zaptel/zaptel.h>],
1501 [int foo = ZT_TCOP_ALLOCATE;])
1503 [ AC_MSG_RESULT(yes)
1504 ac_cv_zaptel_transcode="yes"
1507 ac_cv_zaptel_transcode="no"
1510 CPPFLAGS="${saved_cppflags}"
1511 if test "${ac_cv_zaptel_transcode}" = "yes"; then
1512 PBX_ZAPTEL_TRANSCODE=1
1515 AC_SUBST(PBX_ZAPTEL_VLDTMF)
1516 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
1518 if test "x${PBX_ZAPTEL}" = "x1" ; then
1524 if test "x$TERMCAP_LIB" != "x" ; then
1525 EDITLINE_LIB="$TERMCAP_LIB"
1526 elif test "x$TINFO_LIB" != "x" ; then
1527 EDITLINE_LIB="$TINFO_LIB"
1528 elif test "x$CURSES_LIB" != "x" ; then
1529 EDITLINE_LIB="$CURSES_LIB"
1530 elif test "x$NCURSES_LIB" != "x" ; then
1531 EDITLINE_LIB="$NCURSES_LIB"
1533 AC_MSG_ERROR(*** termcap support not found)
1535 AC_SUBST(EDITLINE_LIB)
1537 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1540 AC_CHECK_HEADER([linux/compiler.h],
1541 [AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
1543 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1544 #include <linux/version.h>
1545 #ifdef HAVE_LINUX_COMPILER_H
1546 #include <linux/compiler.h>
1549 AC_SUBST(PBX_IXJUSER)
1551 if test "${cross_compiling}" = "no";
1553 AC_CHECK_FILE(/sbin/launchd, AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
1557 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1558 if test ! "x${GTKCONFIG}" = xNo; then
1559 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1560 GTK_LIB=$(${GTKCONFIG} --libs gthread)
1562 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1565 AC_SUBST(GTK_INCLUDE)
1569 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
1570 if test ! "x${PKGCONFIG}" = xNo; then
1571 GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
1572 GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
1574 AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
1577 AC_SUBST(GTK2_INCLUDE)
1580 if test "${USE_CURL}" != "no"; then
1581 AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
1582 if test ! x"${CURL_CONFIG}" = xNo; then
1584 if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
1585 CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
1586 CURL_LIB=$(${CURL_CONFIG} --libs)
1588 AC_MSG_CHECKING(for curl_version() in curl/curl.h)
1589 saved_cppflags="${CPPFLAGS}"
1590 CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}"
1593 [#include <curl/curl.h>],
1603 CPPFLAGS="${saved_cppflags}"
1604 if test "${ac_cv_curl_h}" = "yes"; then
1606 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1612 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1615 if test "x${silent}" != "xyes" ; then
1617 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1618 echo " .\$7\$7.. .7\$\$7:. "
1619 echo " .\$\$:. ,\$7.7 "
1620 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1621 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1622 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1623 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1624 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1625 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1626 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1627 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1628 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1629 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1630 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1631 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1632 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1633 echo " \$\$\$\$\$ \$\$\$ "
1634 echo " \$\$\$\$7. \$\$ (TM) "
1635 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1636 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1637 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1641 AC_MSG_NOTICE(Package configured for: )
1642 AC_MSG_NOTICE( OS type : $host_os)
1643 AC_MSG_NOTICE( Host CPU : $host_cpu)
1644 if test "${cross_compiling}" = "yes"; then
1645 AC_MSG_NOTICE( Cross Compilation = YES)