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)
84 AC_PATH_TOOL([UNAME], [uname], No)
85 if test ! x"${UNAME}" = xNo; then
86 PBX_OSREV=$(${UNAME} -r)
90 # This needs to be before any macros that use the C compiler
94 #ifndef ASTERISK_AUTOCONFIG_H
95 #define ASTERISK_AUTOCONFIG_H
97 #include "asterisk/buildopts.h"
108 # cross-compile checks
109 if test "${cross_compiling}" = "yes";
111 AC_CHECK_TOOL(CC, gcc, :)
112 AC_CHECK_TOOL(CXX, g++, :)
113 AC_CHECK_TOOL(LD, ld, :)
114 AC_CHECK_TOOL(RANLIB, ranlib, :)
115 AC_CHECK_TOOL(AR, ar, :)
118 # Checks for programs.
129 # http://www.mail-archive.com/bug-make@gnu.org/msg02871.html
130 echo 'define A' > testMakefile
131 echo '12345: $(1:.idl=.hh) $(1:.idl=S.h) $(1:.idl=C.h) $(1:.idl=SK.cc) $(1:.idl=DynSK.cc)' >> testMakefile
132 echo 'endef' >> testMakefile
133 echo '$(eval $(call A,01234567890123456789012345678901.idl))' >> testMakefile
134 echo '01234567890123456789012345678901.hh:' >> testMakefile
135 echo '01234567890123456789012345678901S.h:' >> testMakefile
136 echo '01234567890123456789012345678901C.h:' >> testMakefile
137 echo '01234567890123456789012345678901SK.cc:' >> testMakefile
138 echo '01234567890123456789012345678901DynSK.cc:' >> testMakefile
139 $GNU_MAKE -r -f testMakefile 2>&1 > /dev/null
140 if test "$?" != "0" ; then
142 AC_MSG_NOTICE(********** ERROR **********)
143 AC_MSG_NOTICE(Your version of GNU Make contains a bug that will cause the Asterisk build)
144 AC_MSG_NOTICE(system to not function properly. This bug is known to be fixed in version)
145 AC_MSG_NOTICE(3.81 as well as distributions of 3.80 that contain backported bug fixes. You)
146 AC_MSG_NOTICE(must update GNU make to build Asterisk.)
147 AC_MSG_NOTICE(***************************)
152 AC_PATH_PROG([GREP], [grep], :)
153 AC_PATH_PROG([AR], [ar], :)
154 AC_PATH_PROG([FIND], [find], :)
155 AC_PATH_PROG([COMPRESS], [compress], :)
156 AC_PATH_PROG([BASENAME], [basename], :)
157 AC_PATH_PROG([ID], [id], :)
158 AC_PATH_PROG([DIRNAME], [dirname], :)
159 AC_PATH_PROG([SHELL], [sh], :)
160 AC_PATH_PROG([LN], [ln], :)
161 AC_PATH_PROG([DOT], [dot], :)
165 AC_ARG_ENABLE(dev-mode,
166 [ --enable-dev-mode Turn on developer mode],
167 [case "${enableval}" in
168 y|ye|yes) AST_DEVMODE=yes ;;
169 n|no) AST_DEVMODE=no ;;
170 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
172 AC_SUBST(AST_DEVMODE)
174 # package option names should be in alphabetical order
175 # by the --with option name, to make things easier for the users :-)
177 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
178 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
179 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
180 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
181 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
182 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
183 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
184 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
185 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
186 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
187 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
188 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
189 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
190 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
191 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
192 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
193 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
194 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
195 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
196 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
197 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
198 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
199 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
200 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
201 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
202 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
203 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
204 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
205 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
206 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
207 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
208 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
209 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
210 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
211 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
212 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
213 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
215 # check for basic system features and functionality before
216 # checking for package libraries
222 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])
226 # Checks for typedefs, structures, and compiler characteristics.
235 AC_CHECK_MEMBERS([struct stat.st_blksize])
239 AC_CHECK_TYPES([ptrdiff_t])
241 # Checks for library functions.
243 AC_FUNC_CLOSEDIR_VOID
244 AC_FUNC_ERROR_AT_LINE
247 AC_PROG_GCC_TRADITIONAL
248 # XXX: these are commented out until we determine whether it matters if our malloc()
249 # acts exactly like glibc's or not
255 AC_FUNC_SELECT_ARGTYPES
256 AC_FUNC_SETVBUF_REVERSED
265 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])
267 AC_MSG_CHECKING(for compiler atomic operations)
269 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
271 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
275 AST_GCC_ATTRIBUTE(pure)
276 AST_GCC_ATTRIBUTE(malloc)
277 AST_GCC_ATTRIBUTE(const)
278 AST_GCC_ATTRIBUTE(unused)
279 AST_GCC_ATTRIBUTE(always_inline)
281 AC_MSG_CHECKING(for -ffunction-sections support)
282 saved_CFLAGS="${CFLAGS}"
283 CFLAGS="${CFLAGS} -ffunction-sections"
285 AC_LANG_PROGRAM([], [int x = 1;]),
287 [saved_LDFLAGS="${LDFLAGS}"]
288 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
289 AC_MSG_CHECKING(for --gc-sections support)
291 AC_LANG_PROGRAM([], [int x = 1;]),
293 [GC_CFLAGS="-ffunction-sections"]
294 [[GC_LDFLAGS="-Wl,--gc-sections"]],
297 [LDFLAGS="${saved_LDFLAGS}"],
300 CFLAGS="${saved_CFLAGS}"
304 AC_MSG_CHECKING(for res_ninit)
306 AC_LANG_PROGRAM([#include <resolv.h>],
307 [int foo = res_ninit(NULL);]),
309 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
313 AC_MSG_CHECKING(for RTLD_NOLOAD)
315 AC_LANG_PROGRAM([#include <dlfcn.h>],
316 [int foo = RTLD_NOLOAD;]),
318 AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
322 AC_CHECK_HEADER([libkern/OSAtomic.h],
323 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
327 # do the package library checks now
329 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
331 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
334 AC_SUBST(GSM_INTERNAL)
336 if test "${USE_GSM}" != "no"; then
337 if test "${GSM_DIR}" = "internal"; then
339 elif test "${GSM_DIR}" != ""; then
342 if test "${GSM_SYSTEM}" = "yes"; then
344 if test "x${GSM_DIR}" != "x"; then
345 if test -d ${GSM_DIR}/lib; then
346 gsmlibdir="-L${GSM_DIR}/lib"
348 gsmlibdir="-L${GSM_DIR}"
351 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
352 [Define to indicate the GSM library]), [], ${gsmlibdir})
353 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
355 if test "x${GSM_DIR}" != "x"; then
356 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
357 GSM_INCLUDE="-I${GSM_DIR}/include"
363 if test "${GSM_INTERNAL}" = "yes"; then
368 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
370 if test "${PBX_IKSEMEL}" = 1; then
371 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
372 if test "${PBX_GNUTLS}" = 1; then
373 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lnsl -lgpg-error"
377 if test "${USE_IMAP_TK}" != "no"; then
378 if test "${IMAP_TK_DIR}" = ""; then
379 IMAP_TK_DIR=`pwd`"/../imap-2004g"
381 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
382 saved_cppflags="${CPPFLAGS}"
384 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
385 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
387 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
388 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
391 [#include "c-client.h"
392 void mm_searched (MAILSTREAM *stream,unsigned long number)
395 void mm_exists (MAILSTREAM *stream,unsigned long number)
398 void mm_expunged (MAILSTREAM *stream,unsigned long number)
401 void mm_flags (MAILSTREAM *stream,unsigned long number)
404 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
407 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
410 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
413 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
416 void mm_log (char *string,long errflg)
419 void mm_dlog (char *string)
422 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
425 void mm_critical (MAILSTREAM *stream)
428 void mm_nocritical (MAILSTREAM *stream)
431 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
434 void mm_fatal (char *string)
438 MAILSTREAM *foo = mail_open(NULL, "", 0);
441 [ac_cv_imap_tk="yes"],
444 if test "${ac_cv_imap_tk}" = "yes"; then
447 [#include "c-client.h"
448 void mm_searched (MAILSTREAM *stream,unsigned long number)
451 void mm_exists (MAILSTREAM *stream,unsigned long number)
454 void mm_expunged (MAILSTREAM *stream,unsigned long number)
457 void mm_flags (MAILSTREAM *stream,unsigned long number)
460 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
463 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
466 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
469 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
472 void mm_log (char *string,long errflg)
475 void mm_dlog (char *string)
478 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
481 void mm_critical (MAILSTREAM *stream)
484 void mm_nocritical (MAILSTREAM *stream)
487 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
490 void mm_fatal (char *string)
494 long check = mail_expunge_full(NULL, "", 0);
497 [ac_cv_imap_tk2006="yes"],
498 [ac_cv_imap_tk2006="no"]
501 CPPFLAGS="${saved_cppflags}"
503 if test "${ac_cv_imap_tk}" = "yes"; then
505 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
506 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
508 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
509 if test "${ac_cv_imap_tk2006}" = "yes"; then
510 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
512 elif test ! -z "${IMAP_TK_MANDATORY}"; then
515 AC_MSG_NOTICE(*** The UW IMAP Toolkit installation on this system appears to be broken.)
516 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
517 AC_MSG_NOTICE(*** including --without-imap.)
526 if test "${USE_KDE}" != "no"; then
527 AC_MSG_CHECKING(for crashHandler in -lkdecore)
529 saved_cppflags="${CPPFLAGS}"
530 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
531 if test -d ${KDE_DIR}/lib; then
532 kdelibdir="${KDE_DIR}/lib"
534 kdelibdir="${KDE_DIR}"
536 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
540 [#include "kcrash.h"],
541 [KCrash::defaultCrashHandler(1);])
543 [ac_cv_lib_kde_crash="yes"],
544 [ac_cv_lib_kde_crash="no"])
547 CPPFLAGS="${saved_cppflags}"
549 if test "${ac_cv_lib_kde_crash}" = "yes"; then
551 KDE_LIB="-lkdecore -lkdeui"
552 if test "${KDE_DIR}" != ""; then
553 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
554 KDE_INCLUDE="-I${KDE_DIR}/include"
557 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
558 elif test ! -z "${KDE_MANDATORY}"; then
561 AC_MSG_NOTICE(*** The KDE installation on this system appears to be broken.)
562 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
563 AC_MSG_NOTICE(*** including --without-kde.)
569 if test "${PBX_KDE}" = 1; then
570 AC_PATH_TOOL(KDEINIT, kdeinit, No)
571 if test ! x"${KDEINIT}" = xNo; then
572 KDEDIR=$(${DIRNAME} ${KDEINIT})
573 KDEDIR=$(${DIRNAME} ${KDEDIR})
580 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
582 if test "${PBX_MISDN}" = 1; then
583 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
584 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
587 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
589 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
592 if test "${USE_NETSNMP}" != "no"; then
593 if test "x${NETSNMP_DIR}" != "x"; then
594 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
595 if test x"${NETSNMP_CONFIG}" = xNo; then
597 AC_MSG_NOTICE(*** net-snmp-config was not found in the path you specified:)
598 AC_MSG_NOTICE(*** ${NETSNMP_DIR}/bin)
599 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
600 AC_MSG_NOTICE(*** including --without-netsnmp)
604 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
607 if test x"${NETSNMP_CONFIG}" != xNo; then
608 NETSNMP_libs=`net-snmp-config --agent-libs`
610 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
611 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
613 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
614 NETSNMP_LIB="${NETSNMP_libs}"
616 elif test ! -z "${NETSNMP_MANDATORY}";
619 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
620 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
621 AC_MSG_NOTICE(*** including --without-netsnmp)
624 elif test ! -z "${NETSNMP_MANDATORY}";
627 AC_MSG_NOTICE(*** The Net-SNMP installation on this system appears to be broken.)
628 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
629 AC_MSG_NOTICE(*** including --without-netsnmp)
633 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
635 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
637 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
639 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
642 AC_CHECK_HEADER([linux/soundcard.h],
645 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
647 if test "$PBX_OSS" = "0"; then
648 AC_CHECK_HEADER([sys/soundcard.h],
651 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
654 if test "$PBX_OSS" = "0"; then
655 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
659 if test "${USE_PGSQL}" != "no"; then
660 if test "x${PGSQL_DIR}" != "x"; then
661 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
662 if test x"${PG_CONFIG}" = xNo; then
664 AC_MSG_NOTICE(*** pg_config was not found in the path you specified:)
665 AC_MSG_NOTICE(*** ${PGSQL_DIR}/bin)
666 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
667 AC_MSG_NOTICE(*** including --without-postgres)
671 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
674 if test "${PG_CONFIG}" != No; then
675 PGSQL_libdir=`pg_config --libdir`
676 PGSQL_includedir=`pg_config --includedir`
678 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
679 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
681 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
682 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt"
683 PGSQL_INCLUDE="-I${PGSQL_includedir}"
685 elif test ! -z "${PGSQL_MANDATORY}";
688 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
689 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
690 AC_MSG_NOTICE(*** including --without-postgres)
693 elif test ! -z "${PGSQL_MANDATORY}";
696 AC_MSG_NOTICE(*** The PostgreSQL installation on this system appears to be broken.)
697 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
698 AC_MSG_NOTICE(*** including --without-postgres)
702 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
704 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
706 if test "${USE_PWLIB}" != "no"; then
707 if test ! -z "${PWLIB_DIR}"; then
708 PWLIBDIR="${PWLIB_DIR}"
711 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
713 if test "${HAS_PWLIB:-unset}" != "unset"; then
714 AST_CHECK_OPENH323_PLATFORM()
716 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
718 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
719 [Define if your system has the PWLib libraries.],
720 [#include "ptlib.h"],
721 [BOOL q = PTime::IsDaylightSavings();])
725 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a ! -z "${PWLIB_MANDATORY}"; then
727 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
728 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
729 AC_MSG_NOTICE(*** including --without-pwlib)
733 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
734 if test ! -z "${OPENH323_DIR}"; then
735 OPENH323DIR="${OPENH323_DIR}"
738 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
739 AST_CHECK_OPENH323_BUILD()
740 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
741 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
742 [Define if your system has the OpenH323 libraries.],
745 #include "h323ep.h"],
746 [H323EndPoint ep = H323EndPoint();],
747 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
749 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a ! -z "${OPENH323_MANDATORY}"; then
751 AC_MSG_NOTICE(*** The PWLIB installation on this system appears to be broken.)
752 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
753 AC_MSG_NOTICE(*** including --without-pwlib)
760 if test "${USE_QT}" != "no"; then
761 AC_MSG_CHECKING(for QDate in -lqt)
763 saved_cppflags="${CPPFLAGS}"
764 if test "x${QT_DIR}" != "x"; then
765 LIBS="${LIBS} -L${QT_DIR}/lib"
766 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
773 [#include <qt3/qdatetime.h>],
776 [ac_cv_lib_qt_qt_date="yes"],
777 [ac_cv_lib_qt_qt_date="no"])
779 CPPFLAGS="${saved_cppflags}"
781 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
783 saved_cppflags="${CPPFLAGS}"
784 if test "x${QT_DIR}" != "x"; then
785 LIBS="${LIBS} -L${QT_DIR}/lib"
786 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
788 LIBS="${LIBS} -lqt-mt"
793 [#include <qt3/qdatetime.h>],
796 [ac_cv_lib_qt_qt_date="yes"],
797 [ac_cv_lib_qt_qt_date="no"])
799 CPPFLAGS="${saved_cppflags}"
802 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
808 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
810 if test "${QT_DIR}" != ""; then
811 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
812 QT_INCLUDE="-I${QT_DIR}/include"
815 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
816 AC_PATH_TOOL(QTMOC, moc, No)
817 elif test ! -z "${QT_MANDATORY}";
820 AC_MSG_NOTICE(*** The Qt installation on this system appears to be broken.)
821 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
822 AC_MSG_NOTICE(*** including --without-qt.)
829 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
831 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
833 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
835 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
837 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
838 if test "${PBX_FREETDS}" != "0";
840 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
842 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
845 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
848 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
851 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
856 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
858 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
860 if test "${host_os}" != "linux-gnu" ; then
864 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
866 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
870 if test "${USE_VPB}" != "no"; then
871 AC_MSG_CHECKING(for vpb_open in -lvpb)
873 saved_cppflags="${CPPFLAGS}"
874 if test "x${VPB_DIR}" != "x"; then
875 if test -d ${VPB_DIR}/lib; then
876 vpblibdir=${VPB_DIR}/lib
880 LIBS="${LIBS} -L${vpblibdir}"
881 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
883 LIBS="${LIBS} -lvpb -lpthread"
887 [#include <vpbapi.h>],
888 [int q = vpb_open(0,0);])
891 ac_cv_lib_vpb_vpb_open="yes"
894 ac_cv_lib_vpb_vpb_open="no"
898 CPPFLAGS="${saved_cppflags}"
899 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
901 if test "${VPB_DIR}" != ""; then
902 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
903 VPB_INCLUDE="-I${VPB_DIR}/include"
906 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
907 elif test ! -z "${VPB_MANDATORY}"; then
909 AC_MSG_NOTICE(*** The VoiceTronix (vpb) installation on this system appears to be broken.)
910 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
911 AC_MSG_NOTICE(*** including --without-vpb.)
918 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
920 if test "${USE_ZAPTEL}" != "no"; then
921 AC_MSG_CHECKING(for ZT_TONE_DTMF_BASE in zaptel.h)
922 saved_cppflags="${CPPFLAGS}"
923 if test "x${ZAPTEL_DIR}" != "x"; then
924 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
929 [#include <zaptel/zaptel.h>],
930 [int foo = ZT_TONE_DTMF_BASE;])
939 CPPFLAGS="${saved_cppflags}"
940 if test "${ac_cv_zaptel_h}" = "yes"; then
941 if test "${ZAPTEL_DIR}" != ""; then
942 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
945 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
946 elif test ! -z "${ZAPTEL_MANDATORY}";
949 AC_MSG_NOTICE(*** The Zaptel installation on this system appears to be broken.)
950 AC_MSG_NOTICE(*** Either correct the installation, or run configure)
951 AC_MSG_NOTICE(*** including --without-zaptel.)
957 if test "x$TERMCAP_LIB" != "x" ; then
958 EDITLINE_LIB="$TERMCAP_LIB"
959 elif test "x$TINFO_LIB" != "x" ; then
960 EDITLINE_LIB="$TINFO_LIB"
961 elif test "x$CURSES_LIB" != "x" ; then
962 EDITLINE_LIB="$CURSES_LIB"
963 elif test "x$NCURSES_LIB" != "x" ; then
964 EDITLINE_LIB="$NCURSES_LIB"
966 AC_MSG_ERROR(*** termcap support not found)
968 AC_SUBST(EDITLINE_LIB)
970 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
973 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
974 #include <linux/version.h>
975 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
976 #include <linux/compiler.h>
979 AC_SUBST(PBX_IXJUSER)
982 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
983 if test ! "x${GTKCONFIG}" = xNo; then
984 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
985 GTK_LIB=$(${GTKCONFIG} --libs gthread)
987 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
990 AC_SUBST(GTK_INCLUDE)
993 if test "${USE_CURL}" != "no"; then
994 AC_PATH_TOOL([CURL], [curl-config], No)
995 if test ! x"${CURL}" = xNo; then
997 if test "${host_os}" = "SunOS"; then
998 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
999 CURL_INCLUDE=$(${CURL} --cflags)
1000 CURL_LIB=$(${CURL} --libs)
1002 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1005 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
1006 CURL_INCLUDE=$(${CURL} --cflags)
1007 CURL_LIB=$(${CURL} --libs)
1009 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1015 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1018 if test "x${silent}" != "xyes" ; then
1020 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1021 echo " .\$7\$7.. .7\$\$7:. "
1022 echo " .\$\$:. ,\$7.7 "
1023 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1024 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1025 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1026 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1027 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1028 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1029 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1030 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1031 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1032 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1033 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1034 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1035 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1036 echo " \$\$\$\$\$ \$\$\$ "
1037 echo " \$\$\$\$7. \$\$ (TM) "
1038 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1039 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1040 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1044 AC_MSG_NOTICE(Package configured for: )
1045 AC_MSG_NOTICE( OS type : $host_os)
1046 AC_MSG_NOTICE( Host CPU : $host_cpu)
1047 if test "${cross_compiling}" = "yes"; then
1048 AC_MSG_NOTICE( Cross Compilation = YES)