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.
140 if test "x$with_gnu_ld" = "xyes" ; then
145 AC_PATH_PROG([GREP], [grep], :)
146 AC_PATH_PROG([AR], [ar], :)
147 AC_PATH_PROG([FIND], [find], :)
148 AC_PATH_PROG([COMPRESS], [compress], :)
149 AC_PATH_PROG([BASENAME], [basename], :)
150 AC_PATH_PROG([ID], [id], :)
151 AC_PATH_PROG([DIRNAME], [dirname], :)
152 AC_PATH_PROG([SHELL], [sh], :)
153 AC_PATH_PROG([LN], [ln], :)
154 AC_PATH_PROG([DOT], [dot], :)
155 AC_PATH_PROG([STRIP], [strip], :)
159 AC_ARG_ENABLE(dev-mode,
160 [ --enable-dev-mode Turn on developer mode],
161 [case "${enableval}" in
162 y|ye|yes) AST_DEVMODE=yes ;;
163 n|no) AST_DEVMODE=no ;;
164 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
166 AC_SUBST(AST_DEVMODE)
168 # package option names should be in alphabetical order
169 # by the --with option name, to make things easier for the users :-)
171 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
172 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
173 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
174 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
175 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
176 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
177 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
178 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
179 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
180 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
181 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
182 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
183 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
184 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
185 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
186 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
187 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
188 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
189 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
190 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
191 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
192 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
193 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
194 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
195 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
196 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
197 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
198 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
199 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
200 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
201 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
202 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
203 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
204 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
205 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
206 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
207 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
208 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
209 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
211 # check for basic system features and functionality before
212 # checking for package libraries
218 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])
222 # Checks for typedefs, structures, and compiler characteristics.
231 AC_CHECK_MEMBERS([struct stat.st_blksize])
235 AC_CHECK_TYPES([ptrdiff_t])
237 # Checks for library functions.
239 AC_FUNC_CLOSEDIR_VOID
240 AC_FUNC_ERROR_AT_LINE
243 AC_PROG_GCC_TRADITIONAL
244 # XXX: these are commented out until we determine whether it matters if our malloc()
245 # acts exactly like glibc's or not
251 AC_FUNC_SELECT_ARGTYPES
252 AC_FUNC_SETVBUF_REVERSED
261 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])
263 # https support (in main/http.c) uses funopen on BSD systems,
264 # fopencookie on linux
265 AC_CHECK_FUNCS([funopen fopencookie])
267 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
268 AC_CHECK_FUNCS([gethostbyname_r])
270 AC_MSG_CHECKING(for compiler atomic operations)
272 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
274 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
278 AST_GCC_ATTRIBUTE(pure)
279 AST_GCC_ATTRIBUTE(malloc)
280 AST_GCC_ATTRIBUTE(const)
281 AST_GCC_ATTRIBUTE(unused)
282 AST_GCC_ATTRIBUTE(always_inline)
284 AC_MSG_CHECKING(for -ffunction-sections support)
285 saved_CFLAGS="${CFLAGS}"
286 CFLAGS="${CFLAGS} -ffunction-sections"
288 AC_LANG_PROGRAM([], [int x = 1;]),
290 [saved_LDFLAGS="${LDFLAGS}"]
291 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
292 AC_MSG_CHECKING(for --gc-sections support)
294 AC_LANG_PROGRAM([], [int x = 1;]),
296 [GC_CFLAGS="-ffunction-sections"]
297 [[GC_LDFLAGS="-Wl,--gc-sections"]],
300 [LDFLAGS="${saved_LDFLAGS}"],
303 CFLAGS="${saved_CFLAGS}"
307 AC_MSG_CHECKING(for res_ninit)
309 AC_LANG_PROGRAM([#include <resolv.h>],
310 [int foo = res_ninit(NULL);]),
312 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
316 AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
318 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
320 AC_CHECK_HEADER([libkern/OSAtomic.h],
321 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
325 # do the package library checks now
327 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
329 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
331 if test "x${host_os}" = "xlinux-gnu" ; then
332 AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
336 AC_SUBST(GSM_INTERNAL)
338 if test "${USE_GSM}" != "no"; then
339 if test "${GSM_DIR}" = "internal"; then
341 elif test "${GSM_DIR}" != ""; then
344 if test "${GSM_SYSTEM}" = "yes"; then
346 if test "x${GSM_DIR}" != "x"; then
347 if test -d ${GSM_DIR}/lib; then
348 gsmlibdir="-L${GSM_DIR}/lib"
350 gsmlibdir="-L${GSM_DIR}"
353 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
354 [Define to indicate the GSM library]), [], ${gsmlibdir})
355 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
357 if test "x${GSM_DIR}" != "x"; then
358 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
359 GSM_INCLUDE="-I${GSM_DIR}/include"
365 if test "${GSM_INTERNAL}" = "yes"; then
370 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
372 if test "${PBX_IKSEMEL}" = 1; then
373 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
374 if test "${PBX_GNUTLS}" = 1; then
375 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
379 if test "${USE_IMAP_TK}" != "no"; then
380 if test "${IMAP_TK_DIR}" = ""; then
381 IMAP_TK_DIR=`pwd`"/../imap-2004g"
383 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
384 saved_cppflags="${CPPFLAGS}"
386 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
387 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
389 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
390 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
393 [#include "c-client.h"
394 void mm_searched (MAILSTREAM *stream,unsigned long number)
397 void mm_exists (MAILSTREAM *stream,unsigned long number)
400 void mm_expunged (MAILSTREAM *stream,unsigned long number)
403 void mm_flags (MAILSTREAM *stream,unsigned long number)
406 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
409 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
412 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
415 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
418 void mm_log (char *string,long errflg)
421 void mm_dlog (char *string)
424 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
427 void mm_critical (MAILSTREAM *stream)
430 void mm_nocritical (MAILSTREAM *stream)
433 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
436 void mm_fatal (char *string)
440 MAILSTREAM *foo = mail_open(NULL, "", 0);
443 [ac_cv_imap_tk="yes"],
446 if test "${ac_cv_imap_tk}" = "yes"; then
449 [#include "c-client.h"
450 void mm_searched (MAILSTREAM *stream,unsigned long number)
453 void mm_exists (MAILSTREAM *stream,unsigned long number)
456 void mm_expunged (MAILSTREAM *stream,unsigned long number)
459 void mm_flags (MAILSTREAM *stream,unsigned long number)
462 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
465 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
468 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
471 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
474 void mm_log (char *string,long errflg)
477 void mm_dlog (char *string)
480 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
483 void mm_critical (MAILSTREAM *stream)
486 void mm_nocritical (MAILSTREAM *stream)
489 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
492 void mm_fatal (char *string)
496 long check = mail_expunge_full(NULL, "", 0);
499 [ac_cv_imap_tk2006="yes"],
500 [ac_cv_imap_tk2006="no"]
503 CPPFLAGS="${saved_cppflags}"
505 if test "${ac_cv_imap_tk}" = "yes"; then
507 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
508 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
510 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
511 if test "${ac_cv_imap_tk2006}" = "yes"; then
512 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
521 if test "${USE_KDE}" != "no"; then
522 AC_MSG_CHECKING(for crashHandler in -lkdecore)
524 saved_cppflags="${CPPFLAGS}"
525 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
526 if test -d ${KDE_DIR}/lib; then
527 kdelibdir="${KDE_DIR}/lib"
529 kdelibdir="${KDE_DIR}"
531 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
535 [#include "kcrash.h"],
536 [KCrash::defaultCrashHandler(1);])
538 [ac_cv_lib_kde_crash="yes"],
539 [ac_cv_lib_kde_crash="no"])
542 CPPFLAGS="${saved_cppflags}"
544 if test "${ac_cv_lib_kde_crash}" = "yes"; then
546 KDE_LIB="-lkdecore -lkdeui"
547 if test "${KDE_DIR}" != ""; then
548 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
549 KDE_INCLUDE="-I${KDE_DIR}/include"
552 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
557 if test "${PBX_KDE}" = 1; then
558 AC_PATH_TOOL(KDEINIT, kdeinit, No)
559 if test ! x"${KDEINIT}" = xNo; then
560 KDEDIR=$(${DIRNAME} ${KDEINIT})
561 KDEDIR=$(${DIRNAME} ${KDEDIR})
568 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
570 if test "${PBX_MISDN}" = 1; then
571 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
572 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
575 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
577 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
580 if test "${USE_NETSNMP}" != "no"; then
581 if test "x${NETSNMP_DIR}" != "x"; then
582 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
583 if test x"${NETSNMP_CONFIG}" = xNo; then
585 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
586 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
587 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
588 AC_MSG_NOTICE(*** including --without-netsnmp)
592 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
595 if test x"${NETSNMP_CONFIG}" != xNo; then
596 NETSNMP_libs=`net-snmp-config --agent-libs`
598 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
599 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
601 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
602 NETSNMP_LIB="${NETSNMP_libs}"
607 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
609 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
611 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
613 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
615 # possible places for oss definitions
616 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
617 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
618 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
621 if test "${USE_PGSQL}" != "no"; then
622 if test "x${PGSQL_DIR}" != "x"; then
623 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
624 if test x"${PG_CONFIG}" = xNo; then
626 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
627 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
628 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
629 AC_MSG_NOTICE(*** including --without-postgres)
633 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
636 if test "${PG_CONFIG}" != No; then
637 PGSQL_libdir=`pg_config --libdir`
638 PGSQL_includedir=`pg_config --includedir`
640 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
641 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
643 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
644 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
645 PGSQL_INCLUDE="-I${PGSQL_includedir}"
650 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
652 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
654 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
656 if test "${USE_PWLIB}" != "no"; then
657 if test ! -z "${PWLIB_DIR}"; then
658 PWLIBDIR="${PWLIB_DIR}"
661 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
663 if test "${HAS_PWLIB:-unset}" != "unset"; then
664 AST_CHECK_OPENH323_PLATFORM()
666 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
668 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
669 [Define if your system has the PWLib libraries.],
670 [#include "ptlib.h"],
671 [BOOL q = PTime::IsDaylightSavings();])
675 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
676 if test ! -z "${OPENH323_DIR}"; then
677 OPENH323DIR="${OPENH323_DIR}"
680 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
681 AST_CHECK_OPENH323_BUILD()
682 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
683 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
684 [Define if your system has the OpenH323 libraries.],
687 #include "h323ep.h"],
688 [H323EndPoint ep = H323EndPoint();],
689 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
694 if test "${USE_QT}" != "no"; then
695 AC_MSG_CHECKING(for QDate in -lqt)
697 saved_cppflags="${CPPFLAGS}"
698 if test "x${QT_DIR}" != "x"; then
699 LIBS="${LIBS} -L${QT_DIR}/lib"
700 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
707 [#include <qt3/qdatetime.h>],
710 [ac_cv_lib_qt_qt_date="yes"],
711 [ac_cv_lib_qt_qt_date="no"])
713 CPPFLAGS="${saved_cppflags}"
715 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
717 saved_cppflags="${CPPFLAGS}"
718 if test "x${QT_DIR}" != "x"; then
719 LIBS="${LIBS} -L${QT_DIR}/lib"
720 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
722 LIBS="${LIBS} -lqt-mt"
727 [#include <qt3/qdatetime.h>],
730 [ac_cv_lib_qt_qt_date="yes"],
731 [ac_cv_lib_qt_qt_date="no"])
733 CPPFLAGS="${saved_cppflags}"
736 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
742 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
744 if test "${QT_DIR}" != ""; then
745 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
746 QT_INCLUDE="-I${QT_DIR}/include"
749 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
750 AC_PATH_TOOL(QTMOC, moc, No)
756 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
758 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
760 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
762 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
764 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
765 if test "${PBX_FREETDS}" != "0";
767 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
769 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
772 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
775 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
778 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
783 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
785 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
787 if test "${host_os}" != "linux-gnu" ; then
791 # new tonezone, version 1.4.0
792 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [140])
793 # other case, old tonezone (0.80)
794 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [80])
796 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
800 if test "${USE_VPB}" != "no"; then
801 AC_MSG_CHECKING(for vpb_open in -lvpb)
803 saved_cppflags="${CPPFLAGS}"
804 if test "x${VPB_DIR}" != "x"; then
805 if test -d ${VPB_DIR}/lib; then
806 vpblibdir=${VPB_DIR}/lib
810 LIBS="${LIBS} -L${vpblibdir}"
811 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
813 LIBS="${LIBS} -lvpb -lpthread"
817 [#include <vpbapi.h>],
818 [int q = vpb_open(0,0);])
821 ac_cv_lib_vpb_vpb_open="yes"
824 ac_cv_lib_vpb_vpb_open="no"
828 CPPFLAGS="${saved_cppflags}"
829 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
831 if test "${VPB_DIR}" != ""; then
832 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
833 VPB_INCLUDE="-I${VPB_DIR}/include"
836 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
842 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
844 # check for zaptel 1.4.0
845 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
846 # or, try old zaptel (0.80 or so)
847 AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
850 if test "x$TERMCAP_LIB" != "x" ; then
851 EDITLINE_LIB="$TERMCAP_LIB"
852 elif test "x$TINFO_LIB" != "x" ; then
853 EDITLINE_LIB="$TINFO_LIB"
854 elif test "x$CURSES_LIB" != "x" ; then
855 EDITLINE_LIB="$CURSES_LIB"
856 elif test "x$NCURSES_LIB" != "x" ; then
857 EDITLINE_LIB="$NCURSES_LIB"
859 AC_MSG_ERROR(*** termcap support not found)
861 AC_SUBST(EDITLINE_LIB)
863 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
866 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
867 #include <linux/version.h>
868 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
869 #include <linux/compiler.h>
872 AC_SUBST(PBX_IXJUSER)
875 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
876 if test ! "x${GTKCONFIG}" = xNo; then
877 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
878 GTK_LIB=$(${GTKCONFIG} --libs gthread)
880 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
883 AC_SUBST(GTK_INCLUDE)
886 if test "${USE_CURL}" != "no"; then
887 AC_PATH_TOOL([CURL], [curl-config], No)
888 if test ! x"${CURL}" = xNo; then
890 if test "${host_os}" = "SunOS"; then
891 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
892 CURL_INCLUDE=$(${CURL} --cflags)
893 CURL_LIB=$(${CURL} --libs)
895 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
898 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
899 CURL_INCLUDE=$(${CURL} --cflags)
900 CURL_LIB=$(${CURL} --libs)
902 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
908 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
913 if test "x${silent}" != "xyes" ; then
915 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
916 echo " .\$7\$7.. .7\$\$7:. "
917 echo " .\$\$:. ,\$7.7 "
918 echo " .\$7. 7\$\$\$\$ .\$\$77 "
919 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
920 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
921 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
922 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
923 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
924 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
925 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
926 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
927 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
928 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
929 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
930 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
931 echo " \$\$\$\$\$ \$\$\$ "
932 echo " \$\$\$\$7. \$\$ (TM) "
933 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
934 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
935 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
939 AC_MSG_NOTICE(Package configured for: )
940 AC_MSG_NOTICE( OS type : $host_os)
941 AC_MSG_NOTICE( Host CPU : $host_cpu)
942 if test "${cross_compiling}" = "yes"; then
943 AC_MSG_NOTICE( Cross Compilation = YES)