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
16 # check existence of the package
17 AC_CONFIG_SRCDIR([asterisk.c])
19 # specify output header file
20 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
22 AC_COPYRIGHT("Asterisk")
23 AC_REVISION($Revision$)
27 ac_default_prefix=/usr/local
30 ac_default_prefix=/usr
31 if test ${sysconfdir} = '${prefix}/etc'; then
34 if test ${mandir} = '${prefix}/man'; then
40 if test ${localstatedir} = '${prefix}/var'; then
45 AC_DEFINE_UNQUOTED(PBX_PLATFORM, "${host}",
46 [Define this to be the canonical name (cpu-vendor-os) of your system.])
47 AC_DEFINE_UNQUOTED(PBX_CPU, "${host_cpu}",
48 [Define this to be the name of the CPU of your system.])
49 AC_DEFINE_UNQUOTED(PBX_VENDOR, "${host_vendor}",
50 [Define this to be the name of the vendor of your system.])
51 AC_DEFINE_UNQUOTED(PBX_OS, "${host_os}",
52 [Define this to be the name of the OS of your system.])
54 # export some useful defines
57 PBX_VENDOR=${host_vendor}
59 AC_SUBST(PBX_PLATFORM)
65 AC_PATH_TOOL([UNAME], [uname], No)
66 if test ! x"${UNAME}" = xNo; then
67 PBX_OSREV=$(${UNAME} -r)
73 cygwin*|mingw*|windows*|winnt)
75 [Define according to your operating system type.])
83 [Define according to your operating system type.])
88 [Define according to your operating system type.])
93 [Define according to your operating system type.])
95 # XXX temporary hack to let FreeBSD use the default paths
96 # for local stuff. We need a better solution.
97 if test x"${CPPFLAGS}" = x; then
98 CPPFLAGS="-I/usr/local/include"
100 if test x"${LDFLAGS}" = x; then
101 LDFLAGS="-L/usr/local/lib"
105 AC_DEFINE(OpenBSD, 1,
106 [Define according to your operating system type.])
111 [Define according to your operating system type.])
116 [Define according to your operating system type.])
121 [Define according to your operating system type.])
127 # This needs to be before any macros that use the C compiler
131 #ifndef ASTERISK_AUTOCONFIG_H
132 #define ASTERISK_AUTOCONFIG_H
135 #include "asterisk/buildopts.h"
147 # cross-compile checks
148 if test x"${build}" != x"${host}";
150 AC_CHECK_TOOL(CC, gcc, :)
151 AC_CHECK_TOOL(CXX, g++, :)
152 AC_CHECK_TOOL(RANLIB, ranlib, :)
153 AC_CHECK_TOOL(AR, ar, :)
155 if test x"${PBX_OSTYPE}" = xWin32;
157 AC_CHECK_TOOL(NM, nm, :)
158 AC_CHECK_TOOL(WINDRES, windres, :)
159 AC_CHECK_TOOL(DLLWRAP, dllwrap, :)
164 # Checks for programs.
175 AC_PATH_PROG([GREP], [grep], :)
176 AC_PATH_PROG([AR], [ar], :)
177 AC_PATH_PROG([FIND], [find], :)
178 AC_PATH_PROG([COMPRESS], [compress], :)
179 AC_PATH_PROG([BASENAME], [basename], :)
180 AC_PATH_PROG([DIRNAME], [dirname], :)
181 AC_PATH_PROG([SHELL], [sh], :)
182 AC_PATH_PROG([LN], [ln], :)
183 AC_PATH_PROG([DOT], [dot], :)
187 AC_ARG_ENABLE(dev-mode,
188 [ --enable-dev-mode Turn on developer mode],
189 [case "${enableval}" in
190 y|ye|yes) AST_DEVMODE=yes ;;
191 n|no) AST_DEVMODE=no ;;
192 *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
194 AC_SUBST(AST_DEVMODE)
196 # package option names should be in alphabetical order
197 # by the --with option name, to make things easier for the users :-)
199 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
200 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
201 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
202 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
203 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
204 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
205 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
206 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
207 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
208 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
209 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
210 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
211 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
212 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
213 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
214 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
215 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
216 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
217 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
218 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
219 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
220 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
221 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
222 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
223 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
224 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
225 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
226 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
227 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
228 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
229 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
231 # check for basic system features and functionality before
232 # checking for package libraries
238 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])
242 # Checks for typedefs, structures, and compiler characteristics.
251 AC_CHECK_MEMBERS([struct stat.st_blksize])
255 AC_CHECK_TYPES([ptrdiff_t])
257 # Checks for library functions.
259 AC_FUNC_CLOSEDIR_VOID
260 AC_FUNC_ERROR_AT_LINE
263 AC_PROG_GCC_TRADITIONAL
269 AC_FUNC_SELECT_ARGTYPES
270 AC_FUNC_SETVBUF_REVERSED
279 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])
281 echo -n "checking for compiler atomic operations... "
283 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
285 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
289 AC_CHECK_HEADER([libkern/OSAtomic.h],
290 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
294 # do the package library checks now
296 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
298 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
302 if test "${USE_GSM}" != "no"; then
303 if test "${GSM_DIR}" = "internal"; then
305 elif test "${GSM_DIR}" != ""; then
308 if test "${GSM_SYSTEM}" = "yes"; then
310 if test "x${GSM_DIR}" != "x"; then
311 if test -d ${GSM_DIR}/lib; then
312 gsmlibdir="-L${GSM_DIR}/lib"
314 gsmlibdir="-L${GSM_DIR}"
317 AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
318 [Define to indicate the GSM library]), [], ${gsmlibdir})
319 if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
321 if test "x${GSM_DIR}" != "x"; then
322 GSM_LIB="${gsmlibdir} ${GSM_LIB}"
323 GSM_INCLUDE="-I${GSM_DIR}/include"
329 if test "${GSM_INTERNAL}" = "yes"; then
335 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
337 if test "${USE_IMAP_TK}" != "no"; then
338 if test "${IMAP_TK_DIR}" = ""; then
339 IMAP_TK_DIR=`pwd`"/../imap-2004g"
341 echo -n "checking for UW IMAP Toolkit c-client library... "
342 saved_cppflags="${CPPFLAGS}"
344 if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
345 imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
347 CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
348 LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
351 [#include "c-client.h"],
353 void mm_searched (MAILSTREAM *stream,unsigned long number)
356 void mm_exists (MAILSTREAM *stream,unsigned long number)
359 void mm_expunged (MAILSTREAM *stream,unsigned long number)
362 void mm_flags (MAILSTREAM *stream,unsigned long number)
365 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
368 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
371 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
374 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
377 void mm_log (char *string,long errflg)
380 void mm_dlog (char *string)
383 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
386 void mm_critical (MAILSTREAM *stream)
389 void mm_nocritical (MAILSTREAM *stream)
392 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
395 void mm_fatal (char *string)
400 MAILSTREAM *foo = mail_open(NULL, "", 0);
404 [ac_cv_imap_tk="yes"],
407 CPPFLAGS="${saved_cppflags}"
409 if test "${ac_cv_imap_tk}" = "yes"; then
411 IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
412 IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
414 AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
415 elif test ! -z "${IMAP_TK_MANDATORY}"; then
418 echo "*** The UW IMAP Toolkit installation on this system appears to be broken."
419 echo "*** Either correct the installation, or run configure"
420 echo "*** including --without-imap."
429 if test "${USE_KDE}" != "no"; then
430 echo -n "checking for crashHandler in -lkdecore... "
432 saved_cppflags="${CPPFLAGS}"
433 CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
434 if test -d ${KDE_DIR}/lib; then
435 kdelibdir="${KDE_DIR}/lib"
437 kdelibdir="${KDE_DIR}"
439 LIBS="${LIBS} -L${kdelibdir} -lkdecore"
443 [#include "kcrash.h"],
444 [KCrash::defaultCrashHandler(1);])
446 [ac_cv_lib_kde_crash="yes"],
447 [ac_cv_lib_kde_crash="no"])
450 CPPFLAGS="${saved_cppflags}"
452 if test "${ac_cv_lib_kde_crash}" = "yes"; then
454 KDE_LIB="-lkdecore -lkdeui"
455 if test "${KDE_DIR}" != ""; then
456 KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
457 KDE_INCLUDE="-I${KDE_DIR}/include"
460 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
461 elif test ! -z "${KDE_MANDATORY}"; then
464 echo "*** The KDE installation on this system appears to be broken."
465 echo "*** Either correct the installation, or run configure"
466 echo "*** including --without-kde."
472 if test "${PBX_KDE}" = 1; then
473 AC_PATH_TOOL(KDEINIT, kdeinit, No)
474 if test ! x"${KDEINIT}" = xNo; then
475 KDEDIR=$(${DIRNAME} ${KDEINIT})
476 KDEDIR=$(${DIRNAME} ${KDEDIR})
483 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
485 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
488 if test "${USE_NETSNMP}" != "no"; then
489 if test "x${NETSNMP_DIR}" != "x"; then
490 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
491 if test x"${NETSNMP_CONFIG}" = xNo; then
493 echo "*** net-snmp-config was not found in the path you specified:"
494 echo "*** ${NETSNMP_DIR}/bin"
495 echo "*** Either correct the installation, or run configure"
496 echo "*** including --without-netsnmp"
500 AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
503 if test x"${NETSNMP_CONFIG}" != xNo; then
504 NETSNMP_libs=`net-snmp-config --agent-libs`
506 AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
507 [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
509 if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
510 NETSNMP_LIB="${NETSNMP_libs}"
512 elif test ! -z "${NETSNMP_MANDATORY}";
515 echo "*** The Net-SNMP installation on this system appears to be broken."
516 echo "*** Either correct the installation, or run configure"
517 echo "*** including --without-netsnmp"
520 elif test ! -z "${NETSNMP_MANDATORY}";
523 echo "*** The Net-SNMP installation on this system appears to be broken."
524 echo "*** Either correct the installation, or run configure"
525 echo "*** including --without-netsnmp"
529 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
531 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h])
533 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
535 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
538 AC_CHECK_HEADER([linux/soundcard.h],
541 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
543 if test "$PBX_OSS" = "0"; then
544 AC_CHECK_HEADER([sys/soundcard.h],
547 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
550 if test "$PBX_OSS" = "0"; then
551 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
555 if test "${USE_PGSQL}" != "no"; then
556 if test "x${PGSQL_DIR}" != "x"; then
557 AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
558 if test x"${PG_CONFIG}" = xNo; then
560 echo "*** pg_config was not found in the path you specified:"
561 echo "*** ${PGSQL_DIR}/bin"
562 echo "*** Either correct the installation, or run configure"
563 echo "*** including --without-postgres"
567 AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
570 if test "${PG_CONFIG}" != No; then
571 PGSQL_libdir=`pg_config --libdir`
572 PGSQL_includedir=`pg_config --includedir`
574 AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
575 [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
577 if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
578 PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
579 PGSQL_INCLUDE="-I${PGSQL_includedir}"
581 elif test ! -z "${PGSQL_MANDATORY}";
584 echo "*** The PostgreSQL installation on this system appears to be broken."
585 echo "*** Either correct the installation, or run configure"
586 echo "*** including --without-postgres"
589 elif test ! -z "${PGSQL_MANDATORY}";
592 echo "*** The PostgreSQL installation on this system appears to be broken."
593 echo "*** Either correct the installation, or run configure"
594 echo "*** including --without-postgres"
598 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
600 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
602 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
603 if test "${USE_PWLIB}" != "no"; then
604 echo -n "checking for existence of pwlib... "
606 saved_cppflags="${CPPFLAGS}"
608 LIBS="${LIBS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
609 CPPFLAGS="${CPPFLAGS} -I${PWLIB_DIR}/include"
614 [#include "ptime.h"],
615 [int q = PTime::IsDaylightSaving();])
618 ac_cv_lib_pwlib="yes"
626 CPPFLAGS="${saved_cppflags}"
628 if test "${ac_cv_lib_pwlib}" = "yes"; then
629 PWLIB_LIB="-l{PLATFORM_PWLIB}"
630 if test "${PWLIB_DIR}" != ""; then
631 PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
632 PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
635 AC_DEFINE([HAVE_PWLIB], 1, [Define if your system has the pwlib libraries.])
636 elif test ! -z "${PWLIB_MANDATORY}"; then
638 echo "*** The PWLIB installation on this system appears to be broken."
639 echo "*** Either correct the installation, or run configure"
640 echo "*** including --without-pwlib"
647 if test "${USE_QT}" != "no"; then
648 echo -n "checking for QDate in -lqt... "
650 saved_cppflags="${CPPFLAGS}"
651 if test "x${QT_DIR}" != "x"; then
652 LIBS="${LIBS} -L${QT_DIR}/lib"
653 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
660 [#include <qt3/qdatetime.h>],
663 [ac_cv_lib_qt_qt_date="yes"],
664 [ac_cv_lib_qt_qt_date="no"])
666 CPPFLAGS="${saved_cppflags}"
668 if test "${ac_cv_lib_qt_qt_date}" = "no"; then
670 saved_cppflags="${CPPFLAGS}"
671 if test "x${QT_DIR}" != "x"; then
672 LIBS="${LIBS} -L${QT_DIR}/lib"
673 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
675 LIBS="${LIBS} -lqt-mt"
680 [#include <qt3/qdatetime.h>],
683 [ac_cv_lib_qt_qt_date="yes"],
684 [ac_cv_lib_qt_qt_date="no"])
686 CPPFLAGS="${saved_cppflags}"
689 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
695 if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
697 if test "${QT_DIR}" != ""; then
698 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
699 QT_INCLUDE="-I${QT_DIR}/include"
702 AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
703 AC_PATH_TOOL(QTMOC, moc, No)
704 elif test ! -z "${QT_MANDATORY}";
707 echo "*** The Qt installation on this system appears to be broken."
708 echo "*** Either correct the installation, or run configure"
709 echo "*** including --without-qt."
716 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
718 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
720 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
722 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
724 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
725 if test "${PBX_FREETDS}" != "0";
727 case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
729 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
732 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
735 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
740 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
742 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
744 if test "${PBX_OSTYPE}" != "Linux" ; then
748 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
750 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
754 if test "${USE_VPB}" != "no"; then
755 echo -n "checking for vpb_open in -lvpb... "
757 saved_cppflags="${CPPFLAGS}"
758 if test "x${VPB_DIR}" != "x"; then
759 if test -d ${VPB_DIR}/lib; then
760 vpblibdir=${VPB_DIR}/lib
764 LIBS="${LIBS} -L${vpblibdir}"
765 CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
767 LIBS="${LIBS} -lvpb -lpthread"
771 [#include <vpbapi.h>],
772 [int q = vpb_open(0,0);])
775 ac_cv_lib_vpb_vpb_open="yes"
778 ac_cv_lib_vpb_vpb_open="no"
782 CPPFLAGS="${saved_cppflags}"
783 if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
785 if test "${VPB_DIR}" != ""; then
786 VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
787 VPB_INCLUDE="-I${VPB_DIR}/include"
790 AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
791 elif test ! -z "${VPB_MANDATORY}"; then
793 echo "*** The VoiceTronix (vpb) installation on this system appears to be broken."
794 echo "*** Either correct the installation, or run configure"
795 echo "*** including --without-vpb."
802 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
804 if test "${USE_ZAPTEL}" != "no"; then
805 echo -n "checking for zt_transcode_header in zaptel.h... "
806 saved_cppflags="${CPPFLAGS}"
807 if test "x${ZAPTEL_DIR}" != "x"; then
808 CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
813 [#include <zaptel/zaptel.h>],
814 [struct zt_transcode_header test;])
823 CPPFLAGS="${saved_cppflags}"
824 if test "${ac_cv_zaptel_h}" = "yes"; then
825 if test "${ZAPTEL_DIR}" != ""; then
826 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
829 AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
830 elif test ! -z "${ZAPTEL_MANDATORY}";
833 echo "*** The Zaptel installation on this system appears to be broken."
834 echo "*** Either correct the installation, or run configure"
835 echo "*** including --without-zaptel."
841 if test "x$TERMCAP_LIB" != "x" ; then
842 EDITLINE_LIB="$TERMCAP_LIB"
843 elif test "x$TINFO_LIB" != "x" ; then
844 EDITLINE_LIB="$TINFO_LIB"
845 elif test "x$CURSES_LIB" != "x" ; then
846 EDITLINE_LIB="$CURSES_LIB"
847 elif test "x$NCURSES_LIB" != "x" ; then
848 EDITLINE_LIB="$NCURSES_LIB"
850 echo "*** termcap support not found"
853 AC_SUBST(EDITLINE_LIB)
855 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
858 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
859 #include <linux/version.h>
860 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
861 #include <linux/compiler.h>
864 AC_SUBST(PBX_IXJUSER)
867 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
868 if test ! "x${GTKCONFIG}" = xNo; then
869 GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
870 GTK_LIB=$(${GTKCONFIG} --libs gthread)
872 AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
875 AC_SUBST(GTK_INCLUDE)
879 AC_PATH_TOOL([CURL], [curl-config], No)
880 if test ! x"${CURL}" = xNo; then
882 if test $PBX_OSTYPE = "SunOS"; then
883 if [[ 0x`curl-config --vernum` -ge 0x70907 ]]; then
884 CURLLIB=$(${CURL} --libs)
886 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
889 if [[[ 0x`curl-config --vernum` -ge 0x70907 ]]]; then
890 CURLLIB=$(${CURL} --libs)
892 AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
899 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
903 echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
904 echo " .\$7\$7.. .7\$\$7:. "
905 echo " .\$\$:. ,\$7.7 "
906 echo " .\$7. 7\$\$\$\$ .\$\$77 "
907 echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
908 echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
909 echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
910 echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
911 echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
912 echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
913 echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
914 echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
915 echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
916 echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
917 echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
918 echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
919 echo " \$\$\$\$\$ \$\$\$ "
920 echo " \$\$\$\$7. \$\$ (TM) "
921 echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
922 echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
923 echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
926 echo "Package configured for: "
927 echo " OS type : $PBX_OSTYPE"
928 echo " Host CPU : $host_cpu"
929 if test "x${crossCompile}" = xYes; then
931 echo " Cross Compilation = YES"
932 echo " Target = ${host}"