2 # Process this file with autoconf to produce a configure script.
6 m4_define([PBX_VERSION],
7 m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
8 [\([0-9.]*\)\(\w\|\W\)*],
10 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
12 # cross-compile macros
16 # check existence of the package
17 AC_CONFIG_SRCDIR([main/asterisk.c])
19 # specify output header file
20 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
22 AC_COPYRIGHT("Asterisk")
23 AC_REVISION($Revision$)
27 ac_default_prefix=/usr/local
28 CPPFLAGS=-I/usr/local/include
29 LDFLAGS=-L/usr/local/lib
32 ac_default_prefix=/usr
33 if test ${sysconfdir} = '${prefix}/etc'; then
36 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)
93 # This needs to be before any macros that use the C compiler
97 #ifndef ASTERISK_AUTOCONFIG_H
98 #define ASTERISK_AUTOCONFIG_H
100 #include "asterisk/buildopts.h"
111 # cross-compile checks
112 if test "${cross_compiling}" = "yes";
114 AC_CHECK_TOOL(CC, gcc, :)
115 AC_CHECK_TOOL(CXX, g++, :)
116 AC_CHECK_TOOL(LD, ld, :)
117 AC_CHECK_TOOL(RANLIB, ranlib, :)
118 AC_CHECK_TOOL(AR, ar, :)
121 # Checks for programs.
126 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
127 # the developers regenerating the configure script don't have to install libtool.
136 if test "x$with_gnu_ld" = "xyes" ; then
141 AC_PATH_PROG([GREP], [grep], :)
142 AC_PATH_PROG([AR], [ar], :)
143 AC_PATH_PROG([FIND], [find], :)
144 AC_PATH_PROG([COMPRESS], [compress], :)
145 AC_PATH_PROG([BASENAME], [basename], :)
146 AC_PATH_PROG([ID], [id], :)
147 AC_PATH_PROG([DIRNAME], [dirname], :)
148 AC_PATH_PROG([SHELL], [sh], :)
149 AC_PATH_PROG([LN], [ln], :)
150 AC_PATH_PROG([DOT], [dot], :)
151 AC_PATH_PROG([STRIP], [strip], :)
155 AC_ARG_ENABLE(dev-mode,
156 [ --enable-dev-mode Turn on developer mode],
157 [case "${enableval}" in
158 y|ye|yes) AST_DEVMODE=yes ;;
159 n|no) AST_DEVMODE=no ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
162 AC_SUBST(AST_DEVMODE)
164 # package option names should be in alphabetical order
165 # by the --with option name, to make things easier for the users :-)
167 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
168 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
169 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
170 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
171 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
172 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
173 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
174 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
175 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
176 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
177 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
178 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
179 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
180 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
181 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
182 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
183 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
184 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
185 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
186 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
187 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
188 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
189 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
190 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
191 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
192 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
193 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
194 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
195 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
196 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
197 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
198 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
199 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
200 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
201 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
202 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
203 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
205 # check for basic system features and functionality before
206 # checking for package libraries
212 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])
216 # Checks for typedefs, structures, and compiler characteristics.
225 AC_CHECK_MEMBERS([struct stat.st_blksize])
229 AC_CHECK_TYPES([ptrdiff_t])
231 # Checks for library functions.
233 AC_FUNC_CLOSEDIR_VOID
234 AC_FUNC_ERROR_AT_LINE
237 AC_PROG_GCC_TRADITIONAL
238 # XXX: these are commented out until we determine whether it matters if our malloc()
239 # acts exactly like glibc's or not
245 AC_FUNC_SELECT_ARGTYPES
246 AC_FUNC_SETVBUF_REVERSED
255 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])
257 AC_MSG_CHECKING(for compiler atomic operations)
259 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
261 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
265 AST_GCC_ATTRIBUTE(pure)
266 AST_GCC_ATTRIBUTE(malloc)
267 AST_GCC_ATTRIBUTE(const)
268 AST_GCC_ATTRIBUTE(unused)
269 AST_GCC_ATTRIBUTE(always_inline)
271 AC_MSG_CHECKING(for -ffunction-sections support)
272 saved_CFLAGS="${CFLAGS}"
273 CFLAGS="${CFLAGS} -ffunction-sections"
275 AC_LANG_PROGRAM([], [int x = 1;]),
277 [saved_LDFLAGS="${LDFLAGS}"]
278 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
279 AC_MSG_CHECKING(for --gc-sections support)
281 AC_LANG_PROGRAM([], [int x = 1;]),
283 [GC_CFLAGS="-ffunction-sections"]
284 [[GC_LDFLAGS="-Wl,--gc-sections"]],
287 [LDFLAGS="${saved_LDFLAGS}"],
290 CFLAGS="${saved_CFLAGS}"
294 AC_MSG_CHECKING(for res_ninit)
296 AC_LANG_PROGRAM([#include <resolv.h>],
297 [int foo = res_ninit(NULL);]),
299 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
303 AC_MSG_CHECKING(for RTLD_NOLOAD)
305 AC_LANG_PROGRAM([#include <dlfcn.h>],
306 [int foo = RTLD_NOLOAD;]),
308 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
312 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
314 AC_LANG_PROGRAM([#include <netinet/in.h>],
315 [int foo = IP_MTU_DISCOVER;]),
317 AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
321 AC_CHECK_HEADER([libkern/OSAtomic.h],
322 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
326 # do the package library checks now
328 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
330 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
333 AC_SUBST(GSM_INTERNAL)
335 if test "${USE_GSM}" != "no"; then
336 if test "${GSM_DIR}" = "internal"; then
338 elif test "${GSM_DIR}" != ""; then
341 if test "${GSM_SYSTEM}" = "yes"; then
343 if test "x${GSM_DIR}" != "x"; then
344 if test -d ${GSM_DIR}/lib; then
345 gsmlibdir="-L${GSM_DIR}/lib"
347 gsmlibdir="-L${GSM_DIR}"
350 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
351 [Define to indicate the GSM library]), [], ${gsmlibdir})
352 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
354 if test "x${GSM_DIR}" != "x"; then
355 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
356 GSM_INCLUDE="-I${GSM_DIR}/include"
362 if test "${GSM_INTERNAL}" = "yes"; then
367 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
369 if test "${PBX_IKSEMEL}" = 1; then
370 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
371 if test "${PBX_GNUTLS}" = 1; then
372 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
376 if test "${USE_IMAP_TK}" != "no"; then
377 if test "${IMAP_TK_DIR}" = ""; then
378 IMAP_TK_DIR=`pwd`"/../imap-2004g"
380 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
381 saved_cppflags="${CPPFLAGS}"
383 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
384 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
386 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
387 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
390 [#include "c-client.h"
391 void mm_searched (MAILSTREAM *stream,unsigned long number)
394 void mm_exists (MAILSTREAM *stream,unsigned long number)
397 void mm_expunged (MAILSTREAM *stream,unsigned long number)
400 void mm_flags (MAILSTREAM *stream,unsigned long number)
403 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
406 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
409 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
412 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
415 void mm_log (char *string,long errflg)
418 void mm_dlog (char *string)
421 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
424 void mm_critical (MAILSTREAM *stream)
427 void mm_nocritical (MAILSTREAM *stream)
430 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
433 void mm_fatal (char *string)
437 MAILSTREAM *foo = mail_open(NULL, "", 0);
440 [ac_cv_imap_tk="yes"],
443 if test "${ac_cv_imap_tk}" = "yes"; then
446 [#include "c-client.h"
447 void mm_searched (MAILSTREAM *stream,unsigned long number)
450 void mm_exists (MAILSTREAM *stream,unsigned long number)
453 void mm_expunged (MAILSTREAM *stream,unsigned long number)
456 void mm_flags (MAILSTREAM *stream,unsigned long number)
459 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
462 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
465 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
468 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
471 void mm_log (char *string,long errflg)
474 void mm_dlog (char *string)
477 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
480 void mm_critical (MAILSTREAM *stream)
483 void mm_nocritical (MAILSTREAM *stream)
486 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
489 void mm_fatal (char *string)
493 long check = mail_expunge_full(NULL, "", 0);
496 [ac_cv_imap_tk2006="yes"],
497 [ac_cv_imap_tk2006="no"]
500 CPPFLAGS="${saved_cppflags}"
502 if test "${ac_cv_imap_tk}" = "yes"; then
504 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
505 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
507 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
508 if test "${ac_cv_imap_tk2006}" = "yes"; then
509 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
511 elif test ! -z "${IMAP_TK_MANDATORY}"; then
514 AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
515 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
516 AC_MSG_NOTICE(*** including --without-imap.)
525 if test "${USE_KDE}" != "no"; then
526 AC_MSG_CHECKING(for crashHandler in -lkdecore)
528 saved_cppflags="${CPPFLAGS}"
529 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
530 if test -d ${KDE_DIR}/lib; then
531 kdelibdir="${KDE_DIR}/lib"
533 kdelibdir="${KDE_DIR}"
535 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
539 [#include "kcrash.h"],
540 [KCrash::defaultCrashHandler(1);])
542 [ac_cv_lib_kde_crash="yes"],
543 [ac_cv_lib_kde_crash="no"])
546 CPPFLAGS="${saved_cppflags}"
548 if test "${ac_cv_lib_kde_crash}" = "yes"; then
550 KDE_LIB="-lkdecore -lkdeui"
551 if test "${KDE_DIR}" != ""; then
552 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
553 KDE_INCLUDE="-I${KDE_DIR}/include"
556 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
557 elif test ! -z "${KDE_MANDATORY}"; then
560 AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
561 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
562 AC_MSG_NOTICE(*** including --without-kde.)
568 if test "${PBX_KDE}" = 1; then
569 AC_PATH_TOOL(KDEINIT, kdeinit, No)
570 if test ! x"${KDEINIT}" = xNo; then
571 KDEDIR=$(${DIRNAME} ${KDEINIT})
572 KDEDIR=$(${DIRNAME} ${KDEDIR})
579 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
581 if test "${PBX_MISDN}" = 1; then
582 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
583 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
586 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
588 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
591 if test "${USE_NETSNMP}" != "no"; then
592 if test "x${NETSNMP_DIR}" != "x"; then
593 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
594 if test x"${NETSNMP_CONFIG}" = xNo; then
596 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
597 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
598 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
599 AC_MSG_NOTICE(*** including --without-netsnmp)
603 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
606 if test x"${NETSNMP_CONFIG}" != xNo; then
607 NETSNMP_libs=`net-snmp-config --agent-libs`
609 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
610 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
612 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
613 NETSNMP_LIB="${NETSNMP_libs}"
615 elif test ! -z "${NETSNMP_MANDATORY}";
618 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
619 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
620 AC_MSG_NOTICE(*** including --without-netsnmp)
623 elif test ! -z "${NETSNMP_MANDATORY}";
626 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
627 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
628 AC_MSG_NOTICE(*** including --without-netsnmp)
632 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
634 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
636 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
638 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
641 AC_CHECK_HEADER([linux/soundcard.h],
644 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
646 if test "$PBX_OSS" = "0"; then
647 AC_CHECK_HEADER([sys/soundcard.h],
650 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
653 if test "$PBX_OSS" = "0"; then
654 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
658 if test "${USE_PGSQL}" != "no"; then
659 if test "x${PGSQL_DIR}" != "x"; then
660 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
661 if test x"${PG_CONFIG}" = xNo; then
663 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
664 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
665 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
666 AC_MSG_NOTICE(*** including --without-postgres)
670 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
673 if test "${PG_CONFIG}" != No; then
674 PGSQL_libdir=`pg_config --libdir`
675 PGSQL_includedir=`pg_config --includedir`
677 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
678 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
680 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
681 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
682 PGSQL_INCLUDE="-I${PGSQL_includedir}"
684 elif test ! -z "${PGSQL_MANDATORY}";
687 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
688 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
689 AC_MSG_NOTICE(*** including --without-postgres)
692 elif test ! -z "${PGSQL_MANDATORY}";
695 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
696 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
697 AC_MSG_NOTICE(*** including --without-postgres)
701 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
703 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
705 if test "${USE_PWLIB}" != "no"; then
706 if test ! -z "${PWLIB_DIR}"; then
707 PWLIBDIR="${PWLIB_DIR}"
710 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
712 if test "${HAS_PWLIB:-unset}" != "unset"; then
713 AST_CHECK_OPENH323_PLATFORM()
715 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
717 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
718 [Define if your system has the PWLib libraries.],
719 [#include "ptlib.h"],
720 [BOOL q = PTime::IsDaylightSavings();])
724 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a ! -z "${PWLIB_MANDATORY}"; then
726 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
727 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
728 AC_MSG_NOTICE(*** including --without-pwlib)
732 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
733 if test ! -z "${OPENH323_DIR}"; then
734 OPENH323DIR="${OPENH323_DIR}"
737 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
738 AST_CHECK_OPENH323_BUILD()
739 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
740 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
741 [Define if your system has the OpenH323 libraries.],
744 #include "h323ep.h"],
745 [H323EndPoint ep = H323EndPoint();],
746 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
748 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a ! -z "${OPENH323_MANDATORY}"; then
750 AC_MSG_NOTICE(*** The OPENH323 installation on this system appears to be broken.)
751 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
752 AC_MSG_NOTICE(*** including --without-h323)
759 if test "${USE_QT}" != "no"; then
760 AC_MSG_CHECKING(for QDate in -lqt)
762 saved_cppflags="${CPPFLAGS}"
763 if test "x${QT_DIR}" != "x"; then
764 LIBS="${LIBS} -L${QT_DIR}/lib"
765 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
772 [#include <qt3/qdatetime.h>],
775 [ac_cv_lib_qt_qt_date="yes"],
776 [ac_cv_lib_qt_qt_date="no"])
778 CPPFLAGS="${saved_cppflags}"
780 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
782 saved_cppflags="${CPPFLAGS}"
783 if test "x${QT_DIR}" != "x"; then
784 LIBS="${LIBS} -L${QT_DIR}/lib"
785 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
787 LIBS="${LIBS} -lqt-mt"
792 [#include <qt3/qdatetime.h>],
795 [ac_cv_lib_qt_qt_date="yes"],
796 [ac_cv_lib_qt_qt_date="no"])
798 CPPFLAGS="${saved_cppflags}"
801 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
807 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
809 if test "${QT_DIR}" != ""; then
810 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
811 QT_INCLUDE="-I${QT_DIR}/include"
814 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
815 AC_PATH_TOOL(QTMOC, moc, No)
816 elif test ! -z "${QT_MANDATORY}";
819 AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
820 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
821 AC_MSG_NOTICE(*** including --without-qt.)
828 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
830 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
832 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
834 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
836 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
837 if test "${PBX_FREETDS}" != "0";
839 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
841 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
844 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
847 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
850 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
855 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
857 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
859 if test "${host_os}" != "linux-gnu" ; then
863 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
865 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
869 if test "${USE_VPB}" != "no"; then
870 AC_MSG_CHECKING(for vpb_open in -lvpb)
872 saved_cppflags="${CPPFLAGS}"
873 if test "x${VPB_DIR}" != "x"; then
874 if test -d ${VPB_DIR}/lib; then
875 vpblibdir=${VPB_DIR}/lib
879 LIBS="${LIBS} -L${vpblibdir}"
880 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
882 LIBS="${LIBS} -lvpb -lpthread"
886 [#include <vpbapi.h>],
887 [int q = vpb_open(0,0);])
890 ac_cv_lib_vpb_vpb_open="yes"
893 ac_cv_lib_vpb_vpb_open="no"
897 CPPFLAGS="${saved_cppflags}"
898 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
900 if test "${VPB_DIR}" != ""; then
901 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
902 VPB_INCLUDE="-I${VPB_DIR}/include"
905 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
906 elif test ! -z "${VPB_MANDATORY}"; then
908 AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
909 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
910 AC_MSG_NOTICE(*** including --without-vpb.)
917 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
919 if test "${USE_ZAPTEL}" != "no"; then
920 AC_MSG_CHECKING(for ZT_TONE_DTMF_BASE in zaptel.h)
921 saved_cppflags="${CPPFLAGS}"
922 if test "x${ZAPTEL_DIR}" != "x"; then
923 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
928 [#include <zaptel/zaptel.h>],
929 [int foo = ZT_TONE_DTMF_BASE;])
938 CPPFLAGS="${saved_cppflags}"
939 if test "${ac_cv_zaptel_h}" = "yes"; then
940 if test "${ZAPTEL_DIR}" != ""; then
941 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
944 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
945 elif test ! -z "${ZAPTEL_MANDATORY}";
948 AC_MSG_NOTICE(*** The Zaptel installation on this system appears to be broken.)
949 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
950 AC_MSG_NOTICE(*** including --without-zaptel.)
955 if test "${USE_ZAPTEL}" != "no"; then
956 if test "${PBX_ZAPTEL}" != "1"; then
957 AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel.h)
958 saved_cppflags="${CPPFLAGS}"
959 if test "x${ZAPTEL_DIR}" != "x"; then
960 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
965 [#include <zaptel.h>],
966 [int foo = ZT_DIAL_OP_CANCEL;])
975 CPPFLAGS="${saved_cppflags}"
976 if test "${ac_cv_zaptel_h}" = "yes"; then
978 AC_MSG_NOTICE(*** The Zaptel installation on this system is too old)
979 AC_MSG_NOTICE(*** to be useable with this version of Asterisk.)
980 AC_MSG_NOTICE(*** Either upgrade your Zaptel installation, or run configure)
981 AC_MSG_NOTICE(*** including --without-zaptel.)
988 if test "x$TERMCAP_LIB" != "x" ; then
989 EDITLINE_LIB="$TERMCAP_LIB"
990 elif test "x$TINFO_LIB" != "x" ; then
991 EDITLINE_LIB="$TINFO_LIB"
992 elif test "x$CURSES_LIB" != "x" ; then
993 EDITLINE_LIB="$CURSES_LIB"
994 elif test "x$NCURSES_LIB" != "x" ; then
995 EDITLINE_LIB="$NCURSES_LIB"
997 AC_MSG_ERROR(*** termcap support not found)
999 AC_SUBST(EDITLINE_LIB)
1001 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1004 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1005 #include <linux/version.h>
1006 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1007 #include <linux/compiler.h>
1010 AC_SUBST(PBX_IXJUSER)
1013 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1014 if test ! "x${GTKCONFIG}" = xNo; then
1015 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1016 GTK_LIB=$(${GTKCONFIG} --libs gthread)
1018 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1021 AC_SUBST(GTK_INCLUDE)
1024 if test "${USE_CURL}" != "no"; then
1025 AC_PATH_TOOL([CURL], [curl-config], No)
1026 if test ! x"${CURL}" = xNo; then
1028 if test "${host_os}" = "SunOS"; then
1029 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
1030 CURL_INCLUDE=$(${CURL} --cflags)
1031 CURL_LIB=$(${CURL} --libs)
1033 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1036 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
1037 CURL_INCLUDE=$(${CURL} --cflags)
1038 CURL_LIB=$(${CURL} --libs)
1040 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1046 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1049 if test "x${silent}" != "xyes" ; then
1051 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1052 echo " .\$7\$7.. .7\$\$7:. "
1053 echo " .\$\$:. ,\$7.7 "
1054 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1055 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1056 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1057 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1058 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1059 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1060 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1061 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1062 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1063 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1064 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1065 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1066 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1067 echo " \$\$\$\$\$ \$\$\$ "
1068 echo " \$\$\$\$7. \$\$ (TM) "
1069 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1070 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1071 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1075 AC_MSG_NOTICE(Package configured for: )
1076 AC_MSG_NOTICE( OS type : $host_os)
1077 AC_MSG_NOTICE( Host CPU : $host_cpu)
1078 if test "${cross_compiling}" = "yes"; then
1079 AC_MSG_NOTICE( Cross Compilation = YES)