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], :)
152 AC_PATH_PROG([WGET], [wget], :)
153 if test "${WGET}" != ":" ; then
156 AC_PATH_PROG([FETCH], [fetch], [:])
163 AC_ARG_ENABLE(dev-mode,
164 [ --enable-dev-mode Turn on developer mode],
165 [case "${enableval}" in
166 y|ye|yes) AST_DEVMODE=yes ;;
167 n|no) AST_DEVMODE=no ;;
168 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
170 AC_SUBST(AST_DEVMODE)
172 # package option names should be in alphabetical order
173 # by the --with option name, to make things easier for the users :-)
175 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
176 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
177 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
178 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
179 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
180 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
181 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
182 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
183 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
184 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
185 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
186 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
187 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
188 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
189 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
190 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
191 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
192 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
193 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
194 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
195 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
196 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
197 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
198 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
199 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
200 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
201 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
202 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
203 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
204 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
205 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
206 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
207 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
208 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
209 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
210 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
211 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
213 # check for basic system features and functionality before
214 # checking for package libraries
220 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])
224 # Checks for typedefs, structures, and compiler characteristics.
233 AC_CHECK_MEMBERS([struct stat.st_blksize])
237 AC_CHECK_TYPES([ptrdiff_t])
239 # Checks for library functions.
241 AC_FUNC_CLOSEDIR_VOID
242 AC_FUNC_ERROR_AT_LINE
245 AC_PROG_GCC_TRADITIONAL
246 # XXX: these are commented out until we determine whether it matters if our malloc()
247 # acts exactly like glibc's or not
253 AC_FUNC_SELECT_ARGTYPES
254 AC_FUNC_SETVBUF_REVERSED
263 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])
265 AC_MSG_CHECKING(for compiler atomic operations)
267 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
269 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
273 AST_GCC_ATTRIBUTE(pure)
274 AST_GCC_ATTRIBUTE(malloc)
275 AST_GCC_ATTRIBUTE(const)
276 AST_GCC_ATTRIBUTE(unused)
277 AST_GCC_ATTRIBUTE(always_inline)
279 AC_MSG_CHECKING(for -ffunction-sections support)
280 saved_CFLAGS="${CFLAGS}"
281 CFLAGS="${CFLAGS} -ffunction-sections"
283 AC_LANG_PROGRAM([], [int x = 1;]),
285 [saved_LDFLAGS="${LDFLAGS}"]
286 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
287 AC_MSG_CHECKING(for --gc-sections support)
289 AC_LANG_PROGRAM([], [int x = 1;]),
291 [GC_CFLAGS="-ffunction-sections"]
292 [[GC_LDFLAGS="-Wl,--gc-sections"]],
295 [LDFLAGS="${saved_LDFLAGS}"],
298 CFLAGS="${saved_CFLAGS}"
302 AC_MSG_CHECKING(for res_ninit)
304 AC_LANG_PROGRAM([#include <resolv.h>],
305 [int foo = res_ninit(NULL);]),
307 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
311 AC_MSG_CHECKING(for RTLD_NOLOAD)
313 AC_LANG_PROGRAM([#include <dlfcn.h>],
314 [int foo = RTLD_NOLOAD;]),
316 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
320 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
322 AC_LANG_PROGRAM([#include <netinet/in.h>],
323 [int foo = IP_MTU_DISCOVER;]),
325 AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
329 AC_CHECK_HEADER([libkern/OSAtomic.h],
330 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
334 # do the package library checks now
336 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
338 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
341 AC_SUBST(GSM_INTERNAL)
343 if test "${USE_GSM}" != "no"; then
344 if test "${GSM_DIR}" = "internal"; then
346 elif test "${GSM_DIR}" != ""; then
349 if test "${GSM_SYSTEM}" = "yes"; then
351 if test "x${GSM_DIR}" != "x"; then
352 if test -d ${GSM_DIR}/lib; then
353 gsmlibdir="-L${GSM_DIR}/lib"
355 gsmlibdir="-L${GSM_DIR}"
358 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
359 [Define to indicate the GSM library]), [], ${gsmlibdir})
360 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
362 if test "x${GSM_DIR}" != "x"; then
363 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
364 GSM_INCLUDE="-I${GSM_DIR}/include"
370 if test "${GSM_INTERNAL}" = "yes"; then
375 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
377 if test "${PBX_IKSEMEL}" = 1; then
378 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
379 if test "${PBX_GNUTLS}" = 1; then
380 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
384 if test "${USE_IMAP_TK}" != "no"; then
385 if test "${IMAP_TK_DIR}" = ""; then
386 IMAP_TK_DIR=`pwd`"/../imap-2004g"
388 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
389 saved_cppflags="${CPPFLAGS}"
391 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
392 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
394 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
395 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
398 [#include "c-client.h"
399 void mm_searched (MAILSTREAM *stream,unsigned long number)
402 void mm_exists (MAILSTREAM *stream,unsigned long number)
405 void mm_expunged (MAILSTREAM *stream,unsigned long number)
408 void mm_flags (MAILSTREAM *stream,unsigned long number)
411 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
414 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
417 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
420 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
423 void mm_log (char *string,long errflg)
426 void mm_dlog (char *string)
429 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
432 void mm_critical (MAILSTREAM *stream)
435 void mm_nocritical (MAILSTREAM *stream)
438 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
441 void mm_fatal (char *string)
445 MAILSTREAM *foo = mail_open(NULL, "", 0);
448 [ac_cv_imap_tk="yes"],
451 if test "${ac_cv_imap_tk}" = "yes"; then
454 [#include "c-client.h"
455 void mm_searched (MAILSTREAM *stream,unsigned long number)
458 void mm_exists (MAILSTREAM *stream,unsigned long number)
461 void mm_expunged (MAILSTREAM *stream,unsigned long number)
464 void mm_flags (MAILSTREAM *stream,unsigned long number)
467 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
470 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
473 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
476 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
479 void mm_log (char *string,long errflg)
482 void mm_dlog (char *string)
485 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
488 void mm_critical (MAILSTREAM *stream)
491 void mm_nocritical (MAILSTREAM *stream)
494 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
497 void mm_fatal (char *string)
501 long check = mail_expunge_full(NULL, "", 0);
504 [ac_cv_imap_tk2006="yes"],
505 [ac_cv_imap_tk2006="no"]
508 CPPFLAGS="${saved_cppflags}"
510 if test "${ac_cv_imap_tk}" = "yes"; then
512 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
513 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
515 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
516 if test "${ac_cv_imap_tk2006}" = "yes"; then
517 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
519 elif test ! -z "${IMAP_TK_MANDATORY}"; then
522 AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
523 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
524 AC_MSG_NOTICE(*** including --without-imap.)
533 if test "${USE_KDE}" != "no"; then
534 AC_MSG_CHECKING(for crashHandler in -lkdecore)
536 saved_cppflags="${CPPFLAGS}"
537 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
538 if test -d ${KDE_DIR}/lib; then
539 kdelibdir="${KDE_DIR}/lib"
541 kdelibdir="${KDE_DIR}"
543 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
547 [#include "kcrash.h"],
548 [KCrash::defaultCrashHandler(1);])
550 [ac_cv_lib_kde_crash="yes"],
551 [ac_cv_lib_kde_crash="no"])
554 CPPFLAGS="${saved_cppflags}"
556 if test "${ac_cv_lib_kde_crash}" = "yes"; then
558 KDE_LIB="-lkdecore -lkdeui"
559 if test "${KDE_DIR}" != ""; then
560 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
561 KDE_INCLUDE="-I${KDE_DIR}/include"
564 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
565 elif test ! -z "${KDE_MANDATORY}"; then
568 AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
569 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
570 AC_MSG_NOTICE(*** including --without-kde.)
576 if test "${PBX_KDE}" = 1; then
577 AC_PATH_TOOL(KDEINIT, kdeinit, No)
578 if test ! x"${KDEINIT}" = xNo; then
579 KDEDIR=$(${DIRNAME} ${KDEINIT})
580 KDEDIR=$(${DIRNAME} ${KDEDIR})
587 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
589 if test "${PBX_MISDN}" = 1; then
590 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
591 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
594 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
596 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
599 if test "${USE_NETSNMP}" != "no"; then
600 if test "x${NETSNMP_DIR}" != "x"; then
601 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
602 if test x"${NETSNMP_CONFIG}" = xNo; then
604 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
605 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
606 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
607 AC_MSG_NOTICE(*** including --without-netsnmp)
611 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
614 if test x"${NETSNMP_CONFIG}" != xNo; then
615 NETSNMP_libs=`net-snmp-config --agent-libs`
617 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
618 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
620 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
621 NETSNMP_LIB="${NETSNMP_libs}"
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)
631 elif test ! -z "${NETSNMP_MANDATORY}";
634 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
635 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
636 AC_MSG_NOTICE(*** including --without-netsnmp)
640 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
642 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
644 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
646 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
649 AC_CHECK_HEADER([linux/soundcard.h],
652 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
654 if test "$PBX_OSS" = "0"; then
655 AC_CHECK_HEADER([sys/soundcard.h],
658 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
661 if test "$PBX_OSS" = "0"; then
662 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
666 if test "${USE_PGSQL}" != "no"; then
667 if test "x${PGSQL_DIR}" != "x"; then
668 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
669 if test x"${PG_CONFIG}" = xNo; then
671 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
672 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
673 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
674 AC_MSG_NOTICE(*** including --without-postgres)
678 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
681 if test "${PG_CONFIG}" != No; then
682 PGSQL_libdir=`pg_config --libdir`
683 PGSQL_includedir=`pg_config --includedir`
685 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
686 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
688 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
689 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
690 PGSQL_INCLUDE="-I${PGSQL_includedir}"
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)
700 elif test ! -z "${PGSQL_MANDATORY}";
703 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
704 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
705 AC_MSG_NOTICE(*** including --without-postgres)
709 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
711 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
713 if test "${USE_PWLIB}" != "no"; then
714 if test ! -z "${PWLIB_DIR}"; then
715 PWLIBDIR="${PWLIB_DIR}"
718 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
720 if test "${HAS_PWLIB:-unset}" != "unset"; then
721 AST_CHECK_OPENH323_PLATFORM()
723 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
725 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
726 [Define if your system has the PWLib libraries.],
727 [#include "ptlib.h"],
728 [BOOL q = PTime::IsDaylightSavings();])
732 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a ! -z "${PWLIB_MANDATORY}"; then
734 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
735 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
736 AC_MSG_NOTICE(*** including --without-pwlib)
740 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
741 if test ! -z "${OPENH323_DIR}"; then
742 OPENH323DIR="${OPENH323_DIR}"
745 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
746 AST_CHECK_OPENH323_BUILD()
747 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
748 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
749 [Define if your system has the OpenH323 libraries.],
752 #include "h323ep.h"],
753 [H323EndPoint ep = H323EndPoint();],
754 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
756 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a ! -z "${OPENH323_MANDATORY}"; then
758 AC_MSG_NOTICE(*** The OPENH323 installation on this system appears to be broken.)
759 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
760 AC_MSG_NOTICE(*** including --without-h323)
767 if test "${USE_QT}" != "no"; then
768 AC_MSG_CHECKING(for QDate in -lqt)
770 saved_cppflags="${CPPFLAGS}"
771 if test "x${QT_DIR}" != "x"; then
772 LIBS="${LIBS} -L${QT_DIR}/lib"
773 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
780 [#include <qt3/qdatetime.h>],
783 [ac_cv_lib_qt_qt_date="yes"],
784 [ac_cv_lib_qt_qt_date="no"])
786 CPPFLAGS="${saved_cppflags}"
788 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
790 saved_cppflags="${CPPFLAGS}"
791 if test "x${QT_DIR}" != "x"; then
792 LIBS="${LIBS} -L${QT_DIR}/lib"
793 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
795 LIBS="${LIBS} -lqt-mt"
800 [#include <qt3/qdatetime.h>],
803 [ac_cv_lib_qt_qt_date="yes"],
804 [ac_cv_lib_qt_qt_date="no"])
806 CPPFLAGS="${saved_cppflags}"
809 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
815 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
817 if test "${QT_DIR}" != ""; then
818 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
819 QT_INCLUDE="-I${QT_DIR}/include"
822 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
823 AC_PATH_TOOL(QTMOC, moc, No)
824 elif test ! -z "${QT_MANDATORY}";
827 AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
828 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
829 AC_MSG_NOTICE(*** including --without-qt.)
836 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
838 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
840 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
842 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
844 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
845 if test "${PBX_FREETDS}" != "0";
847 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
849 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
852 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
855 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
858 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
863 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
865 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
867 if test "${host_os}" != "linux-gnu" ; then
871 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
873 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
877 if test "${USE_VPB}" != "no"; then
878 AC_MSG_CHECKING(for vpb_open in -lvpb)
880 saved_cppflags="${CPPFLAGS}"
881 if test "x${VPB_DIR}" != "x"; then
882 if test -d ${VPB_DIR}/lib; then
883 vpblibdir=${VPB_DIR}/lib
887 LIBS="${LIBS} -L${vpblibdir}"
888 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
890 LIBS="${LIBS} -lvpb -lpthread"
894 [#include <vpbapi.h>],
895 [int q = vpb_open(0,0);])
898 ac_cv_lib_vpb_vpb_open="yes"
901 ac_cv_lib_vpb_vpb_open="no"
905 CPPFLAGS="${saved_cppflags}"
906 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
908 if test "${VPB_DIR}" != ""; then
909 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
910 VPB_INCLUDE="-I${VPB_DIR}/include"
913 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
914 elif test ! -z "${VPB_MANDATORY}"; then
916 AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
917 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
918 AC_MSG_NOTICE(*** including --without-vpb.)
925 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
927 if test "${USE_ZAPTEL}" != "no"; then
928 AC_MSG_CHECKING(for ZT_TONE_DTMF_BASE in zaptel.h)
929 saved_cppflags="${CPPFLAGS}"
930 if test "x${ZAPTEL_DIR}" != "x"; then
931 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
936 [#include <zaptel/zaptel.h>],
937 [int foo = ZT_TONE_DTMF_BASE;])
946 CPPFLAGS="${saved_cppflags}"
947 if test "${ac_cv_zaptel_h}" = "yes"; then
948 if test "${ZAPTEL_DIR}" != ""; then
949 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
952 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
953 elif test ! -z "${ZAPTEL_MANDATORY}";
956 AC_MSG_NOTICE(*** The Zaptel installation on this system appears to be broken.)
957 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
958 AC_MSG_NOTICE(*** including --without-zaptel.)
963 if test "${USE_ZAPTEL}" != "no"; then
964 if test "${PBX_ZAPTEL}" != "1"; then
965 AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel.h)
966 saved_cppflags="${CPPFLAGS}"
967 if test "x${ZAPTEL_DIR}" != "x"; then
968 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
973 [#include <zaptel.h>],
974 [int foo = ZT_DIAL_OP_CANCEL;])
983 CPPFLAGS="${saved_cppflags}"
984 if test "${ac_cv_zaptel_h}" = "yes"; then
986 AC_MSG_NOTICE(*** The Zaptel installation on this system is too old)
987 AC_MSG_NOTICE(*** to be useable with this version of Asterisk.)
988 AC_MSG_NOTICE(*** Either upgrade your Zaptel installation, or run configure)
989 AC_MSG_NOTICE(*** including --without-zaptel.)
996 if test "x$TERMCAP_LIB" != "x" ; then
997 EDITLINE_LIB="$TERMCAP_LIB"
998 elif test "x$TINFO_LIB" != "x" ; then
999 EDITLINE_LIB="$TINFO_LIB"
1000 elif test "x$CURSES_LIB" != "x" ; then
1001 EDITLINE_LIB="$CURSES_LIB"
1002 elif test "x$NCURSES_LIB" != "x" ; then
1003 EDITLINE_LIB="$NCURSES_LIB"
1005 AC_MSG_ERROR(*** termcap support not found)
1007 AC_SUBST(EDITLINE_LIB)
1009 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1012 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1013 #include <linux/version.h>
1014 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1015 #include <linux/compiler.h>
1018 AC_SUBST(PBX_IXJUSER)
1021 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1022 if test ! "x${GTKCONFIG}" = xNo; then
1023 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1024 GTK_LIB=$(${GTKCONFIG} --libs gthread)
1026 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1029 AC_SUBST(GTK_INCLUDE)
1032 if test "${USE_CURL}" != "no"; then
1033 AC_PATH_TOOL([CURL], [curl-config], No)
1034 if test ! x"${CURL}" = xNo; then
1036 if test $(printf "%d" 0x$(curl-config --vernum)) -ge $(printf "%d" 0x070907); 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.])
1045 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1048 if test "x${silent}" != "xyes" ; then
1050 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1051 echo " .\$7\$7.. .7\$\$7:. "
1052 echo " .\$\$:. ,\$7.7 "
1053 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1054 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1055 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1056 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1057 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1058 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1059 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1060 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1061 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1062 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1063 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1064 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1065 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1066 echo " \$\$\$\$\$ \$\$\$ "
1067 echo " \$\$\$\$7. \$\$ (TM) "
1068 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1069 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1070 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1074 AC_MSG_NOTICE(Package configured for: )
1075 AC_MSG_NOTICE( OS type : $host_os)
1076 AC_MSG_NOTICE( Host CPU : $host_cpu)
1077 if test "${cross_compiling}" = "yes"; then
1078 AC_MSG_NOTICE( Cross Compilation = YES)