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 # note- does not work on FreeBSD
35 ac_default_prefix=/usr/local
36 CPPFLAGS=-I/usr/local/include
37 LDFLAGS=-L/usr/local/lib
41 ac_default_prefix=/usr
42 if test ${sysconfdir} = '${prefix}/etc'; then
45 if test ${mandir} = '${prefix}/man'; then
51 if test ${localstatedir} = '${prefix}/var'; then
55 BUILD_PLATFORM=${build}
56 BUILD_CPU=${build_cpu}
57 BUILD_VENDOR=${build_vendor}
60 AC_SUBST(BUILD_PLATFORM)
62 AC_SUBST(BUILD_VENDOR)
67 HOST_VENDOR=${host_vendor}
70 AC_SUBST(HOST_PLATFORM)
96 AC_PATH_TOOL([UNAME], [uname], No)
97 if test ! x"${UNAME}" = xNo; then
98 PBX_OSREV=$(${UNAME} -r)
103 #ifndef ASTERISK_AUTOCONFIG_H
104 #define ASTERISK_AUTOCONFIG_H
106 #include "asterisk/buildopts.h"
114 # cross-compile checks
115 if test "${cross_compiling}" = "yes";
117 AC_CHECK_TOOL(CC, gcc, :)
118 AC_CHECK_TOOL(CXX, g++, :)
119 AC_CHECK_TOOL(LD, ld, :)
120 AC_CHECK_TOOL(RANLIB, ranlib, :)
121 AC_CHECK_TOOL(AR, ar, :)
124 # Checks for programs.
129 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
130 # the developers regenerating the configure script don't have to install libtool.
131 AST_PROG_LD # note, does not work on FreeBSD
139 if test "x$with_gnu_ld" = "xyes" ; then
144 AC_PATH_PROG([GREP], [grep], :)
145 AC_PATH_PROG([AR], [ar], :)
146 AC_PATH_PROG([FIND], [find], :)
147 AC_PATH_PROG([COMPRESS], [compress], :)
148 AC_PATH_PROG([BASENAME], [basename], :)
149 AC_PATH_PROG([ID], [id], :)
150 AC_PATH_PROG([DIRNAME], [dirname], :)
151 AC_PATH_PROG([SHELL], [sh], :)
152 AC_PATH_PROG([LN], [ln], :)
153 AC_PATH_PROG([DOT], [dot], :)
154 AC_PATH_PROG([STRIP], [strip], :)
155 AC_PATH_PROG([WGET], [wget], :)
156 if test "${WGET}" != ":" ; then
159 AC_PATH_PROG([FETCH], [fetch], [:])
168 AC_ARG_ENABLE(dev-mode,
169 [ --enable-dev-mode Turn on developer mode],
170 [case "${enableval}" in
171 y|ye|yes) AST_DEVMODE=yes ;;
172 n|no) AST_DEVMODE=no ;;
173 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
175 AC_SUBST(AST_DEVMODE)
177 # package option names should be in alphabetical order
178 # by the --with option name, to make things easier for the users :-)
180 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
182 # BKTR is used for backtrace support on platforms that do not
184 AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace support], [execinfo])
185 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
186 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
187 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
188 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
189 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
190 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
191 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
192 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
193 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
194 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
195 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
196 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
197 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
198 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
199 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
200 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
201 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
202 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
203 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
204 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
205 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
206 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
207 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
208 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
209 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
210 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
211 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
212 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
213 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
214 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
215 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
216 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
217 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
218 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
219 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
220 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
221 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
222 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
223 AST_EXT_LIB_SETUP([ZAPTEL_TRANSCODE], [Zaptel_transcode], [zaptel_transcode])
224 AST_EXT_LIB_SETUP([ZAPTEL_VLDTMF], [Zaptel_vldtmf], [zaptel_vldtmf])
226 # check for basic system features and functionality before
227 # checking for package libraries
233 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])
237 # Checks for typedefs, structures, and compiler characteristics.
246 AC_CHECK_MEMBERS([struct stat.st_blksize])
250 AC_CHECK_TYPES([ptrdiff_t])
252 # Checks for library functions.
254 AC_FUNC_CLOSEDIR_VOID
255 AC_FUNC_ERROR_AT_LINE
258 AC_PROG_GCC_TRADITIONAL
259 # XXX: these are commented out until we determine whether it matters if our malloc()
260 # acts exactly like glibc's or not
266 AC_FUNC_SELECT_ARGTYPES
267 AC_FUNC_SETVBUF_REVERSED
276 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])
278 # https support (in main/http.c) uses funopen on BSD systems,
279 # fopencookie on linux
280 AC_CHECK_FUNCS([funopen fopencookie])
282 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
283 AC_CHECK_FUNCS([gethostbyname_r])
285 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
286 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
288 AC_MSG_CHECKING(for compiler atomic operations)
290 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
292 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
296 AST_GCC_ATTRIBUTE(pure)
297 AST_GCC_ATTRIBUTE(malloc)
298 AST_GCC_ATTRIBUTE(const)
299 AST_GCC_ATTRIBUTE(unused)
300 AST_GCC_ATTRIBUTE(always_inline)
302 AC_MSG_CHECKING(for -ffunction-sections support)
303 saved_CFLAGS="${CFLAGS}"
304 CFLAGS="${CFLAGS} -ffunction-sections"
306 AC_LANG_PROGRAM([], [int x = 1;]),
308 [saved_LDFLAGS="${LDFLAGS}"]
309 [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
310 AC_MSG_CHECKING(for --gc-sections support)
312 AC_LANG_PROGRAM([], [int x = 1;]),
314 [GC_CFLAGS="-ffunction-sections"]
315 [[GC_LDFLAGS="-Wl,--gc-sections"]],
318 [LDFLAGS="${saved_LDFLAGS}"],
321 CFLAGS="${saved_CFLAGS}"
325 AC_MSG_CHECKING(for res_ninit)
327 AC_LANG_PROGRAM([#include <resolv.h>],
328 [int foo = res_ninit(NULL);]),
330 AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
334 AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
336 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
338 AC_CHECK_HEADER([libkern/OSAtomic.h],
339 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
343 # do the package library checks now
345 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
347 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
349 if test "x${host_os}" = "xlinux-gnu" ; then
350 AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
354 AC_SUBST(GSM_INTERNAL)
356 if test "${USE_GSM}" != "no"; then
357 if test "${GSM_DIR}" = "internal"; then
359 elif test "${GSM_DIR}" != ""; then
362 if test "${GSM_SYSTEM}" = "yes"; then
364 if test "x${GSM_DIR}" != "x"; then
365 if test -d ${GSM_DIR}/lib; then
366 gsmlibdir="-L${GSM_DIR}/lib"
368 gsmlibdir="-L${GSM_DIR}"
371 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
372 [Define to indicate the GSM library]), [], ${gsmlibdir})
373 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
374 if test "x${GSM_DIR}" != "x" ; then
375 AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
376 AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
378 AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
379 AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
381 if test "${GSM_HEADER_FOUND}" = "0" ; then
382 if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
383 if test "x${GSM_MANDATORY}" = "xyes" ; then
385 AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
386 AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
387 AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
393 if test "${GSM_HEADER_FOUND}" = "1" ; then
394 AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
397 if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
398 AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
402 if test "${GSM_OK}" = "1" ; then
404 if test "x${GSM_DIR}" != "x"; then
405 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
406 GSM_INCLUDE="-I${GSM_DIR}/include"
413 if test "${GSM_INTERNAL}" = "yes"; then
415 AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
419 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
421 if test "${PBX_IKSEMEL}" = 1; then
422 AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
423 if test "${PBX_GNUTLS}" = 1; then
424 IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lgpg-error"
428 if test "${USE_IMAP_TK}" != "no"; then
429 if test "${IMAP_TK_DIR}" = ""; then
430 IMAP_TK_DIR=`pwd`"/../imap-2004g"
431 if test -n "${IMAP_TK_MANDATORY}"; then
432 AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
433 AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
434 AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
435 AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
438 AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
439 saved_cppflags="${CPPFLAGS}"
441 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
442 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
444 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
445 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
448 [#include "c-client.h"
449 void mm_searched (MAILSTREAM *stream,unsigned long number)
452 void mm_exists (MAILSTREAM *stream,unsigned long number)
455 void mm_expunged (MAILSTREAM *stream,unsigned long number)
458 void mm_flags (MAILSTREAM *stream,unsigned long number)
461 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
464 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
467 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
470 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
473 void mm_log (char *string,long errflg)
476 void mm_dlog (char *string)
479 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
482 void mm_critical (MAILSTREAM *stream)
485 void mm_nocritical (MAILSTREAM *stream)
488 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
491 void mm_fatal (char *string)
495 MAILSTREAM *foo = mail_open(NULL, "", 0);
498 [ac_cv_imap_tk="yes"],
501 if test "${ac_cv_imap_tk}" = "yes"; then
504 [#include "c-client.h"
505 void mm_searched (MAILSTREAM *stream,unsigned long number)
508 void mm_exists (MAILSTREAM *stream,unsigned long number)
511 void mm_expunged (MAILSTREAM *stream,unsigned long number)
514 void mm_flags (MAILSTREAM *stream,unsigned long number)
517 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
520 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
523 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
526 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
529 void mm_log (char *string,long errflg)
532 void mm_dlog (char *string)
535 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
538 void mm_critical (MAILSTREAM *stream)
541 void mm_nocritical (MAILSTREAM *stream)
544 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
547 void mm_fatal (char *string)
551 long check = mail_expunge_full(NULL, "", 0);
554 [ac_cv_imap_tk2006="yes"],
555 [ac_cv_imap_tk2006="no"]
558 CPPFLAGS="${saved_cppflags}"
560 if test "${ac_cv_imap_tk}" = "yes"; then
562 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
563 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
565 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
566 if test "${ac_cv_imap_tk2006}" = "yes"; then
567 AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
576 if test "${USE_KDE}" != "no"; then
577 AC_MSG_CHECKING(for crashHandler in -lkdecore)
579 saved_cppflags="${CPPFLAGS}"
580 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
581 if test -d ${KDE_DIR}/lib; then
582 kdelibdir="${KDE_DIR}/lib"
584 kdelibdir="${KDE_DIR}"
586 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
590 [#include "kcrash.h"],
591 [KCrash::defaultCrashHandler(1);])
593 [ac_cv_lib_kde_crash="yes"],
594 [ac_cv_lib_kde_crash="no"])
597 CPPFLAGS="${saved_cppflags}"
599 if test "${ac_cv_lib_kde_crash}" = "yes"; then
601 KDE_LIB="-lkdecore -lkdeui"
602 if test "${KDE_DIR}" != ""; then
603 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
604 KDE_INCLUDE="-I${KDE_DIR}/include"
607 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
612 if test "${PBX_KDE}" = 1; then
613 AC_PATH_TOOL(KDEINIT, kdeinit, No)
614 if test ! x"${KDEINIT}" = xNo; then
615 KDEDIR=$(${DIRNAME} ${KDEINIT})
616 KDEDIR=$(${DIRNAME} ${KDEDIR})
623 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
625 if test "${PBX_MISDN}" = 1; then
626 AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
627 AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
630 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
632 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
635 if test "${USE_NETSNMP}" != "no"; then
636 if test "x${NETSNMP_DIR}" != "x"; then
637 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
638 if test x"${NETSNMP_CONFIG}" = xNo; then
640 AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
641 AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
642 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
643 AC_MSG_NOTICE([*** including --without-netsnmp])
647 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
650 if test x"${NETSNMP_CONFIG}" != xNo; then
651 NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
653 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
654 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
656 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
657 NETSNMP_LIB="${NETSNMP_libs}"
662 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
664 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
666 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
668 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
670 AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h], [-lexecinfo])
672 # possible places for oss definitions
673 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
674 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
675 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
678 if test "${USE_PGSQL}" != "no"; then
679 if test "x${PGSQL_DIR}" != "x"; then
680 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
681 if test x"${PG_CONFIG}" = xNo; then
683 AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
684 AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
685 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
686 AC_MSG_NOTICE([*** including --without-postgres])
690 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
693 if test "${PG_CONFIG}" != No; then
694 PGSQL_libdir=`${PG_CONFIG} --libdir`
695 PGSQL_includedir=`${PG_CONFIG} --includedir`
696 if test "x$?" != "x0" ; then
697 if test -n "${PGSQL_MANDATORY}" ; then
699 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
700 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
701 AC_MSG_NOTICE([*** including --without-postgres])
705 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
706 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
708 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
709 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
710 PGSQL_INCLUDE="-I${PGSQL_includedir}"
712 elif test -n "${PGSQL_MANDATORY}";
715 AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
716 AC_MSG_NOTICE([*** Either correct the installation, or run configure])
717 AC_MSG_NOTICE([*** including --without-postgres])
723 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
725 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
727 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
729 if test "${USE_PWLIB}" != "no"; then
730 if test -n "${PWLIB_DIR}"; then
731 PWLIBDIR="${PWLIB_DIR}"
734 AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
736 if test "${HAS_PWLIB:-unset}" != "unset"; then
737 AST_CHECK_OPENH323_PLATFORM()
739 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
741 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
742 [Define if your system has the PWLib libraries.],
743 [#include "ptlib.h"],
744 [BOOL q = PTime::IsDaylightSavings();])
748 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
749 if test -n "${OPENH323_DIR}"; then
750 OPENH323DIR="${OPENH323_DIR}"
753 AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
754 AST_CHECK_OPENH323_BUILD()
755 PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
756 AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
757 [Define if your system has the OpenH323 libraries.],
760 #include "h323ep.h"],
761 [H323EndPoint ep = H323EndPoint();],
762 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
767 if test "${USE_QT}" != "no"; then
768 AC_MSG_CHECKING(for QDate in -lqt)
770 saved_cppflags="${CPPFLAGS}"
771 if test "x${QT_DIR}" != "x"; then
772 LIBS="${LIBS} -L${QT_DIR}/lib"
773 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
780 [#include <qt3/qdatetime.h>],
783 [ac_cv_lib_qt_qt_date="yes"],
784 [ac_cv_lib_qt_qt_date="no"])
786 CPPFLAGS="${saved_cppflags}"
788 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
790 saved_cppflags="${CPPFLAGS}"
791 if test "x${QT_DIR}" != "x"; then
792 LIBS="${LIBS} -L${QT_DIR}/lib"
793 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
795 LIBS="${LIBS} -lqt-mt"
800 [#include <qt3/qdatetime.h>],
803 [ac_cv_lib_qt_qt_date="yes"],
804 [ac_cv_lib_qt_qt_date="no"])
806 CPPFLAGS="${saved_cppflags}"
809 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
815 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
817 if test "${QT_DIR}" != ""; then
818 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
819 QT_INCLUDE="-I${QT_DIR}/include"
822 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
823 AC_PATH_TOOL(QTMOC, moc, No)
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 # new tonezone, version 1.4.0
865 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [140])
866 # other case, old tonezone (0.80)
867 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [80])
869 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
873 if test "${USE_VPB}" != "no"; then
874 AC_MSG_CHECKING(for vpb_open in -lvpb)
876 saved_cppflags="${CPPFLAGS}"
877 if test "x${VPB_DIR}" != "x"; then
878 if test -d ${VPB_DIR}/lib; then
879 vpblibdir=${VPB_DIR}/lib
883 LIBS="${LIBS} -L${vpblibdir}"
884 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
886 LIBS="${LIBS} -lvpb -lpthread"
890 [#include <vpbapi.h>],
891 [int q = vpb_open(0,0);])
894 ac_cv_lib_vpb_vpb_open="yes"
897 ac_cv_lib_vpb_vpb_open="no"
901 CPPFLAGS="${saved_cppflags}"
902 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
904 if test "${VPB_DIR}" != ""; then
905 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
906 VPB_INCLUDE="-I${VPB_DIR}/include"
909 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
915 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
917 # Check for various zaptel features and locations.
918 # The version number, which goes into HAVE_ZAPTEL_VERSION,
919 # will be used in the system headers to determine the location
920 # of the zaptel.h header.
922 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
923 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_DIAL_OP_CANCEL], [zaptel/zaptel.h], [90])
925 # Check for VLDTMF support
926 AST_C_DEFINE_CHECK([ZAPTEL_VLDTMF], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h])
928 # Check for transcode support
929 AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
931 # On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
934 AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
935 AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],, [90])
936 AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],, [80])
938 # other case, old tonezone (0.80)
939 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel.h], [${tonezone_extra}], [80])
944 if test "x$TERMCAP_LIB" != "x" ; then
945 EDITLINE_LIB="$TERMCAP_LIB"
946 elif test "x$TINFO_LIB" != "x" ; then
947 EDITLINE_LIB="$TINFO_LIB"
948 elif test "x$CURSES_LIB" != "x" ; then
949 EDITLINE_LIB="$CURSES_LIB"
950 elif test "x$NCURSES_LIB" != "x" ; then
951 EDITLINE_LIB="$NCURSES_LIB"
953 AC_MSG_ERROR(*** termcap support not found)
955 AC_SUBST(EDITLINE_LIB)
957 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
960 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
961 #include <linux/version.h>
962 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
963 #include <linux/compiler.h>
966 AC_SUBST(PBX_IXJUSER)
969 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
970 if test ! "x${GTKCONFIG}" = xNo; then
971 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
972 GTK_LIB=$(${GTKCONFIG} --libs gthread)
974 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
977 AC_SUBST(GTK_INCLUDE)
980 if test "${USE_CURL}" != "no"; then
981 AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
982 if test ! x"${CURL_CONFIG}" = xNo; then
984 if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
985 CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
986 CURL_LIB=$(${CURL_CONFIG} --libs)
988 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
993 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
998 if test "x${silent}" != "xyes" ; then
1000 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
1001 echo " .\$7\$7.. .7\$\$7:. "
1002 echo " .\$\$:. ,\$7.7 "
1003 echo " .\$7. 7\$\$\$\$ .\$\$77 "
1004 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
1005 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
1006 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
1007 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
1008 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
1009 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
1010 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
1011 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
1012 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
1013 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
1014 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
1015 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
1016 echo " \$\$\$\$\$ \$\$\$ "
1017 echo " \$\$\$\$7. \$\$ (TM) "
1018 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
1019 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
1020 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
1024 AC_MSG_NOTICE(Package configured for: )
1025 AC_MSG_NOTICE( OS type : $host_os)
1026 AC_MSG_NOTICE( Host CPU : $host_cpu)
1027 if test "${cross_compiling}" = "yes"; then
1028 AC_MSG_NOTICE( Cross Compilation = YES)