2 # Process this file with autoconf to produce a configure script.
4 # Make sure we use autoconf 2.60 to generate the "configure" script,
5 # in case we want to commit it. Other than that, version 2.59 is
6 # perfectly fine for our purposes, so people who want to modify
7 # this file just have to remember to set the AC_PREREQ argument
8 # to something that suits their needs.
12 m4_define([PBX_VERSION],
13 m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
14 [\([0-9.]*\)\(\w\|\W\)*],
16 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
18 # cross-compile macros
22 # check existence of the package
23 AC_CONFIG_SRCDIR([main/asterisk.c])
25 # specify output header file
26 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
28 AC_COPYRIGHT("Asterisk")
29 AC_REVISION($Revision$)
33 ac_default_prefix=/usr/local
34 CPPFLAGS=-I/usr/local/include
35 LDFLAGS=-L/usr/local/lib
38 ac_default_prefix=/usr
39 if test ${sysconfdir} = '${prefix}/etc'; then
42 if test ${mandir} = '${prefix}/man'; then
48 if test ${localstatedir} = '${prefix}/var'; then
52 BUILD_PLATFORM=${build}
53 BUILD_CPU=${build_cpu}
54 BUILD_VENDOR=${build_vendor}
57 AC_SUBST(BUILD_PLATFORM)
59 AC_SUBST(BUILD_VENDOR)
64 HOST_VENDOR=${host_vendor}
67 AC_SUBST(HOST_PLATFORM)
93 AC_PATH_TOOL([UNAME], [uname], No)
94 if test ! x"${UNAME}" = xNo; then
95 PBX_OSREV=$(${UNAME} -r)
99 # This needs to be before any macros that use the C compiler
103 #ifndef ASTERISK_AUTOCONFIG_H
104 #define ASTERISK_AUTOCONFIG_H
106 #include "asterisk/buildopts.h"
117 # cross-compile checks
118 if test "${cross_compiling}" = "yes";
120 AC_CHECK_TOOL(CC, gcc, :)
121 AC_CHECK_TOOL(CXX, g++, :)
122 AC_CHECK_TOOL(LD, ld, :)
123 AC_CHECK_TOOL(RANLIB, ranlib, :)
124 AC_CHECK_TOOL(AR, ar, :)
127 # Checks for programs.
132 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
133 # the developers regenerating the configure script don't have to install libtool.
142 if test "x$with_gnu_ld" = "xyes" ; then
147 AC_PATH_PROG([GREP], [grep], :)
148 AC_PATH_PROG([AR], [ar], :)
149 AC_PATH_PROG([FIND], [find], :)
150 AC_PATH_PROG([COMPRESS], [compress], :)
151 AC_PATH_PROG([BASENAME], [basename], :)
152 AC_PATH_PROG([ID], [id], :)
153 AC_PATH_PROG([DIRNAME], [dirname], :)
154 AC_PATH_PROG([SHELL], [sh], :)
155 AC_PATH_PROG([LN], [ln], :)
156 AC_PATH_PROG([DOT], [dot], :)
157 AC_PATH_PROG([STRIP], [strip], :)
158 AC_PATH_PROG([WGET], [wget], :)
159 if test "${WGET}" != ":" ; then
162 AC_PATH_PROG([FETCH], [fetch], [:])
169 AC_ARG_ENABLE(dev-mode,
170 [ --enable-dev-mode Turn on developer mode],
171 [case "${enableval}" in
172 y|ye|yes) AST_DEVMODE=yes ;;
173 n|no) AST_DEVMODE=no ;;
174 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
176 AC_SUBST(AST_DEVMODE)
178 # package option names should be in alphabetical order
179 # by the --with option name, to make things easier for the users :-)
181 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
182 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
183 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
184 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
185 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
186 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
187 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
188 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
189 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
190 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
191 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
192 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
193 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
194 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
195 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
196 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
197 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
198 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
199 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
200 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
201 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
202 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
203 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
204 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
205 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
206 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
207 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
208 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
209 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
210 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
211 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
212 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
213 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
214 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
215 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
216 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
217 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
218 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
219 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
221 # check for basic system features and functionality before
222 # checking for package libraries
228 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])
232 # Checks for typedefs, structures, and compiler characteristics.
241 AC_CHECK_MEMBERS([struct stat.st_blksize])
245 AC_CHECK_TYPES([ptrdiff_t])
247 # Checks for library functions.
249 AC_FUNC_CLOSEDIR_VOID
250 AC_FUNC_ERROR_AT_LINE
253 AC_PROG_GCC_TRADITIONAL
254 # XXX: these are commented out until we determine whether it matters if our malloc()
255 # acts exactly like glibc's or not
261 AC_FUNC_SELECT_ARGTYPES
262 AC_FUNC_SETVBUF_REVERSED
271 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])
273 # https support (in main/http.c) uses funopen on BSD systems,
274 # fopencookie on linux
275 AC_CHECK_FUNCS([funopen fopencookie])
277 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
278 AC_CHECK_FUNCS([gethostbyname_r])
280 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
281 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
283 AC_MSG_CHECKING(for compiler atomic operations)
285 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
287 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
291 AST_GCC_ATTRIBUTE(pure)
292 AST_GCC_ATTRIBUTE(malloc)
293 AST_GCC_ATTRIBUTE(const)
294 AST_GCC_ATTRIBUTE(unused)
295 AST_GCC_ATTRIBUTE(always_inline)
297 AC_MSG_CHECKING(for -ffunction-sections support)
298 saved_CFLAGS="${CFLAGS}"
299 CFLAGS="${CFLAGS} -ffunction-sections"
301 AC_LANG_PROGRAM([], [int x = 1;]),
303 [saved_LDFLAGS="${LDFLAGS}"]
304 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
305 AC_MSG_CHECKING(for --gc-sections support)
307 AC_LANG_PROGRAM([], [int x = 1;]),
309 [GC_CFLAGS="-ffunction-sections"]
310 [[GC_LDFLAGS="-Wl,--gc-sections"]],
313 [LDFLAGS="${saved_LDFLAGS}"],
316 CFLAGS="${saved_CFLAGS}"
320 AC_MSG_CHECKING(for res_ninit)
322 AC_LANG_PROGRAM([#include <resolv.h>],
323 [int foo = res_ninit(NULL);]),
325 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
329 AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
331 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
333 AC_CHECK_HEADER([libkern/OSAtomic.h],
334 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
338 # do the package library checks now
340 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
342 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
344 if test "x${host_os}" = "xlinux-gnu" ; then
345 AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
349 AC_SUBST(GSM_INTERNAL)
351 if test "${USE_GSM}" != "no"; then
352 if test "${GSM_DIR}" = "internal"; then
354 elif test "${GSM_DIR}" != ""; then
357 if test "${GSM_SYSTEM}" = "yes"; then
359 if test "x${GSM_DIR}" != "x"; then
360 if test -d ${GSM_DIR}/lib; then
361 gsmlibdir="-L${GSM_DIR}/lib"
363 gsmlibdir="-L${GSM_DIR}"
366 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
367 [Define to indicate the GSM library]), [], ${gsmlibdir})
368 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
370 if test "x${GSM_DIR}" != "x"; then
371 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
372 GSM_INCLUDE="-I${GSM_DIR}/include"
378 if test "${GSM_INTERNAL}" = "yes"; then
383 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
385 if test "${PBX_IKSEMEL}" = 1; then
386 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
387 if test "${PBX_GNUTLS}" = 1; then
388 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
392 if test "${USE_IMAP_TK}" != "no"; then
393 if test "${IMAP_TK_DIR}" = ""; then
394 IMAP_TK_DIR=`pwd`"/../imap-2004g"
396 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
397 saved_cppflags="${CPPFLAGS}"
399 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
400 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
402 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
403 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
406 [#include "c-client.h"
407 void mm_searched (MAILSTREAM *stream,unsigned long number)
410 void mm_exists (MAILSTREAM *stream,unsigned long number)
413 void mm_expunged (MAILSTREAM *stream,unsigned long number)
416 void mm_flags (MAILSTREAM *stream,unsigned long number)
419 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
422 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
425 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
428 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
431 void mm_log (char *string,long errflg)
434 void mm_dlog (char *string)
437 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
440 void mm_critical (MAILSTREAM *stream)
443 void mm_nocritical (MAILSTREAM *stream)
446 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
449 void mm_fatal (char *string)
453 MAILSTREAM *foo = mail_open(NULL, "", 0);
456 [ac_cv_imap_tk="yes"],
459 if test "${ac_cv_imap_tk}" = "yes"; then
462 [#include "c-client.h"
463 void mm_searched (MAILSTREAM *stream,unsigned long number)
466 void mm_exists (MAILSTREAM *stream,unsigned long number)
469 void mm_expunged (MAILSTREAM *stream,unsigned long number)
472 void mm_flags (MAILSTREAM *stream,unsigned long number)
475 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
478 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
481 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
484 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
487 void mm_log (char *string,long errflg)
490 void mm_dlog (char *string)
493 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
496 void mm_critical (MAILSTREAM *stream)
499 void mm_nocritical (MAILSTREAM *stream)
502 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
505 void mm_fatal (char *string)
509 long check = mail_expunge_full(NULL, "", 0);
512 [ac_cv_imap_tk2006="yes"],
513 [ac_cv_imap_tk2006="no"]
516 CPPFLAGS="${saved_cppflags}"
518 if test "${ac_cv_imap_tk}" = "yes"; then
520 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
521 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
523 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
524 if test "${ac_cv_imap_tk2006}" = "yes"; then
525 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
534 if test "${USE_KDE}" != "no"; then
535 AC_MSG_CHECKING(for crashHandler in -lkdecore)
537 saved_cppflags="${CPPFLAGS}"
538 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
539 if test -d ${KDE_DIR}/lib; then
540 kdelibdir="${KDE_DIR}/lib"
542 kdelibdir="${KDE_DIR}"
544 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
548 [#include "kcrash.h"],
549 [KCrash::defaultCrashHandler(1);])
551 [ac_cv_lib_kde_crash="yes"],
552 [ac_cv_lib_kde_crash="no"])
555 CPPFLAGS="${saved_cppflags}"
557 if test "${ac_cv_lib_kde_crash}" = "yes"; then
559 KDE_LIB="-lkdecore -lkdeui"
560 if test "${KDE_DIR}" != ""; then
561 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
562 KDE_INCLUDE="-I${KDE_DIR}/include"
565 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
570 if test "${PBX_KDE}" = 1; then
571 AC_PATH_TOOL(KDEINIT, kdeinit, No)
572 if test ! x"${KDEINIT}" = xNo; then
573 KDEDIR=$(${DIRNAME} ${KDEINIT})
574 KDEDIR=$(${DIRNAME} ${KDEDIR})
581 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
583 if test "${PBX_MISDN}" = 1; then
584 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
585 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
588 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
590 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
593 if test "${USE_NETSNMP}" != "no"; then
594 if test "x${NETSNMP_DIR}" != "x"; then
595 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
596 if test x"${NETSNMP_CONFIG}" = xNo; then
598 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
599 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
600 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
601 AC_MSG_NOTICE(*** including --without-netsnmp)
605 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
608 if test x"${NETSNMP_CONFIG}" != xNo; then
609 NETSNMP_libs=`net-snmp-config --agent-libs`
611 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
612 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
614 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
615 NETSNMP_LIB="${NETSNMP_libs}"
620 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
622 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
624 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
626 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
628 # possible places for oss definitions
629 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
630 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
631 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
634 if test "${USE_PGSQL}" != "no"; then
635 if test "x${PGSQL_DIR}" != "x"; then
636 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
637 if test x"${PG_CONFIG}" = xNo; then
639 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
640 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
641 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
642 AC_MSG_NOTICE(*** including --without-postgres)
646 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
649 if test "${PG_CONFIG}" != No; then
650 PGSQL_libdir=`pg_config --libdir`
651 PGSQL_includedir=`pg_config --includedir`
653 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
654 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
656 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
657 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
658 PGSQL_INCLUDE="-I${PGSQL_includedir}"
663 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
665 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
667 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
669 if test "${USE_PWLIB}" != "no"; then
670 if test ! -z "${PWLIB_DIR}"; then
671 PWLIBDIR="${PWLIB_DIR}"
674 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
676 if test "${HAS_PWLIB:-unset}" != "unset"; then
677 AST_CHECK_OPENH323_PLATFORM()
679 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
681 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
682 [Define if your system has the PWLib libraries.],
683 [#include "ptlib.h"],
684 [BOOL q = PTime::IsDaylightSavings();])
688 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
689 if test ! -z "${OPENH323_DIR}"; then
690 OPENH323DIR="${OPENH323_DIR}"
693 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
694 AST_CHECK_OPENH323_BUILD()
695 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
696 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
697 [Define if your system has the OpenH323 libraries.],
700 #include "h323ep.h"],
701 [H323EndPoint ep = H323EndPoint();],
702 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
707 if test "${USE_QT}" != "no"; then
708 AC_MSG_CHECKING(for QDate in -lqt)
710 saved_cppflags="${CPPFLAGS}"
711 if test "x${QT_DIR}" != "x"; then
712 LIBS="${LIBS} -L${QT_DIR}/lib"
713 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
720 [#include <qt3/qdatetime.h>],
723 [ac_cv_lib_qt_qt_date="yes"],
724 [ac_cv_lib_qt_qt_date="no"])
726 CPPFLAGS="${saved_cppflags}"
728 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
730 saved_cppflags="${CPPFLAGS}"
731 if test "x${QT_DIR}" != "x"; then
732 LIBS="${LIBS} -L${QT_DIR}/lib"
733 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
735 LIBS="${LIBS} -lqt-mt"
740 [#include <qt3/qdatetime.h>],
743 [ac_cv_lib_qt_qt_date="yes"],
744 [ac_cv_lib_qt_qt_date="no"])
746 CPPFLAGS="${saved_cppflags}"
749 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
755 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
757 if test "${QT_DIR}" != ""; then
758 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
759 QT_INCLUDE="-I${QT_DIR}/include"
762 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
763 AC_PATH_TOOL(QTMOC, moc, No)
769 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
771 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
773 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
775 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
777 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
778 if test "${PBX_FREETDS}" != "0";
780 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
782 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
785 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
788 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
791 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
796 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
798 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
800 if test "${host_os}" != "linux-gnu" ; then
804 # new tonezone, version 1.4.0
805 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [140])
806 # other case, old tonezone (0.80)
807 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [80])
809 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
813 if test "${USE_VPB}" != "no"; then
814 AC_MSG_CHECKING(for vpb_open in -lvpb)
816 saved_cppflags="${CPPFLAGS}"
817 if test "x${VPB_DIR}" != "x"; then
818 if test -d ${VPB_DIR}/lib; then
819 vpblibdir=${VPB_DIR}/lib
823 LIBS="${LIBS} -L${vpblibdir}"
824 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
826 LIBS="${LIBS} -lvpb -lpthread"
830 [#include <vpbapi.h>],
831 [int q = vpb_open(0,0);])
834 ac_cv_lib_vpb_vpb_open="yes"
837 ac_cv_lib_vpb_vpb_open="no"
841 CPPFLAGS="${saved_cppflags}"
842 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
844 if test "${VPB_DIR}" != ""; then
845 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
846 VPB_INCLUDE="-I${VPB_DIR}/include"
849 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
855 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
857 # check for zaptel 1.4.0
858 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
859 # or, try old zaptel (0.80 or so)
860 AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
862 if test "${USE_ZAPTEL}" != "no"; then
863 if test "${PBX_ZAPTEL}" != "1"; then
864 AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel.h)
865 saved_cppflags="${CPPFLAGS}"
866 if test "x${ZAPTEL_DIR}" != "x"; then
867 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
872 [#include <zaptel.h>],
873 [int foo = ZT_DIAL_OP_CANCEL;])
882 CPPFLAGS="${saved_cppflags}"
883 if test "${ac_cv_zaptel_h}" = "yes"; then
885 AC_MSG_NOTICE(*** The Zaptel installation on this system is too old)
886 AC_MSG_NOTICE(*** to be useable with this version of Asterisk.)
887 AC_MSG_NOTICE(*** Either upgrade your Zaptel installation, or run configure)
888 AC_MSG_NOTICE(*** including --without-zaptel.)
895 if test "x$TERMCAP_LIB" != "x" ; then
896 EDITLINE_LIB="$TERMCAP_LIB"
897 elif test "x$TINFO_LIB" != "x" ; then
898 EDITLINE_LIB="$TINFO_LIB"
899 elif test "x$CURSES_LIB" != "x" ; then
900 EDITLINE_LIB="$CURSES_LIB"
901 elif test "x$NCURSES_LIB" != "x" ; then
902 EDITLINE_LIB="$NCURSES_LIB"
904 AC_MSG_ERROR(*** termcap support not found)
906 AC_SUBST(EDITLINE_LIB)
908 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
911 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
912 #include <linux/version.h>
913 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
914 #include <linux/compiler.h>
917 AC_SUBST(PBX_IXJUSER)
920 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
921 if test ! "x${GTKCONFIG}" = xNo; then
922 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
923 GTK_LIB=$(${GTKCONFIG} --libs gthread)
925 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
928 AC_SUBST(GTK_INCLUDE)
931 if test "${USE_CURL}" != "no"; then
932 AC_PATH_TOOL([CURL], [curl-config], No)
933 if test ! x"${CURL}" = xNo; then
935 if test $(printf "%d" 0x$(curl-config --vernum)) -ge $(printf "%d" 0x070907); then
936 CURL_INCLUDE=$(${CURL} --cflags)
937 CURL_LIB=$(${CURL} --libs)
939 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
944 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
949 if test "x${silent}" != "xyes" ; then
951 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
952 echo " .\$7\$7.. .7\$\$7:. "
953 echo " .\$\$:. ,\$7.7 "
954 echo " .\$7. 7\$\$\$\$ .\$\$77 "
955 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
956 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
957 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
958 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
959 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
960 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
961 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
962 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
963 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
964 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
965 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
966 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
967 echo " \$\$\$\$\$ \$\$\$ "
968 echo " \$\$\$\$7. \$\$ (TM) "
969 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
970 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
971 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
975 AC_MSG_NOTICE(Package configured for: )
976 AC_MSG_NOTICE( OS type : $host_os)
977 AC_MSG_NOTICE( Host CPU : $host_cpu)
978 if test "${cross_compiling}" = "yes"; then
979 AC_MSG_NOTICE( Cross Compilation = YES)