1 # Process this file with autoconf to produce a configure script.
5 m4_define([PBX_VERSION],
6 m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
7 [\([0-9.]*\)\(\w\|\W\)*],
9 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
11 # cross-compile macros
15 # check existence of the package
16 AC_CONFIG_SRCDIR([main/asterisk.c])
18 # specify output header file
19 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
21 AC_COPYRIGHT("Asterisk")
22 AC_REVISION($Revision$)
25 AC_USE_SYSTEM_EXTENSIONS
29 ac_default_prefix=/usr/local
30 CPPFLAGS=-I/usr/local/include
31 LDFLAGS=-L/usr/local/lib
34 ac_default_prefix=/usr
35 if test ${sysconfdir} = '${prefix}/etc'; then
38 if test ${mandir} = '${prefix}/man'; then
44 if test ${localstatedir} = '${prefix}/var'; then
48 BUILD_PLATFORM=${build}
49 BUILD_CPU=${build_cpu}
50 BUILD_VENDOR=${build_vendor}
53 AC_SUBST(BUILD_PLATFORM)
55 AC_SUBST(BUILD_VENDOR)
60 HOST_VENDOR=${host_vendor}
63 AC_SUBST(HOST_PLATFORM)
89 AC_PATH_TOOL([UNAME], [uname], No)
90 if test ! x"${UNAME}" = xNo; then
91 PBX_OSREV=$(${UNAME} -r)
96 #ifndef ASTERISK_AUTOCONFIG_H
97 #define ASTERISK_AUTOCONFIG_H
99 #include "asterisk/buildopts.h"
110 # cross-compile checks
111 if test "${cross_compiling}" = "yes";
113 AC_CHECK_TOOL(CC, gcc, :)
114 AC_CHECK_TOOL(CXX, g++, :)
115 AC_CHECK_TOOL(LD, ld, :)
116 AC_CHECK_TOOL(RANLIB, ranlib, :)
117 AC_CHECK_TOOL(AR, ar, :)
120 # Checks for programs.
125 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
126 # the developers regenerating the configure script don't have to install libtool.
135 if test "x$with_gnu_ld" = "xyes" ; then
140 AC_PATH_PROG([GREP], [grep], :)
141 AC_PATH_PROG([AR], [ar], :)
142 AC_PATH_PROG([FIND], [find], :)
143 AC_PATH_PROG([COMPRESS], [compress], :)
144 AC_PATH_PROG([BASENAME], [basename], :)
145 AC_PATH_PROG([ID], [id], :)
146 AC_PATH_PROG([DIRNAME], [dirname], :)
147 AC_PATH_PROG([SHELL], [sh], :)
148 AC_PATH_PROG([LN], [ln], :)
149 AC_PATH_PROG([DOT], [dot], :)
150 AC_PATH_PROG([STRIP], [strip], :)
151 AC_PATH_PROG([WGET], [wget], :)
152 if test "${WGET}" != ":" ; then
155 AC_PATH_PROG([FETCH], [fetch], [:])
162 AC_ARG_ENABLE(dev-mode,
163 [ --enable-dev-mode Turn on developer mode],
164 [case "${enableval}" in
165 y|ye|yes) AST_DEVMODE=yes ;;
166 n|no) AST_DEVMODE=no ;;
167 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
169 AC_SUBST(AST_DEVMODE)
171 # package option names should be in alphabetical order
172 # by the --with option name, to make things easier for the users :-)
174 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
175 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
176 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
177 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
178 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
179 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
180 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
181 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
182 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
183 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
184 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
185 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
186 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
187 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
188 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
189 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
190 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
191 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
192 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
193 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
194 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
195 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
196 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
197 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
198 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
199 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
200 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
201 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
202 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
203 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
204 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
205 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
206 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
207 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
208 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
209 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
210 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
212 # check for basic system features and functionality before
213 # checking for package libraries
219 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])
223 # Checks for typedefs, structures, and compiler characteristics.
232 AC_CHECK_MEMBERS([struct stat.st_blksize])
236 AC_CHECK_TYPES([ptrdiff_t])
238 # Checks for library functions.
240 AC_FUNC_CLOSEDIR_VOID
241 AC_FUNC_ERROR_AT_LINE
244 AC_PROG_GCC_TRADITIONAL
245 # XXX: these are commented out until we determine whether it matters if our malloc()
246 # acts exactly like glibc's or not
252 AC_FUNC_SELECT_ARGTYPES
253 AC_FUNC_SETVBUF_REVERSED
262 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 strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
264 AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
266 AC_LANG_PROGRAM([#include <pthread.h>],
267 [int foo = PTHREAD_RWLOCK_INITIALIZER;]),
269 AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
273 AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
275 AC_LANG_PROGRAM([#include <pthread.h>],
276 [int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
278 AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
282 AC_MSG_CHECKING(for compiler atomic operations)
284 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
286 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
290 AST_GCC_ATTRIBUTE(pure)
291 AST_GCC_ATTRIBUTE(malloc)
292 AST_GCC_ATTRIBUTE(const)
293 AST_GCC_ATTRIBUTE(unused)
294 AST_GCC_ATTRIBUTE(always_inline)
296 AC_MSG_CHECKING(for -ffunction-sections support)
297 saved_CFLAGS="${CFLAGS}"
298 CFLAGS="${CFLAGS} -ffunction-sections"
300 AC_LANG_PROGRAM([], [int x = 1;]),
302 [saved_LDFLAGS="${LDFLAGS}"]
303 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
304 AC_MSG_CHECKING(for --gc-sections support)
306 AC_LANG_PROGRAM([], [int x = 1;]),
308 [GC_CFLAGS="-ffunction-sections"]
309 [[GC_LDFLAGS="-Wl,--gc-sections"]],
312 [LDFLAGS="${saved_LDFLAGS}"],
315 CFLAGS="${saved_CFLAGS}"
319 AC_MSG_CHECKING(for res_ninit)
321 AC_LANG_PROGRAM([#include <resolv.h>],
322 [int foo = res_ninit(NULL);]),
324 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
328 AC_MSG_CHECKING(for RTLD_NOLOAD)
330 AC_LANG_PROGRAM([#include <dlfcn.h>],
331 [int foo = RTLD_NOLOAD;]),
333 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
337 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
339 AC_LANG_PROGRAM([#include <netinet/in.h>],
340 [int foo = IP_MTU_DISCOVER;]),
342 AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
346 AC_CHECK_HEADER([libkern/OSAtomic.h],
347 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
351 # do the package library checks now
353 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
355 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
358 AC_SUBST(GSM_INTERNAL)
360 if test "${USE_GSM}" != "no"; then
361 if test "${GSM_DIR}" = "internal"; then
363 elif test "${GSM_DIR}" != ""; then
366 if test "${GSM_SYSTEM}" = "yes"; then
368 if test "x${GSM_DIR}" != "x"; then
369 if test -d ${GSM_DIR}/lib; then
370 gsmlibdir="-L${GSM_DIR}/lib"
372 gsmlibdir="-L${GSM_DIR}"
375 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
376 [Define to indicate the GSM library]), [], ${gsmlibdir})
377 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
379 if test "x${GSM_DIR}" != "x"; then
380 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
381 GSM_INCLUDE="-I${GSM_DIR}/include"
387 if test "${GSM_INTERNAL}" = "yes"; then
392 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
394 if test "${PBX_IKSEMEL}" = 1; then
395 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
396 if test "${PBX_GNUTLS}" = 1; then
397 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
401 if test "${USE_IMAP_TK}" != "no"; then
402 if test "${IMAP_TK_DIR}" = ""; then
403 IMAP_TK_DIR=`pwd`"/../imap-2004g"
405 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
406 saved_cppflags="${CPPFLAGS}"
408 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
409 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
411 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
412 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
415 [#include "c-client.h"
416 void mm_searched (MAILSTREAM *stream,unsigned long number)
419 void mm_exists (MAILSTREAM *stream,unsigned long number)
422 void mm_expunged (MAILSTREAM *stream,unsigned long number)
425 void mm_flags (MAILSTREAM *stream,unsigned long number)
428 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
431 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
434 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
437 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
440 void mm_log (char *string,long errflg)
443 void mm_dlog (char *string)
446 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
449 void mm_critical (MAILSTREAM *stream)
452 void mm_nocritical (MAILSTREAM *stream)
455 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
458 void mm_fatal (char *string)
462 MAILSTREAM *foo = mail_open(NULL, "", 0);
465 [ac_cv_imap_tk="yes"],
468 if test "${ac_cv_imap_tk}" = "yes"; then
471 [#include "c-client.h"
472 void mm_searched (MAILSTREAM *stream,unsigned long number)
475 void mm_exists (MAILSTREAM *stream,unsigned long number)
478 void mm_expunged (MAILSTREAM *stream,unsigned long number)
481 void mm_flags (MAILSTREAM *stream,unsigned long number)
484 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
487 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
490 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
493 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
496 void mm_log (char *string,long errflg)
499 void mm_dlog (char *string)
502 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
505 void mm_critical (MAILSTREAM *stream)
508 void mm_nocritical (MAILSTREAM *stream)
511 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
514 void mm_fatal (char *string)
518 long check = mail_expunge_full(NULL, "", 0);
521 [ac_cv_imap_tk2006="yes"],
522 [ac_cv_imap_tk2006="no"]
525 CPPFLAGS="${saved_cppflags}"
527 if test "${ac_cv_imap_tk}" = "yes"; then
529 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
530 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
532 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
533 if test "${ac_cv_imap_tk2006}" = "yes"; then
534 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
536 elif test ! -z "${IMAP_TK_MANDATORY}"; then
539 AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
540 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
541 AC_MSG_NOTICE([*** including --without-imap.])
550 if test "${USE_KDE}" != "no"; then
551 AC_MSG_CHECKING(for crashHandler in -lkdecore)
553 saved_cppflags="${CPPFLAGS}"
554 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
555 if test -d ${KDE_DIR}/lib; then
556 kdelibdir="${KDE_DIR}/lib"
558 kdelibdir="${KDE_DIR}"
560 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
564 [#include "kcrash.h"],
565 [KCrash::defaultCrashHandler(1);])
567 [ac_cv_lib_kde_crash="yes"],
568 [ac_cv_lib_kde_crash="no"])
571 CPPFLAGS="${saved_cppflags}"
573 if test "${ac_cv_lib_kde_crash}" = "yes"; then
575 KDE_LIB="-lkdecore -lkdeui"
576 if test "${KDE_DIR}" != ""; then
577 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
578 KDE_INCLUDE="-I${KDE_DIR}/include"
581 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
582 elif test ! -z "${KDE_MANDATORY}"; then
585 AC_MSG_NOTICE([*** The KDE installation on this system appears to be broken.])
586 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
587 AC_MSG_NOTICE([*** including --without-kde.])
593 if test "${PBX_KDE}" = 1; then
594 AC_PATH_TOOL(KDEINIT, kdeinit, No)
595 if test ! x"${KDEINIT}" = xNo; then
596 KDEDIR=$(${DIRNAME} ${KDEINIT})
597 KDEDIR=$(${DIRNAME} ${KDEDIR})
604 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
606 if test "${PBX_MISDN}" = 1; then
607 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
608 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
611 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
613 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
616 if test "${USE_NETSNMP}" != "no"; then
617 if test "x${NETSNMP_DIR}" != "x"; then
618 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
619 if test x"${NETSNMP_CONFIG}" = xNo; then
621 AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
622 AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
623 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
624 AC_MSG_NOTICE([*** including --without-netsnmp])
628 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
631 if test x"${NETSNMP_CONFIG}" != xNo; then
632 NETSNMP_libs=`net-snmp-config --agent-libs`
634 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
635 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
637 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
638 NETSNMP_LIB="${NETSNMP_libs}"
640 elif test ! -z "${NETSNMP_MANDATORY}";
643 AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
644 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
645 AC_MSG_NOTICE([*** including --without-netsnmp])
648 elif test ! -z "${NETSNMP_MANDATORY}";
651 AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
652 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
653 AC_MSG_NOTICE([*** including --without-netsnmp])
657 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
659 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
661 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
663 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
666 AC_CHECK_HEADER([linux/soundcard.h],
669 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
671 if test "$PBX_OSS" = "0"; then
672 AC_CHECK_HEADER([sys/soundcard.h],
675 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
678 if test "$PBX_OSS" = "0"; then
679 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
683 if test "${USE_PGSQL}" != "no"; then
684 if test "x${PGSQL_DIR}" != "x"; then
685 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
686 if test x"${PG_CONFIG}" = xNo; then
688 AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
689 AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
690 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
691 AC_MSG_NOTICE([*** including --without-postgres])
695 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
698 if test "${PG_CONFIG}" != No; then
699 PGSQL_libdir=`pg_config --libdir`
700 PGSQL_includedir=`pg_config --includedir`
702 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
703 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
705 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
706 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
707 PGSQL_INCLUDE="-I${PGSQL_includedir}"
709 elif test ! -z "${PGSQL_MANDATORY}";
712 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
713 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
714 AC_MSG_NOTICE([*** including --without-postgres])
717 elif test ! -z "${PGSQL_MANDATORY}";
720 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
721 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
722 AC_MSG_NOTICE([*** including --without-postgres])
726 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
728 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
730 if test "${USE_PWLIB}" != "no"; then
731 if test ! -z "${PWLIB_DIR}"; then
732 PWLIBDIR="${PWLIB_DIR}"
735 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
737 if test "${HAS_PWLIB:-unset}" != "unset"; then
738 AST_CHECK_OPENH323_PLATFORM()
740 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
742 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
743 [Define if your system has the PWLib libraries.],
744 [#include "ptlib.h"],
745 [BOOL q = PTime::IsDaylightSavings();])
749 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a ! -z "${PWLIB_MANDATORY}"; then
751 AC_MSG_NOTICE([*** The PWLIB installation on this system appears to be broken.])
752 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
753 AC_MSG_NOTICE([*** including --without-pwlib])
757 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
758 if test ! -z "${OPENH323_DIR}"; then
759 OPENH323DIR="${OPENH323_DIR}"
762 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
763 AST_CHECK_OPENH323_BUILD()
764 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
765 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
766 [Define if your system has the OpenH323 libraries.],
769 #include "h323ep.h"],
770 [H323EndPoint ep = H323EndPoint();],
771 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
773 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a ! -z "${OPENH323_MANDATORY}"; then
775 AC_MSG_NOTICE([*** The OPENH323 installation on this system appears to be broken.])
776 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
777 AC_MSG_NOTICE([*** including --without-h323])
784 if test "${USE_QT}" != "no"; then
785 AC_MSG_CHECKING(for QDate in -lqt)
787 saved_cppflags="${CPPFLAGS}"
788 if test "x${QT_DIR}" != "x"; then
789 LIBS="${LIBS} -L${QT_DIR}/lib"
790 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
797 [#include <qt3/qdatetime.h>],
800 [ac_cv_lib_qt_qt_date="yes"],
801 [ac_cv_lib_qt_qt_date="no"])
803 CPPFLAGS="${saved_cppflags}"
805 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
807 saved_cppflags="${CPPFLAGS}"
808 if test "x${QT_DIR}" != "x"; then
809 LIBS="${LIBS} -L${QT_DIR}/lib"
810 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
812 LIBS="${LIBS} -lqt-mt"
817 [#include <qt3/qdatetime.h>],
820 [ac_cv_lib_qt_qt_date="yes"],
821 [ac_cv_lib_qt_qt_date="no"])
823 CPPFLAGS="${saved_cppflags}"
826 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
832 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
834 if test "${QT_DIR}" != ""; then
835 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
836 QT_INCLUDE="-I${QT_DIR}/include"
839 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
840 AC_PATH_TOOL(QTMOC, moc, No)
841 elif test ! -z "${QT_MANDATORY}";
844 AC_MSG_NOTICE([*** The Qt installation on this system appears to be broken.])
845 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
846 AC_MSG_NOTICE([*** including --without-qt.])
853 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
855 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
857 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
859 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
861 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
862 if test "${PBX_FREETDS}" != "0";
864 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
866 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
869 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
872 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
875 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
880 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
882 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
884 if test "${host_os}" != "linux-gnu" ; then
888 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
890 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
894 if test "${USE_VPB}" != "no"; then
895 AC_MSG_CHECKING(for vpb_open in -lvpb)
897 saved_cppflags="${CPPFLAGS}"
898 if test "x${VPB_DIR}" != "x"; then
899 if test -d ${VPB_DIR}/lib; then
900 vpblibdir=${VPB_DIR}/lib
904 LIBS="${LIBS} -L${vpblibdir}"
905 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
907 LIBS="${LIBS} -lvpb -lpthread"
911 [#include <vpbapi.h>],
912 [int q = vpb_open(0,0);])
915 ac_cv_lib_vpb_vpb_open="yes"
918 ac_cv_lib_vpb_vpb_open="no"
922 CPPFLAGS="${saved_cppflags}"
923 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
925 if test "${VPB_DIR}" != ""; then
926 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
927 VPB_INCLUDE="-I${VPB_DIR}/include"
930 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
931 elif test ! -z "${VPB_MANDATORY}"; then
933 AC_MSG_NOTICE([*** The VoiceTronix (vpb) installation on this system appears to be broken.])
934 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
935 AC_MSG_NOTICE([*** including --without-vpb.])
942 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
944 if test "${USE_ZAPTEL}" != "no"; then
945 AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
946 saved_cppflags="${CPPFLAGS}"
947 if test "x${ZAPTEL_DIR}" != "x"; then
948 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
953 [#include <zaptel/zaptel.h>],
954 [int foo = ZT_DIAL_OP_CANCEL;])
963 CPPFLAGS="${saved_cppflags}"
964 if test "${ac_cv_zaptel_h}" = "yes"; then
965 if test "${ZAPTEL_DIR}" != ""; then
966 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
969 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
970 elif test ! -z "${ZAPTEL_MANDATORY}";
973 AC_MSG_NOTICE([*** The Zaptel installation on this system appears to be broken.])
974 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
975 AC_MSG_NOTICE([*** including --without-zaptel.])
980 if test "${PBX_ZAPTEL}" = 1; then
981 AC_MSG_CHECKING(for ZT_TONE_DTMF_BASE in zaptel/zaptel.h)
982 saved_cppflags="${CPPFLAGS}"
983 if test "x${ZAPTEL_DIR}" != "x"; then
984 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
989 [#include <zaptel/zaptel.h>],
990 [int foo = ZT_TONE_DTMF_BASE;])
993 ac_cv_zaptel_vldtmf="yes"
996 ac_cv_zaptel_vldtmf="no"
999 CPPFLAGS="${saved_cppflags}"
1000 if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
1003 AC_MSG_CHECKING(for ZT_TCOP_TRANSCODE in zaptel/zaptel.h)
1004 saved_cppflags="${CPPFLAGS}"
1005 if test "x${ZAPTEL_DIR}" != "x"; then
1006 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1011 [#include <zaptel/zaptel.h>],
1012 [int foo = ZT_TCOP_TRANSCODE;])
1014 [ AC_MSG_RESULT(yes)
1015 ac_cv_zaptel_transcode="yes"
1018 ac_cv_zaptel_transcode="no"
1021 CPPFLAGS="${saved_cppflags}"
1022 if test "${ac_cv_zaptel_transcode}" = "yes"; then
1023 PBX_ZAPTEL_TRANSCODE=1
1026 AC_SUBST(PBX_ZAPTEL_VLDTMF)
1027 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
1030 if test "x$TERMCAP_LIB" != "x" ; then
1031 EDITLINE_LIB="$TERMCAP_LIB"
1032 elif test "x$TINFO_LIB" != "x" ; then
1033 EDITLINE_LIB="$TINFO_LIB"
1034 elif test "x$CURSES_LIB" != "x" ; then
1035 EDITLINE_LIB="$CURSES_LIB"
1036 elif test "x$NCURSES_LIB" != "x" ; then
1037 EDITLINE_LIB="$NCURSES_LIB"
1039 AC_MSG_ERROR(*** termcap support not found)
1041 AC_SUBST(EDITLINE_LIB)
1043 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1046 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1047 #include <linux/version.h>
1048 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1049 #include <linux/compiler.h>
1052 AC_SUBST(PBX_IXJUSER)
1055 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1056 if test ! "x${GTKCONFIG}" = xNo; then
1057 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1058 GTK_LIB=$(${GTKCONFIG} --libs gthread)
1060 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1063 AC_SUBST(GTK_INCLUDE)
1066 if test "${USE_CURL}" != "no"; then
1067 AC_PATH_TOOL([CURL], [curl-config], No)
1068 if test ! x"${CURL}" = xNo; then
1070 if test $(printf "%d" 0x$(curl-config --vernum)) -ge $(printf "%d" 0x070907); then
1071 CURL_INCLUDE=$(${CURL} --cflags)
1072 CURL_LIB=$(${CURL} --libs)
1074 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1079 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1082 if test "x${silent}" != "xyes" ; then
1084 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1085 echo " .\$7\$7.. .7\$\$7:. "
1086 echo " .\$\$:. ,\$7.7 "
1087 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1088 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1089 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1090 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1091 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1092 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1093 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1094 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1095 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1096 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1097 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1098 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1099 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1100 echo " \$\$\$\$\$ \$\$\$ "
1101 echo " \$\$\$\$7. \$\$ (TM) "
1102 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1103 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1104 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1108 AC_MSG_NOTICE(Package configured for: )
1109 AC_MSG_NOTICE( OS type : $host_os)
1110 AC_MSG_NOTICE( Host CPU : $host_cpu)
1111 if test "${cross_compiling}" = "yes"; then
1112 AC_MSG_NOTICE( Cross Compilation = YES)