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 # http://www.mail-archive.com/bug-make@gnu.org/msg02871.html
112 echo 'define A' > testMakefile
113 echo '12345: $(1:.idl=.hh) $(1:.idl=S.h) $(1:.idl=C.h) $(1:.idl=SK.cc) $(1:.idl=DynSK.cc)' >> testMakefile
114 echo 'endef' >> testMakefile
115 echo '$(eval $(call A,01234567890123456789012345678901.idl))' >> testMakefile
116 echo '01234567890123456789012345678901.hh:' >> testMakefile
117 echo '01234567890123456789012345678901S.h:' >> testMakefile
118 echo '01234567890123456789012345678901C.h:' >> testMakefile
119 echo '01234567890123456789012345678901SK.cc:' >> testMakefile
120 echo '01234567890123456789012345678901DynSK.cc:' >> testMakefile
121 $GNU_MAKE -r -f testMakefile 2>&1 > /dev/null
122 if test "$?" != "0" ; then
124 AC_MSG_NOTICE(********** ERROR **********)
125 AC_MSG_NOTICE(Your version of GNU Make contains a bug that will cause the Asterisk build)
126 AC_MSG_NOTICE(system to not function properly. This bug is known to be fixed in version)
127 AC_MSG_NOTICE(3.81 as well as distributions of 3.80 that contain backported bug fixes. You)
128 AC_MSG_NOTICE(must update GNU make to build Asterisk.)
129 AC_MSG_NOTICE(***************************)
134 AC_PATH_PROG([GREP], [grep], :)
135 AC_PATH_PROG([AR], [ar], :)
136 AC_PATH_PROG([FIND], [find], :)
137 AC_PATH_PROG([COMPRESS], [compress], :)
138 AC_PATH_PROG([BASENAME], [basename], :)
139 AC_PATH_PROG([DIRNAME], [dirname], :)
140 AC_PATH_PROG([SHELL], [sh], :)
141 AC_PATH_PROG([LN], [ln], :)
142 AC_PATH_PROG([DOT], [dot], :)
146 AC_ARG_ENABLE(dev-mode,
147 [ --enable-dev-mode Turn on developer mode],
148 [case "${enableval}" in
149 y|ye|yes) AST_DEVMODE=yes ;;
150 n|no) AST_DEVMODE=no ;;
151 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
153 AC_SUBST(AST_DEVMODE)
155 # package option names should be in alphabetical order
156 # by the --with option name, to make things easier for the users :-)
158 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
159 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
160 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
161 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
162 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
163 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
164 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
165 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
166 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
167 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
168 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
169 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
170 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
171 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
172 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
173 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
174 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
175 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
176 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
177 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
178 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
179 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
180 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
181 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
182 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
183 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
184 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
185 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
186 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
187 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
188 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
189 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
190 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
191 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
192 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
194 # check for basic system features and functionality before
195 # checking for package libraries
201 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])
205 # Checks for typedefs, structures, and compiler characteristics.
214 AC_CHECK_MEMBERS([struct stat.st_blksize])
218 AC_CHECK_TYPES([ptrdiff_t])
220 # Checks for library functions.
222 AC_FUNC_CLOSEDIR_VOID
223 AC_FUNC_ERROR_AT_LINE
226 AC_PROG_GCC_TRADITIONAL
227 # XXX: these are commented out until we determine whether it matters if our malloc()
228 # acts exactly like glibc's or not
234 AC_FUNC_SELECT_ARGTYPES
235 AC_FUNC_SETVBUF_REVERSED
244 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])
246 AC_MSG_CHECKING(checking for compiler atomic operations)
248 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
250 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
254 AST_GCC_ATTRIBUTE(pure)
255 AST_GCC_ATTRIBUTE(malloc)
256 AST_GCC_ATTRIBUTE(const)
257 AST_GCC_ATTRIBUTE(unused)
258 AST_GCC_ATTRIBUTE(always_inline)
260 AC_MSG_CHECKING(checking for -ffunction-sections support)
261 saved_CFLAGS="${CFLAGS}"
262 CFLAGS="${CFLAGS} -ffunction-sections"
264 AC_LANG_PROGRAM([], [int x = 1;]),
266 [saved_LDFLAGS="${LDFLAGS}"]
267 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
268 AC_MSG_CHECKING(checking for --gc-sections support)
270 AC_LANG_PROGRAM([], [int x = 1;]),
272 [GC_CFLAGS="-ffunction-sections"]
273 [[GC_LDFLAGS="-Wl,--gc-sections"]],
276 [LDFLAGS="${saved_LDFLAGS}"],
279 CFLAGS="${saved_CFLAGS}"
283 AC_MSG_CHECKING(checking for res_ninit)
285 AC_LANG_PROGRAM([#include <resolv.h>],
286 [int foo = res_ninit(NULL);]),
288 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
292 AC_MSG_CHECKING(checking for RTLD_NOLOAD)
294 AC_LANG_PROGRAM([#include <dlfcn.h>],
295 [int foo = RTLD_NOLOAD;]),
297 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
301 AC_CHECK_HEADER([libkern/OSAtomic.h],
302 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
306 # do the package library checks now
308 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
310 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
313 AC_SUBST(GSM_INTERNAL)
315 if test "${USE_GSM}" != "no"; then
316 if test "${GSM_DIR}" = "internal"; then
318 elif test "${GSM_DIR}" != ""; then
321 if test "${GSM_SYSTEM}" = "yes"; then
323 if test "x${GSM_DIR}" != "x"; then
324 if test -d ${GSM_DIR}/lib; then
325 gsmlibdir="-L${GSM_DIR}/lib"
327 gsmlibdir="-L${GSM_DIR}"
330 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
331 [Define to indicate the GSM library]), [], ${gsmlibdir})
332 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
334 if test "x${GSM_DIR}" != "x"; then
335 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
336 GSM_INCLUDE="-I${GSM_DIR}/include"
342 if test "${GSM_INTERNAL}" = "yes"; then
347 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
349 if test "${PBX_IKSEMEL}" = 1; then
350 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
351 if test "${PBX_GNUTLS}" = 1; then
352 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
356 if test "${USE_IMAP_TK}" != "no"; then
357 if test "${IMAP_TK_DIR}" = ""; then
358 IMAP_TK_DIR=`pwd`"/../imap-2004g"
360 AC_MSG_CHECKING(checking for UW IMAP Toolkit c-client library)
361 saved_cppflags="${CPPFLAGS}"
363 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
364 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
366 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
367 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
370 [#include "c-client.h"
371 void mm_searched (MAILSTREAM *stream,unsigned long number)
374 void mm_exists (MAILSTREAM *stream,unsigned long number)
377 void mm_expunged (MAILSTREAM *stream,unsigned long number)
380 void mm_flags (MAILSTREAM *stream,unsigned long number)
383 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
386 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
389 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
392 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
395 void mm_log (char *string,long errflg)
398 void mm_dlog (char *string)
401 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
404 void mm_critical (MAILSTREAM *stream)
407 void mm_nocritical (MAILSTREAM *stream)
410 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
413 void mm_fatal (char *string)
417 MAILSTREAM *foo = mail_open(NULL, "", 0);
420 [ac_cv_imap_tk="yes"],
423 if test "${ac_cv_imap_tk}" = "yes"; then
426 [#include "c-client.h"
427 void mm_searched (MAILSTREAM *stream,unsigned long number)
430 void mm_exists (MAILSTREAM *stream,unsigned long number)
433 void mm_expunged (MAILSTREAM *stream,unsigned long number)
436 void mm_flags (MAILSTREAM *stream,unsigned long number)
439 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
442 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
445 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
448 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
451 void mm_log (char *string,long errflg)
454 void mm_dlog (char *string)
457 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
460 void mm_critical (MAILSTREAM *stream)
463 void mm_nocritical (MAILSTREAM *stream)
466 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
469 void mm_fatal (char *string)
473 long check = mail_expunge_full(NULL, "", 0);
476 [ac_cv_imap_tk2006="yes"],
477 [ac_cv_imap_tk2006="no"]
480 CPPFLAGS="${saved_cppflags}"
482 if test "${ac_cv_imap_tk}" = "yes"; then
484 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
485 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
487 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
488 if test "${ac_cv_imap_tk2006}" = "yes"; then
489 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
491 elif test ! -z "${IMAP_TK_MANDATORY}"; then
494 AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
495 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
496 AC_MSG_NOTICE(*** including --without-imap.)
505 if test "${USE_KDE}" != "no"; then
506 AC_MSG_CHECKING(checking for crashHandler in -lkdecore)
508 saved_cppflags="${CPPFLAGS}"
509 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
510 if test -d ${KDE_DIR}/lib; then
511 kdelibdir="${KDE_DIR}/lib"
513 kdelibdir="${KDE_DIR}"
515 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
519 [#include "kcrash.h"],
520 [KCrash::defaultCrashHandler(1);])
522 [ac_cv_lib_kde_crash="yes"],
523 [ac_cv_lib_kde_crash="no"])
526 CPPFLAGS="${saved_cppflags}"
528 if test "${ac_cv_lib_kde_crash}" = "yes"; then
530 KDE_LIB="-lkdecore -lkdeui"
531 if test "${KDE_DIR}" != ""; then
532 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
533 KDE_INCLUDE="-I${KDE_DIR}/include"
536 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
537 elif test ! -z "${KDE_MANDATORY}"; then
540 AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
541 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
542 AC_MSG_NOTICE(*** including --without-kde.)
548 if test "${PBX_KDE}" = 1; then
549 AC_PATH_TOOL(KDEINIT, kdeinit, No)
550 if test ! x"${KDEINIT}" = xNo; then
551 KDEDIR=$(${DIRNAME} ${KDEINIT})
552 KDEDIR=$(${DIRNAME} ${KDEDIR})
559 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
561 if test "${PBX_MISDN}" = 1; then
562 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
563 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
566 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
568 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
571 if test "${USE_NETSNMP}" != "no"; then
572 if test "x${NETSNMP_DIR}" != "x"; then
573 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
574 if test x"${NETSNMP_CONFIG}" = xNo; then
576 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
577 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
578 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
579 AC_MSG_NOTICE(*** including --without-netsnmp)
583 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
586 if test x"${NETSNMP_CONFIG}" != xNo; then
587 NETSNMP_libs=`net-snmp-config --agent-libs`
589 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
590 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
592 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
593 NETSNMP_LIB="${NETSNMP_libs}"
595 elif test ! -z "${NETSNMP_MANDATORY}";
598 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
599 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
600 AC_MSG_NOTICE(*** including --without-netsnmp)
603 elif test ! -z "${NETSNMP_MANDATORY}";
606 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
607 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
608 AC_MSG_NOTICE(*** including --without-netsnmp)
612 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
614 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
616 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
618 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
621 AC_CHECK_HEADER([linux/soundcard.h],
624 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
626 if test "$PBX_OSS" = "0"; then
627 AC_CHECK_HEADER([sys/soundcard.h],
630 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
633 if test "$PBX_OSS" = "0"; then
634 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
638 if test "${USE_PGSQL}" != "no"; then
639 if test "x${PGSQL_DIR}" != "x"; then
640 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
641 if test x"${PG_CONFIG}" = xNo; then
643 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
644 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
645 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
646 AC_MSG_NOTICE(*** including --without-postgres)
650 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
653 if test "${PG_CONFIG}" != No; then
654 PGSQL_libdir=`pg_config --libdir`
655 PGSQL_includedir=`pg_config --includedir`
657 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
658 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
660 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
661 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
662 PGSQL_INCLUDE="-I${PGSQL_includedir}"
664 elif test ! -z "${PGSQL_MANDATORY}";
667 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
668 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
669 AC_MSG_NOTICE(*** including --without-postgres)
672 elif test ! -z "${PGSQL_MANDATORY}";
675 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
676 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
677 AC_MSG_NOTICE(*** including --without-postgres)
681 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
683 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
685 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
686 if test "${USE_PWLIB}" != "no"; then
687 AC_MSG_CHECKING(checking for existence of pwlib)
689 saved_cppflags="${CPPFLAGS}"
691 LIBS="${LIBS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
692 CPPFLAGS="${CPPFLAGS} -I${PWLIB_DIR}/include"
697 [#include "ptime.h"],
698 [int q = PTime::IsDaylightSaving();])
701 ac_cv_lib_pwlib="yes"
709 CPPFLAGS="${saved_cppflags}"
711 if test "${ac_cv_lib_pwlib}" = "yes"; then
712 PWLIB_LIB="-l{PLATFORM_PWLIB}"
713 if test "${PWLIB_DIR}" != ""; then
714 PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
715 PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
718 AC_DEFINE([HAVE_PWLIB], 1, [Define if your system has the pwlib libraries.])
719 elif test ! -z "${PWLIB_MANDATORY}"; then
721 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
722 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
723 AC_MSG_NOTICE(*** including --without-pwlib)
730 if test "${USE_QT}" != "no"; then
731 AC_MSG_CHECKING(checking for QDate in -lqt)
733 saved_cppflags="${CPPFLAGS}"
734 if test "x${QT_DIR}" != "x"; then
735 LIBS="${LIBS} -L${QT_DIR}/lib"
736 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
743 [#include <qt3/qdatetime.h>],
746 [ac_cv_lib_qt_qt_date="yes"],
747 [ac_cv_lib_qt_qt_date="no"])
749 CPPFLAGS="${saved_cppflags}"
751 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
753 saved_cppflags="${CPPFLAGS}"
754 if test "x${QT_DIR}" != "x"; then
755 LIBS="${LIBS} -L${QT_DIR}/lib"
756 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
758 LIBS="${LIBS} -lqt-mt"
763 [#include <qt3/qdatetime.h>],
766 [ac_cv_lib_qt_qt_date="yes"],
767 [ac_cv_lib_qt_qt_date="no"])
769 CPPFLAGS="${saved_cppflags}"
772 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
778 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
780 if test "${QT_DIR}" != ""; then
781 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
782 QT_INCLUDE="-I${QT_DIR}/include"
785 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
786 AC_PATH_TOOL(QTMOC, moc, No)
787 elif test ! -z "${QT_MANDATORY}";
790 AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
791 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
792 AC_MSG_NOTICE(*** including --without-qt.)
799 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
801 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
803 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
805 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
807 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
808 if test "${PBX_FREETDS}" != "0";
810 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
812 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
815 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
818 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
823 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
825 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
827 if test "${host_os}" != "linux-gnu" ; then
831 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
833 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
837 if test "${USE_VPB}" != "no"; then
838 AC_MSG_CHECKING(checking for vpb_open in -lvpb)
840 saved_cppflags="${CPPFLAGS}"
841 if test "x${VPB_DIR}" != "x"; then
842 if test -d ${VPB_DIR}/lib; then
843 vpblibdir=${VPB_DIR}/lib
847 LIBS="${LIBS} -L${vpblibdir}"
848 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
850 LIBS="${LIBS} -lvpb -lpthread"
854 [#include <vpbapi.h>],
855 [int q = vpb_open(0,0);])
858 ac_cv_lib_vpb_vpb_open="yes"
861 ac_cv_lib_vpb_vpb_open="no"
865 CPPFLAGS="${saved_cppflags}"
866 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
868 if test "${VPB_DIR}" != ""; then
869 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
870 VPB_INCLUDE="-I${VPB_DIR}/include"
873 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
874 elif test ! -z "${VPB_MANDATORY}"; then
876 AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
877 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
878 AC_MSG_NOTICE(*** including --without-vpb.)
885 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
887 if test "${USE_ZAPTEL}" != "no"; then
888 AC_MSG_CHECKING(checking for zt_transcode_header in zaptel.h)
889 saved_cppflags="${CPPFLAGS}"
890 if test "x${ZAPTEL_DIR}" != "x"; then
891 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
896 [#include <zaptel/zaptel.h>],
897 [struct zt_transcode_header test;])
906 CPPFLAGS="${saved_cppflags}"
907 if test "${ac_cv_zaptel_h}" = "yes"; then
908 if test "${ZAPTEL_DIR}" != ""; then
909 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
912 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
913 elif test ! -z "${ZAPTEL_MANDATORY}";
916 AC_MSG_NOTICE(*** The Zaptel 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-zaptel.)
924 if test "x$TERMCAP_LIB" != "x" ; then
925 EDITLINE_LIB="$TERMCAP_LIB"
926 elif test "x$TINFO_LIB" != "x" ; then
927 EDITLINE_LIB="$TINFO_LIB"
928 elif test "x$CURSES_LIB" != "x" ; then
929 EDITLINE_LIB="$CURSES_LIB"
930 elif test "x$NCURSES_LIB" != "x" ; then
931 EDITLINE_LIB="$NCURSES_LIB"
933 AC_MSG_ERROR(*** termcap support not found)
935 AC_SUBST(EDITLINE_LIB)
937 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
940 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
941 #include <linux/version.h>
942 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
943 #include <linux/compiler.h>
946 AC_SUBST(PBX_IXJUSER)
949 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
950 if test ! "x${GTKCONFIG}" = xNo; then
951 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
952 GTK_LIB=$(${GTKCONFIG} --libs gthread)
954 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
957 AC_SUBST(GTK_INCLUDE)
961 AC_PATH_TOOL([CURL], [curl-config], No)
962 if test ! x"${CURL}" = xNo; then
964 if test "${host_os}" = "SunOS"; then
965 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
966 CURL_INCLUDE=$(${CURL} --cflags)
967 CURL_LIB=$(${CURL} --libs)
969 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
972 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
973 CURL_INCLUDE=$(${CURL} --cflags)
974 CURL_LIB=$(${CURL} --libs)
976 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
981 AC_SUBST(CURL_INCLUDE)
984 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
987 if test "x${silent}" != "xyes" ; then
989 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
990 echo " .\$7\$7.. .7\$\$7:. "
991 echo " .\$\$:. ,\$7.7 "
992 echo " .\$7. 7\$\$\$\$ .\$\$77 "
993 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
994 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
995 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
996 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
997 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
998 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
999 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1000 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1001 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1002 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1003 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1004 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1005 echo " \$\$\$\$\$ \$\$\$ "
1006 echo " \$\$\$\$7. \$\$ (TM) "
1007 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1008 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1009 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1013 AC_MSG_NOTICE(Package configured for: )
1014 AC_MSG_NOTICE( OS type : $host_os)
1015 AC_MSG_NOTICE( Host CPU : $host_cpu)
1016 if test "${cross_compiling}" = "yes"; then
1017 AC_MSG_NOTICE( Cross Compilation = YES)