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$)
26 ac_default_prefix=/usr/local
29 ac_default_prefix=/usr
30 if test ${sysconfdir} = '${prefix}/etc'; then
33 if test ${mandir} = '${prefix}/man'; then
39 if test ${localstatedir} = '${prefix}/var'; then
43 BUILD_PLATFORM=${build}
44 BUILD_CPU=${build_cpu}
45 BUILD_VENDOR=${build_vendor}
48 AC_SUBST(BUILD_PLATFORM)
50 AC_SUBST(BUILD_VENDOR)
55 HOST_VENDOR=${host_vendor}
58 AC_SUBST(HOST_PLATFORM)
64 AC_PATH_TOOL([UNAME], [uname], No)
65 if test ! x"${UNAME}" = xNo; then
66 PBX_OSREV=$(${UNAME} -r)
70 # This needs to be before any macros that use the C compiler
74 #ifndef ASTERISK_AUTOCONFIG_H
75 #define ASTERISK_AUTOCONFIG_H
78 #include "asterisk/buildopts.h"
90 # cross-compile checks
91 if test "${cross_compiling}" = "yes";
93 AC_CHECK_TOOL(CC, gcc, :)
94 AC_CHECK_TOOL(CXX, g++, :)
95 AC_CHECK_TOOL(LD, ld, :)
96 AC_CHECK_TOOL(RANLIB, ranlib, :)
97 AC_CHECK_TOOL(AR, ar, :)
100 # Checks for programs.
111 AC_PATH_PROG([GREP], [grep], :)
112 AC_PATH_PROG([AR], [ar], :)
113 AC_PATH_PROG([FIND], [find], :)
114 AC_PATH_PROG([COMPRESS], [compress], :)
115 AC_PATH_PROG([BASENAME], [basename], :)
116 AC_PATH_PROG([DIRNAME], [dirname], :)
117 AC_PATH_PROG([SHELL], [sh], :)
118 AC_PATH_PROG([LN], [ln], :)
119 AC_PATH_PROG([DOT], [dot], :)
123 AC_ARG_ENABLE(dev-mode,
124 [ --enable-dev-mode Turn on developer mode],
125 [case "${enableval}" in
126 y|ye|yes) AST_DEVMODE=yes ;;
127 n|no) AST_DEVMODE=no ;;
128 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
130 AC_SUBST(AST_DEVMODE)
132 # package option names should be in alphabetical order
133 # by the --with option name, to make things easier for the users :-)
135 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
136 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
137 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
138 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
139 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
140 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
141 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
142 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
143 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
144 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
145 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
146 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
147 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
148 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
149 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
150 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
151 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
152 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
153 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
154 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
155 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
156 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
157 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
158 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
159 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
160 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
161 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
162 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
163 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
164 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
165 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
166 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
167 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
168 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
169 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
171 # check for basic system features and functionality before
172 # checking for package libraries
178 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])
182 # Checks for typedefs, structures, and compiler characteristics.
191 AC_CHECK_MEMBERS([struct stat.st_blksize])
195 AC_CHECK_TYPES([ptrdiff_t])
197 # Checks for library functions.
199 AC_FUNC_CLOSEDIR_VOID
200 AC_FUNC_ERROR_AT_LINE
203 AC_PROG_GCC_TRADITIONAL
204 # XXX: these are commented out until we determine whether it matters if our malloc()
205 # acts exactly like glibc's or not
211 AC_FUNC_SELECT_ARGTYPES
212 AC_FUNC_SETVBUF_REVERSED
221 AC_CHECK_FUNCS([atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strndup strnlen strrchr strsep strspn strstr strtol unsetenv utime strtoq strcasestr asprintf vasprintf])
223 AC_MSG_CHECKING(checking for compiler atomic operations)
225 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
227 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
231 AC_MSG_CHECKING(checking for res_ninit)
233 AC_LANG_PROGRAM([#include <resolv.h>],
234 [int foo = res_ninit(NULL);]),
236 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
240 AST_GCC_ATTRIBUTE(pure)
241 AST_GCC_ATTRIBUTE(malloc)
242 AST_GCC_ATTRIBUTE(const)
243 AST_GCC_ATTRIBUTE(unused)
244 AST_GCC_ATTRIBUTE(always_inline)
246 AC_CHECK_HEADER([libkern/OSAtomic.h],
247 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
251 # do the package library checks now
253 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
255 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
258 AC_SUBST(GSM_INTERNAL)
260 if test "${USE_GSM}" != "no"; then
261 if test "${GSM_DIR}" = "internal"; then
263 elif test "${GSM_DIR}" != ""; then
266 if test "${GSM_SYSTEM}" = "yes"; then
268 if test "x${GSM_DIR}" != "x"; then
269 if test -d ${GSM_DIR}/lib; then
270 gsmlibdir="-L${GSM_DIR}/lib"
272 gsmlibdir="-L${GSM_DIR}"
275 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
276 [Define to indicate the GSM library]), [], ${gsmlibdir})
277 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
279 if test "x${GSM_DIR}" != "x"; then
280 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
281 GSM_INCLUDE="-I${GSM_DIR}/include"
287 if test "${GSM_INTERNAL}" = "yes"; then
292 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
294 if test "${PBX_IKSEMEL}" = 1; then
295 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
296 if test "${PBX_GNUTLS}" = 1; then
297 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -ltasn1 -lz -lgcrypt -lnsl -lgpg-error"
301 if test "${USE_IMAP_TK}" != "no"; then
302 if test "${IMAP_TK_DIR}" = ""; then
303 IMAP_TK_DIR=`pwd`"/../imap-2004g"
305 AC_MSG_CHECKING(checking for UW IMAP Toolkit c-client library)
306 saved_cppflags="${CPPFLAGS}"
308 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
309 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
311 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
312 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
315 [#include "c-client.h"
316 void mm_searched (MAILSTREAM *stream,unsigned long number)
319 void mm_exists (MAILSTREAM *stream,unsigned long number)
322 void mm_expunged (MAILSTREAM *stream,unsigned long number)
325 void mm_flags (MAILSTREAM *stream,unsigned long number)
328 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
331 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
334 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
337 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
340 void mm_log (char *string,long errflg)
343 void mm_dlog (char *string)
346 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
349 void mm_critical (MAILSTREAM *stream)
352 void mm_nocritical (MAILSTREAM *stream)
355 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
358 void mm_fatal (char *string)
362 MAILSTREAM *foo = mail_open(NULL, "", 0);
365 [ac_cv_imap_tk="yes"],
368 if test "${ac_cv_imap_tk}" = "yes"; then
371 [#include "c-client.h"
372 void mm_searched (MAILSTREAM *stream,unsigned long number)
375 void mm_exists (MAILSTREAM *stream,unsigned long number)
378 void mm_expunged (MAILSTREAM *stream,unsigned long number)
381 void mm_flags (MAILSTREAM *stream,unsigned long number)
384 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
387 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
390 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
393 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
396 void mm_log (char *string,long errflg)
399 void mm_dlog (char *string)
402 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
405 void mm_critical (MAILSTREAM *stream)
408 void mm_nocritical (MAILSTREAM *stream)
411 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
414 void mm_fatal (char *string)
418 long check = mail_expunge_full(NULL, "", 0);
421 [ac_cv_imap_tk2006="yes"],
422 [ac_cv_imap_tk2006="no"]
425 CPPFLAGS="${saved_cppflags}"
427 if test "${ac_cv_imap_tk}" = "yes"; then
429 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
430 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
432 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
433 if test "${ac_cv_imap_tk2006}" = "yes"; then
434 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
436 elif test ! -z "${IMAP_TK_MANDATORY}"; then
439 AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
440 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
441 AC_MSG_NOTICE(*** including --without-imap.)
450 if test "${USE_KDE}" != "no"; then
451 AC_MSG_CHECKING(checking for crashHandler in -lkdecore)
453 saved_cppflags="${CPPFLAGS}"
454 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
455 if test -d ${KDE_DIR}/lib; then
456 kdelibdir="${KDE_DIR}/lib"
458 kdelibdir="${KDE_DIR}"
460 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
464 [#include "kcrash.h"],
465 [KCrash::defaultCrashHandler(1);])
467 [ac_cv_lib_kde_crash="yes"],
468 [ac_cv_lib_kde_crash="no"])
471 CPPFLAGS="${saved_cppflags}"
473 if test "${ac_cv_lib_kde_crash}" = "yes"; then
475 KDE_LIB="-lkdecore -lkdeui"
476 if test "${KDE_DIR}" != ""; then
477 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
478 KDE_INCLUDE="-I${KDE_DIR}/include"
481 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
482 elif test ! -z "${KDE_MANDATORY}"; then
485 AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
486 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
487 AC_MSG_NOTICE(*** including --without-kde.)
493 if test "${PBX_KDE}" = 1; then
494 AC_PATH_TOOL(KDEINIT, kdeinit, No)
495 if test ! x"${KDEINIT}" = xNo; then
496 KDEDIR=$(${DIRNAME} ${KDEINIT})
497 KDEDIR=$(${DIRNAME} ${KDEDIR})
504 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
506 if test "${PBX_MISDN}" = 1; then
507 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
508 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
511 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
513 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
516 if test "${USE_NETSNMP}" != "no"; then
517 if test "x${NETSNMP_DIR}" != "x"; then
518 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
519 if test x"${NETSNMP_CONFIG}" = xNo; then
521 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
522 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
523 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
524 AC_MSG_NOTICE(*** including --without-netsnmp)
528 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
531 if test x"${NETSNMP_CONFIG}" != xNo; then
532 NETSNMP_libs=`net-snmp-config --agent-libs`
534 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
535 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
537 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
538 NETSNMP_LIB="${NETSNMP_libs}"
540 elif test ! -z "${NETSNMP_MANDATORY}";
543 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
544 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
545 AC_MSG_NOTICE(*** including --without-netsnmp)
548 elif test ! -z "${NETSNMP_MANDATORY}";
551 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
552 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
553 AC_MSG_NOTICE(*** including --without-netsnmp)
557 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
559 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
561 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
563 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
566 AC_CHECK_HEADER([linux/soundcard.h],
569 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
571 if test "$PBX_OSS" = "0"; then
572 AC_CHECK_HEADER([sys/soundcard.h],
575 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
578 if test "$PBX_OSS" = "0"; then
579 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
583 if test "${USE_PGSQL}" != "no"; then
584 if test "x${PGSQL_DIR}" != "x"; then
585 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
586 if test x"${PG_CONFIG}" = xNo; then
588 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
589 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
590 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
591 AC_MSG_NOTICE(*** including --without-postgres)
595 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
598 if test "${PG_CONFIG}" != No; then
599 PGSQL_libdir=`pg_config --libdir`
600 PGSQL_includedir=`pg_config --includedir`
602 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
603 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
605 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
606 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
607 PGSQL_INCLUDE="-I${PGSQL_includedir}"
609 elif test ! -z "${PGSQL_MANDATORY}";
612 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
613 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
614 AC_MSG_NOTICE(*** including --without-postgres)
617 elif test ! -z "${PGSQL_MANDATORY}";
620 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
621 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
622 AC_MSG_NOTICE(*** including --without-postgres)
626 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
628 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
630 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
631 if test "${USE_PWLIB}" != "no"; then
632 AC_MSG_CHECKING(checking for existence of pwlib)
634 saved_cppflags="${CPPFLAGS}"
636 LIBS="${LIBS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
637 CPPFLAGS="${CPPFLAGS} -I${PWLIB_DIR}/include"
642 [#include "ptime.h"],
643 [int q = PTime::IsDaylightSaving();])
646 ac_cv_lib_pwlib="yes"
654 CPPFLAGS="${saved_cppflags}"
656 if test "${ac_cv_lib_pwlib}" = "yes"; then
657 PWLIB_LIB="-l{PLATFORM_PWLIB}"
658 if test "${PWLIB_DIR}" != ""; then
659 PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
660 PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
663 AC_DEFINE([HAVE_PWLIB], 1, [Define if your system has the pwlib libraries.])
664 elif test ! -z "${PWLIB_MANDATORY}"; then
666 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
667 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
668 AC_MSG_NOTICE(*** including --without-pwlib)
675 if test "${USE_QT}" != "no"; then
676 AC_MSG_CHECKING(checking for QDate in -lqt)
678 saved_cppflags="${CPPFLAGS}"
679 if test "x${QT_DIR}" != "x"; then
680 LIBS="${LIBS} -L${QT_DIR}/lib"
681 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
688 [#include <qt3/qdatetime.h>],
691 [ac_cv_lib_qt_qt_date="yes"],
692 [ac_cv_lib_qt_qt_date="no"])
694 CPPFLAGS="${saved_cppflags}"
696 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
698 saved_cppflags="${CPPFLAGS}"
699 if test "x${QT_DIR}" != "x"; then
700 LIBS="${LIBS} -L${QT_DIR}/lib"
701 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
703 LIBS="${LIBS} -lqt-mt"
708 [#include <qt3/qdatetime.h>],
711 [ac_cv_lib_qt_qt_date="yes"],
712 [ac_cv_lib_qt_qt_date="no"])
714 CPPFLAGS="${saved_cppflags}"
717 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
723 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
725 if test "${QT_DIR}" != ""; then
726 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
727 QT_INCLUDE="-I${QT_DIR}/include"
730 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
731 AC_PATH_TOOL(QTMOC, moc, No)
732 elif test ! -z "${QT_MANDATORY}";
735 AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
736 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
737 AC_MSG_NOTICE(*** including --without-qt.)
744 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
746 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
748 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
750 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
752 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
753 if test "${PBX_FREETDS}" != "0";
755 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
757 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
760 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
763 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
768 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
770 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
772 if test "${host_os}" != "linux-gnu" ; then
776 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
778 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
782 if test "${USE_VPB}" != "no"; then
783 AC_MSG_CHECKING(checking for vpb_open in -lvpb)
785 saved_cppflags="${CPPFLAGS}"
786 if test "x${VPB_DIR}" != "x"; then
787 if test -d ${VPB_DIR}/lib; then
788 vpblibdir=${VPB_DIR}/lib
792 LIBS="${LIBS} -L${vpblibdir}"
793 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
795 LIBS="${LIBS} -lvpb -lpthread"
799 [#include <vpbapi.h>],
800 [int q = vpb_open(0,0);])
803 ac_cv_lib_vpb_vpb_open="yes"
806 ac_cv_lib_vpb_vpb_open="no"
810 CPPFLAGS="${saved_cppflags}"
811 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
813 if test "${VPB_DIR}" != ""; then
814 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
815 VPB_INCLUDE="-I${VPB_DIR}/include"
818 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
819 elif test ! -z "${VPB_MANDATORY}"; then
821 AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
822 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
823 AC_MSG_NOTICE(*** including --without-vpb.)
830 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
832 if test "${USE_ZAPTEL}" != "no"; then
833 AC_MSG_CHECKING(checking for zt_transcode_header in zaptel.h)
834 saved_cppflags="${CPPFLAGS}"
835 if test "x${ZAPTEL_DIR}" != "x"; then
836 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
841 [#include <zaptel/zaptel.h>],
842 [struct zt_transcode_header test;])
851 CPPFLAGS="${saved_cppflags}"
852 if test "${ac_cv_zaptel_h}" = "yes"; then
853 if test "${ZAPTEL_DIR}" != ""; then
854 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
857 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
858 elif test ! -z "${ZAPTEL_MANDATORY}";
861 AC_MSG_NOTICE(*** The Zaptel installation on this system appears to be broken.)
862 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
863 AC_MSG_NOTICE(*** including --without-zaptel.)
869 if test "x$TERMCAP_LIB" != "x" ; then
870 EDITLINE_LIB="$TERMCAP_LIB"
871 elif test "x$TINFO_LIB" != "x" ; then
872 EDITLINE_LIB="$TINFO_LIB"
873 elif test "x$CURSES_LIB" != "x" ; then
874 EDITLINE_LIB="$CURSES_LIB"
875 elif test "x$NCURSES_LIB" != "x" ; then
876 EDITLINE_LIB="$NCURSES_LIB"
878 AC_MSG_ERROR(*** termcap support not found)
880 AC_SUBST(EDITLINE_LIB)
882 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
885 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
886 #include <linux/version.h>
887 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
888 #include <linux/compiler.h>
891 AC_SUBST(PBX_IXJUSER)
894 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
895 if test ! "x${GTKCONFIG}" = xNo; then
896 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
897 GTK_LIB=$(${GTKCONFIG} --libs gthread)
899 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
902 AC_SUBST(GTK_INCLUDE)
906 AC_PATH_TOOL([CURL], [curl-config], No)
907 if test ! x"${CURL}" = xNo; then
909 if test "${host_os}" = "SunOS"; then
910 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
911 CURLLIB=$(${CURL} --libs)
913 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
916 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
917 CURLLIB=$(${CURL} --libs)
919 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
926 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
929 if test "x${silent}" != "xyes" ; then
931 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
932 echo " .\$7\$7.. .7\$\$7:. "
933 echo " .\$\$:. ,\$7.7 "
934 echo " .\$7. 7\$\$\$\$ .\$\$77 "
935 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
936 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
937 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
938 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
939 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
940 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
941 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
942 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
943 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
944 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
945 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
946 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
947 echo " \$\$\$\$\$ \$\$\$ "
948 echo " \$\$\$\$7. \$\$ (TM) "
949 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
950 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
951 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
955 AC_MSG_NOTICE(Package configured for: )
956 AC_MSG_NOTICE( OS type : $host_os)
957 AC_MSG_NOTICE( Host CPU : $host_cpu)
958 if test "${cross_compiling}" = "yes"; then
959 AC_MSG_NOTICE( Cross Compilation = YES)
962 if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then
964 AC_MSG_NOTICE(***** WARNING ******)
965 AC_MSG_NOTICE(You are currently using GNU Make version ${GNU_MAKE_VERSION_MAJOR}.${GNU_MAKE_VERSION_MINOR}.)
966 AC_MSG_NOTICE(The Asterisk build system uses features that may not work correctly prior to 3.81.)
967 AC_MSG_NOTICE(Please consider upgrading GNU Make or you may experience problems.)
968 AC_MSG_NOTICE(********************)