1 # Process this file with autoconf to produce a configure script.
3 # Make sure we use autoconf 2.60 to generate the "configure" script,
4 # in case we want to commit it. Other than that, version 2.59 is
5 # perfectly fine for our purposes, so people who want to modify
6 # this file just have to remember to set the AC_PREREQ argument
7 # to something that suits their needs.
11 m4_define([PBX_VERSION],
12 m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
13 [\([0-9.]*\)\(\w\|\W\)*],
15 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
17 # cross-compile macros
21 # check existence of the package
22 AC_CONFIG_SRCDIR([main/asterisk.c])
24 # specify output header file
25 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
27 AC_COPYRIGHT("Asterisk")
28 AC_REVISION($Revision$)
31 AC_USE_SYSTEM_EXTENSIONS
35 ac_default_prefix=/usr/local
36 CPPFLAGS=-I/usr/local/include
37 LDFLAGS=-L/usr/local/lib
40 ac_default_prefix=/usr
41 if test ${sysconfdir} = '${prefix}/etc'; then
44 if test ${mandir} = '${prefix}/man'; then
50 if test ${localstatedir} = '${prefix}/var'; then
54 BUILD_PLATFORM=${build}
55 BUILD_CPU=${build_cpu}
56 BUILD_VENDOR=${build_vendor}
59 AC_SUBST(BUILD_PLATFORM)
61 AC_SUBST(BUILD_VENDOR)
66 HOST_VENDOR=${host_vendor}
69 AC_SUBST(HOST_PLATFORM)
95 AC_PATH_TOOL([UNAME], [uname], No)
96 if test ! x"${UNAME}" = xNo; then
97 PBX_OSREV=$(${UNAME} -r)
102 #ifndef ASTERISK_AUTOCONFIG_H
103 #define ASTERISK_AUTOCONFIG_H
105 #include "asterisk/buildopts.h"
113 # cross-compile checks
114 if test "${cross_compiling}" = "yes";
116 AC_CHECK_TOOL(CC, gcc, :)
117 AC_CHECK_TOOL(CXX, g++, :)
118 AC_CHECK_TOOL(LD, ld, :)
119 AC_CHECK_TOOL(RANLIB, ranlib, :)
120 AC_CHECK_TOOL(AR, ar, :)
123 # Checks for programs.
128 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
129 # the developers regenerating the configure script don't have to install libtool.
138 if test "x$with_gnu_ld" = "xyes" ; then
143 AC_PATH_PROG([GREP], [grep], :)
144 AC_PATH_PROG([AR], [ar], :)
145 AC_PATH_PROG([FIND], [find], :)
146 AC_PATH_PROG([COMPRESS], [compress], :)
147 AC_PATH_PROG([BASENAME], [basename], :)
148 AC_PATH_PROG([ID], [id], :)
149 AC_PATH_PROG([DIRNAME], [dirname], :)
150 AC_PATH_PROG([SHELL], [sh], :)
151 AC_PATH_PROG([LN], [ln], :)
152 AC_PATH_PROG([DOT], [dot], :)
153 AC_PATH_PROG([STRIP], [strip], :)
154 AC_PATH_PROG([WGET], [wget], :)
155 if test "${WGET}" != ":" ; then
158 AC_PATH_PROG([FETCH], [fetch], [:])
167 AC_ARG_ENABLE(dev-mode,
168 [ --enable-dev-mode Turn on developer mode],
169 [case "${enableval}" in
170 y|ye|yes) AST_DEVMODE=yes ;;
171 n|no) AST_DEVMODE=no ;;
172 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
174 AC_SUBST(AST_DEVMODE)
176 # package option names should be in alphabetical order
177 # by the --with option name, to make things easier for the users :-)
179 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
180 AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace support], [execinfo])
181 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
182 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
183 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
184 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
185 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
186 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
187 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
188 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
189 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
190 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
191 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
192 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
193 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
194 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
195 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
196 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
197 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
198 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
199 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
200 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
201 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
202 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
203 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
204 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
205 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
206 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
207 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
208 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
209 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
210 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
211 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
212 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
213 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
214 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
215 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
216 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
217 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
218 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
219 AST_EXT_LIB_SETUP([ZAPTEL_TRANSCODE], [Zaptel_transcode], [zaptel_transcode])
220 AST_EXT_LIB_SETUP([ZAPTEL_VLDTMF], [Zaptel_vldtmf], [zaptel_vldtmf])
222 # check for basic system features and functionality before
223 # checking for package libraries
229 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])
233 # Checks for typedefs, structures, and compiler characteristics.
242 AC_CHECK_MEMBERS([struct stat.st_blksize])
246 AC_CHECK_TYPES([ptrdiff_t])
248 # Checks for library functions.
250 AC_FUNC_CLOSEDIR_VOID
251 AC_FUNC_ERROR_AT_LINE
254 AC_PROG_GCC_TRADITIONAL
255 # XXX: these are commented out until we determine whether it matters if our malloc()
256 # acts exactly like glibc's or not
262 AC_FUNC_SELECT_ARGTYPES
263 AC_FUNC_SETVBUF_REVERSED
272 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])
274 # https support (in main/http.c) uses funopen on BSD systems,
275 # fopencookie on linux
276 AC_CHECK_FUNCS([funopen fopencookie])
278 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
279 AC_CHECK_FUNCS([gethostbyname_r])
281 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
282 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
284 AC_MSG_CHECKING(for compiler atomic operations)
286 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
288 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
292 AST_GCC_ATTRIBUTE(pure)
293 AST_GCC_ATTRIBUTE(malloc)
294 AST_GCC_ATTRIBUTE(const)
295 AST_GCC_ATTRIBUTE(unused)
296 AST_GCC_ATTRIBUTE(always_inline)
298 AC_MSG_CHECKING(for -ffunction-sections support)
299 saved_CFLAGS="${CFLAGS}"
300 CFLAGS="${CFLAGS} -ffunction-sections"
302 AC_LANG_PROGRAM([], [int x = 1;]),
304 [saved_LDFLAGS="${LDFLAGS}"]
305 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
306 AC_MSG_CHECKING(for --gc-sections support)
308 AC_LANG_PROGRAM([], [int x = 1;]),
310 [GC_CFLAGS="-ffunction-sections"]
311 [[GC_LDFLAGS="-Wl,--gc-sections"]],
314 [LDFLAGS="${saved_LDFLAGS}"],
317 CFLAGS="${saved_CFLAGS}"
321 AC_MSG_CHECKING(for res_ninit)
323 AC_LANG_PROGRAM([#include <resolv.h>],
324 [int foo = res_ninit(NULL);]),
326 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
330 AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
332 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
334 AC_CHECK_HEADER([libkern/OSAtomic.h],
335 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
339 # do the package library checks now
341 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
343 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
345 if test "x${host_os}" = "xlinux-gnu" ; then
346 AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
350 AC_SUBST(GSM_INTERNAL)
352 if test "${USE_GSM}" != "no"; then
353 if test "${GSM_DIR}" = "internal"; then
355 elif test "${GSM_DIR}" != ""; then
358 if test "${GSM_SYSTEM}" = "yes"; then
360 if test "x${GSM_DIR}" != "x"; then
361 if test -d ${GSM_DIR}/lib; then
362 gsmlibdir="-L${GSM_DIR}/lib"
364 gsmlibdir="-L${GSM_DIR}"
367 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
368 [Define to indicate the GSM library]), [], ${gsmlibdir})
369 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
371 if test "x${GSM_DIR}" != "x"; then
372 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
373 GSM_INCLUDE="-I${GSM_DIR}/include"
379 if test "${GSM_INTERNAL}" = "yes"; then
384 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
386 if test "${PBX_IKSEMEL}" = 1; then
387 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
388 if test "${PBX_GNUTLS}" = 1; then
389 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lgpg-error"
393 if test "${USE_IMAP_TK}" != "no"; then
394 if test "${IMAP_TK_DIR}" = ""; then
395 IMAP_TK_DIR=`pwd`"/../imap-2004g"
397 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
398 saved_cppflags="${CPPFLAGS}"
400 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
401 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
403 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
404 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
407 [#include "c-client.h"
408 void mm_searched (MAILSTREAM *stream,unsigned long number)
411 void mm_exists (MAILSTREAM *stream,unsigned long number)
414 void mm_expunged (MAILSTREAM *stream,unsigned long number)
417 void mm_flags (MAILSTREAM *stream,unsigned long number)
420 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
423 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
426 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
429 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
432 void mm_log (char *string,long errflg)
435 void mm_dlog (char *string)
438 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
441 void mm_critical (MAILSTREAM *stream)
444 void mm_nocritical (MAILSTREAM *stream)
447 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
450 void mm_fatal (char *string)
454 MAILSTREAM *foo = mail_open(NULL, "", 0);
457 [ac_cv_imap_tk="yes"],
460 if test "${ac_cv_imap_tk}" = "yes"; then
463 [#include "c-client.h"
464 void mm_searched (MAILSTREAM *stream,unsigned long number)
467 void mm_exists (MAILSTREAM *stream,unsigned long number)
470 void mm_expunged (MAILSTREAM *stream,unsigned long number)
473 void mm_flags (MAILSTREAM *stream,unsigned long number)
476 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
479 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
482 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
485 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
488 void mm_log (char *string,long errflg)
491 void mm_dlog (char *string)
494 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
497 void mm_critical (MAILSTREAM *stream)
500 void mm_nocritical (MAILSTREAM *stream)
503 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
506 void mm_fatal (char *string)
510 long check = mail_expunge_full(NULL, "", 0);
513 [ac_cv_imap_tk2006="yes"],
514 [ac_cv_imap_tk2006="no"]
517 CPPFLAGS="${saved_cppflags}"
519 if test "${ac_cv_imap_tk}" = "yes"; then
521 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
522 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
524 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
525 if test "${ac_cv_imap_tk2006}" = "yes"; then
526 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
535 if test "${USE_KDE}" != "no"; then
536 AC_MSG_CHECKING(for crashHandler in -lkdecore)
538 saved_cppflags="${CPPFLAGS}"
539 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
540 if test -d ${KDE_DIR}/lib; then
541 kdelibdir="${KDE_DIR}/lib"
543 kdelibdir="${KDE_DIR}"
545 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
549 [#include "kcrash.h"],
550 [KCrash::defaultCrashHandler(1);])
552 [ac_cv_lib_kde_crash="yes"],
553 [ac_cv_lib_kde_crash="no"])
556 CPPFLAGS="${saved_cppflags}"
558 if test "${ac_cv_lib_kde_crash}" = "yes"; then
560 KDE_LIB="-lkdecore -lkdeui"
561 if test "${KDE_DIR}" != ""; then
562 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
563 KDE_INCLUDE="-I${KDE_DIR}/include"
566 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
571 if test "${PBX_KDE}" = 1; then
572 AC_PATH_TOOL(KDEINIT, kdeinit, No)
573 if test ! x"${KDEINIT}" = xNo; then
574 KDEDIR=$(${DIRNAME} ${KDEINIT})
575 KDEDIR=$(${DIRNAME} ${KDEDIR})
582 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
584 if test "${PBX_MISDN}" = 1; then
585 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
586 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
589 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
591 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
594 if test "${USE_NETSNMP}" != "no"; then
595 if test "x${NETSNMP_DIR}" != "x"; then
596 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
597 if test x"${NETSNMP_CONFIG}" = xNo; then
599 AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
600 AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
601 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
602 AC_MSG_NOTICE([*** including --without-netsnmp])
606 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
609 if test x"${NETSNMP_CONFIG}" != xNo; then
610 NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
612 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
613 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
615 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
616 NETSNMP_LIB="${NETSNMP_libs}"
621 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
623 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
625 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
627 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
629 # possible places for oss definitions
630 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
631 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
632 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
635 if test "${USE_PGSQL}" != "no"; then
636 if test "x${PGSQL_DIR}" != "x"; then
637 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
638 if test x"${PG_CONFIG}" = xNo; then
640 AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
641 AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
642 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
643 AC_MSG_NOTICE([*** including --without-postgres])
647 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
650 if test "${PG_CONFIG}" != No; then
651 PGSQL_libdir=`${PG_CONFIG} --libdir`
652 PGSQL_includedir=`${PG_CONFIG} --includedir`
654 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
655 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
657 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
658 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
659 PGSQL_INCLUDE="-I${PGSQL_includedir}"
664 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
666 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
668 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
670 if test "${USE_PWLIB}" != "no"; then
671 if test ! -z "${PWLIB_DIR}"; then
672 PWLIBDIR="${PWLIB_DIR}"
675 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
677 if test "${HAS_PWLIB:-unset}" != "unset"; then
678 AST_CHECK_OPENH323_PLATFORM()
680 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
682 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
683 [Define if your system has the PWLib libraries.],
684 [#include "ptlib.h"],
685 [BOOL q = PTime::IsDaylightSavings();])
689 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
690 if test ! -z "${OPENH323_DIR}"; then
691 OPENH323DIR="${OPENH323_DIR}"
694 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
695 AST_CHECK_OPENH323_BUILD()
696 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
697 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
698 [Define if your system has the OpenH323 libraries.],
701 #include "h323ep.h"],
702 [H323EndPoint ep = H323EndPoint();],
703 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
708 if test "${USE_QT}" != "no"; then
709 AC_MSG_CHECKING(for QDate in -lqt)
711 saved_cppflags="${CPPFLAGS}"
712 if test "x${QT_DIR}" != "x"; then
713 LIBS="${LIBS} -L${QT_DIR}/lib"
714 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
721 [#include <qt3/qdatetime.h>],
724 [ac_cv_lib_qt_qt_date="yes"],
725 [ac_cv_lib_qt_qt_date="no"])
727 CPPFLAGS="${saved_cppflags}"
729 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
731 saved_cppflags="${CPPFLAGS}"
732 if test "x${QT_DIR}" != "x"; then
733 LIBS="${LIBS} -L${QT_DIR}/lib"
734 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
736 LIBS="${LIBS} -lqt-mt"
741 [#include <qt3/qdatetime.h>],
744 [ac_cv_lib_qt_qt_date="yes"],
745 [ac_cv_lib_qt_qt_date="no"])
747 CPPFLAGS="${saved_cppflags}"
750 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
756 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
758 if test "${QT_DIR}" != ""; then
759 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
760 QT_INCLUDE="-I${QT_DIR}/include"
763 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
764 AC_PATH_TOOL(QTMOC, moc, No)
770 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
772 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
774 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
776 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
778 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
779 if test "${PBX_FREETDS}" != "0";
781 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
783 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
786 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
789 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
792 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
797 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
799 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
801 if test "${host_os}" != "linux-gnu" ; then
805 # new tonezone, version 1.4.0
806 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [140])
807 # other case, old tonezone (0.80)
808 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [80])
810 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
814 if test "${USE_VPB}" != "no"; then
815 AC_MSG_CHECKING(for vpb_open in -lvpb)
817 saved_cppflags="${CPPFLAGS}"
818 if test "x${VPB_DIR}" != "x"; then
819 if test -d ${VPB_DIR}/lib; then
820 vpblibdir=${VPB_DIR}/lib
824 LIBS="${LIBS} -L${vpblibdir}"
825 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
827 LIBS="${LIBS} -lvpb -lpthread"
831 [#include <vpbapi.h>],
832 [int q = vpb_open(0,0);])
835 ac_cv_lib_vpb_vpb_open="yes"
838 ac_cv_lib_vpb_vpb_open="no"
842 CPPFLAGS="${saved_cppflags}"
843 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
845 if test "${VPB_DIR}" != ""; then
846 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
847 VPB_INCLUDE="-I${VPB_DIR}/include"
850 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
856 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
858 # Check for various zaptel features and locations.
859 # The version number, which goes into HAVE_ZAPTEL_VERSION,
860 # will be used in the system headers to determine the location
861 # of the zaptel.h header.
863 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
864 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_DIAL_OP_CANCEL], [zaptel/zaptel.h], [90])
866 # Check for VLDTMF support
867 AST_C_DEFINE_CHECK([ZAPTEL_VLDTMF], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h])
869 # Check for transcode support
870 AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_TRANSCODE], [zaptel/zaptel.h])
872 # On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
875 AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
876 AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],, [90])
877 AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],, [80])
882 if test "x$TERMCAP_LIB" != "x" ; then
883 EDITLINE_LIB="$TERMCAP_LIB"
884 elif test "x$TINFO_LIB" != "x" ; then
885 EDITLINE_LIB="$TINFO_LIB"
886 elif test "x$CURSES_LIB" != "x" ; then
887 EDITLINE_LIB="$CURSES_LIB"
888 elif test "x$NCURSES_LIB" != "x" ; then
889 EDITLINE_LIB="$NCURSES_LIB"
891 AC_MSG_ERROR(*** termcap support not found)
893 AC_SUBST(EDITLINE_LIB)
895 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
898 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
899 #include <linux/version.h>
900 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
901 #include <linux/compiler.h>
904 AC_SUBST(PBX_IXJUSER)
907 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
908 if test ! "x${GTKCONFIG}" = xNo; then
909 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
910 GTK_LIB=$(${GTKCONFIG} --libs gthread)
912 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
915 AC_SUBST(GTK_INCLUDE)
918 if test "${USE_CURL}" != "no"; then
919 AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
920 if test ! x"${CURL_CONFIG}" = xNo; then
922 if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
923 CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
924 CURL_LIB=$(${CURL_CONFIG} --libs)
926 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
931 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
936 if test "x${silent}" != "xyes" ; then
938 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
939 echo " .\$7\$7.. .7\$\$7:. "
940 echo " .\$\$:. ,\$7.7 "
941 echo " .\$7. 7\$\$\$\$ .\$\$77 "
942 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
943 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
944 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
945 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
946 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
947 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
948 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
949 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
950 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
951 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
952 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
953 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
954 echo " \$\$\$\$\$ \$\$\$ "
955 echo " \$\$\$\$7. \$\$ (TM) "
956 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
957 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
958 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
962 AC_MSG_NOTICE(Package configured for: )
963 AC_MSG_NOTICE( OS type : $host_os)
964 AC_MSG_NOTICE( Host CPU : $host_cpu)
965 if test "${cross_compiling}" = "yes"; then
966 AC_MSG_NOTICE( Cross Compilation = YES)