Merged revisions 65682 via svnmerge from
[asterisk-bristuff.git] / configure.ac
blob8846c476ee7cd6f3d208e6646a948198c0aba8a4
1 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.60)
5 m4_define([PBX_VERSION],
6           m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
7                        [\([0-9.]*\)\(\w\|\W\)*],
8                        [\1]))
9 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
11 # cross-compile macros
12 AC_CANONICAL_BUILD
13 AC_CANONICAL_HOST
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$)
24 AC_GNU_SOURCE
25 AC_USE_SYSTEM_EXTENSIONS
27 case "${host_os}" in
28      freebsd*)
29      ac_default_prefix=/usr/local
30      CPPFLAGS=-I/usr/local/include
31      LDFLAGS=-L/usr/local/lib
32      ;;
33      *)
34      ac_default_prefix=/usr
35      if test ${sysconfdir} = '${prefix}/etc'; then
36         sysconfdir=/etc
37      fi
38      if test ${mandir} = '${prefix}/man'; then
39         mandir=/usr/share/man
40      fi
41      ;;
42 esac
44 if test ${localstatedir} = '${prefix}/var'; then
45      localstatedir=/var
48 BUILD_PLATFORM=${build}
49 BUILD_CPU=${build_cpu}
50 BUILD_VENDOR=${build_vendor}
51 BUILD_OS=${build_os}
53 AC_SUBST(BUILD_PLATFORM)
54 AC_SUBST(BUILD_CPU)
55 AC_SUBST(BUILD_VENDOR)
56 AC_SUBST(BUILD_OS)
58 HOST_PLATFORM=${host}
59 HOST_CPU=${host_cpu}
60 HOST_VENDOR=${host_vendor}
61 HOST_OS=${host_os}
63 AC_SUBST(HOST_PLATFORM)
64 AC_SUBST(HOST_CPU)
65 AC_SUBST(HOST_VENDOR)
66 AC_SUBST(HOST_OS)
68 case "${host_os}" in
69      freebsd*)
70      OSARCH=FreeBSD
71      ;;
72      netbsd*)
73      OSARCH=NetBSD
74      ;;
75      openbsd*)
76      OSARCH=OpenBSD
77      ;;
78      solaris*)
79      OSARCH=SunOS
80      ;;
81      *)
82      OSARCH=${HOST_OS}
83      ;;
84 esac
86 AC_SUBST(OSARCH)
88 #  check for uname
89 AC_PATH_TOOL([UNAME], [uname], No)
90 if test ! x"${UNAME}" = xNo; then
91    PBX_OSREV=$(${UNAME} -r)
93 AC_SUBST(PBX_OSREV)
95 AH_TOP(
96 #ifndef ASTERISK_AUTOCONFIG_H
97 #define ASTERISK_AUTOCONFIG_H
99 #include "asterisk/buildopts.h"
103 AH_BOTTOM(
104 #endif
107 # cross-compile checks
108 if test "${cross_compiling}" = "yes"; 
109 then
110    AC_CHECK_TOOL(CC, gcc, :)
111    AC_CHECK_TOOL(CXX, g++, :)
112    AC_CHECK_TOOL(LD, ld, :)
113    AC_CHECK_TOOL(RANLIB, ranlib, :)
114    AC_CHECK_TOOL(AR, ar, :)
117 # Checks for programs.
118 AC_PROG_CC
119 AC_PROG_CXX
120 AC_PROG_CPP
121 AC_PROG_CXXCPP
122 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
123 # the developers regenerating the configure script don't have to install libtool.
124 AST_PROG_LD
125 AC_PROG_AWK
126 AC_PROG_INSTALL
127 AC_PROG_LN_S
128 AC_PROG_RANLIB
129 AST_CHECK_GNU_MAKE
131 GNU_LD=0
132 if test "x$with_gnu_ld" = "xyes" ; then
133    GNU_LD=1
135 AC_SUBST(GNU_LD)
137 AC_PATH_PROG([GREP], [grep], :)
138 AC_PATH_PROG([AR], [ar], :)
139 AC_PATH_PROG([FIND], [find], :)
140 AC_PATH_PROG([COMPRESS], [compress], :)
141 AC_PATH_PROG([BASENAME], [basename], :)
142 AC_PATH_PROG([ID], [id], :)
143 AC_PATH_PROG([DIRNAME], [dirname], :)
144 AC_PATH_PROG([SHELL], [sh], :)
145 AC_PATH_PROG([LN], [ln], :)
146 AC_PATH_PROG([DOT], [dot], :)
147 AC_PATH_PROG([STRIP], [strip], :)
148 AC_PATH_PROG([WGET], [wget], :)
149 if test "${WGET}" != ":" ; then
150   DOWNLOAD=${WGET}
151 else
152   AC_PATH_PROG([FETCH], [fetch], [:])
153   DOWNLOAD=${FETCH}
155 AC_SUBST(DOWNLOAD)
157 ACX_PTHREAD
159 AC_LANG(C)
161 AC_ARG_ENABLE(dev-mode,
162         [  --enable-dev-mode    Turn on developer mode],
163         [case "${enableval}" in
164               y|ye|yes) AST_DEVMODE=yes ;;
165               n|no)  AST_DEVMODE=no ;;
166               *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
167         esac])
168 AC_SUBST(AST_DEVMODE)
170 # package option names should be in alphabetical order
171 # by the --with option name, to make things easier for the users :-)
173 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
174 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
175 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
176 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
177 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
178 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
179 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
180 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
181 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
182 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
183 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
184 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
185 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
186 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
187 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
188 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
189 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
190 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
191 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
192 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
193 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
194 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
195 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
196 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
197 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
198 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
199 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
200 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
201 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
202 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
203 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
204 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
205 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
206 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
207 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
208 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
209 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
211 # check for basic system features and functionality before
212 # checking for package libraries
214 AC_FUNC_ALLOCA
215 AC_HEADER_DIRENT
216 AC_HEADER_STDC
217 AC_HEADER_SYS_WAIT
218 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h])
220 AC_SYS_LARGEFILE
222 # Checks for typedefs, structures, and compiler characteristics.
223 AC_HEADER_STDBOOL
224 AC_C_CONST
225 AC_TYPE_UID_T
226 AC_C_INLINE
227 AC_TYPE_MODE_T
228 AC_TYPE_OFF_T
229 AC_TYPE_PID_T
230 AC_TYPE_SIZE_T
231 AC_CHECK_MEMBERS([struct stat.st_blksize])
232 AC_HEADER_TIME
233 AC_STRUCT_TM
234 AC_C_VOLATILE
235 AC_CHECK_TYPES([ptrdiff_t])
237 # Checks for library functions.
238 AC_FUNC_CHOWN
239 AC_FUNC_CLOSEDIR_VOID
240 AC_FUNC_ERROR_AT_LINE
241 AST_FUNC_FORK
242 AC_FUNC_FSEEKO
243 AC_PROG_GCC_TRADITIONAL
244 # XXX: these are commented out until we determine whether it matters if our malloc()
245 # acts exactly like glibc's or not
246 # AC_FUNC_MALLOC
247 # AC_FUNC_REALLOC
248 AC_FUNC_MEMCMP
249 AC_FUNC_MKTIME
250 AC_FUNC_MMAP
251 AC_FUNC_SELECT_ARGTYPES
252 AC_FUNC_SETVBUF_REVERSED
253 AC_TYPE_SIGNAL
254 AC_FUNC_STAT
255 AC_FUNC_STRCOLL
256 AC_FUNC_STRFTIME
257 AC_FUNC_STRNLEN
258 AC_FUNC_STRTOD
259 AC_FUNC_UTIME_NULL
260 AC_FUNC_VPRINTF
261 AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf])
263 AC_MSG_CHECKING(for PTHREAD_RWLOCK_INITIALIZER)
264 AC_LINK_IFELSE(
265         AC_LANG_PROGRAM([#include <pthread.h>],
266                         [int foo = PTHREAD_RWLOCK_INITIALIZER;]),
267         AC_MSG_RESULT(yes)
268         AC_DEFINE([HAVE_PTHREAD_RWLOCK_INITIALIZER], 1, [Define to 1 if your system has PTHREAD_RWLOCK_INITIALIZER.]),
269         AC_MSG_RESULT(no)
272 AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP)
273 AC_LINK_IFELSE(
274         AC_LANG_PROGRAM([#include <pthread.h>],
275                         [int foo = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
276         AC_MSG_RESULT(yes)
277         AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system has PTHREAD_RWLOCK_PREFER_WRITER_NP.]),
278         AC_MSG_RESULT(no)
281 AC_MSG_CHECKING(for compiler atomic operations)
282 AC_LINK_IFELSE(
283 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
284 AC_MSG_RESULT(yes)
285 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
286 AC_MSG_RESULT(no)
289 AST_GCC_ATTRIBUTE(pure)
290 AST_GCC_ATTRIBUTE(malloc)
291 AST_GCC_ATTRIBUTE(const)
292 AST_GCC_ATTRIBUTE(unused)
293 AST_GCC_ATTRIBUTE(always_inline)
295 AC_MSG_CHECKING(for -ffunction-sections support)
296 saved_CFLAGS="${CFLAGS}"
297 CFLAGS="${CFLAGS} -ffunction-sections"
298 AC_COMPILE_IFELSE(
299         AC_LANG_PROGRAM([], [int x = 1;]),
300         AC_MSG_RESULT(yes)
301         [saved_LDFLAGS="${LDFLAGS}"]
302         [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
303         AC_MSG_CHECKING(for --gc-sections support)
304         AC_LINK_IFELSE(
305                 AC_LANG_PROGRAM([], [int x = 1;]),
306                 AC_MSG_RESULT(yes)
307                 [GC_CFLAGS="-ffunction-sections"]
308                 [[GC_LDFLAGS="-Wl,--gc-sections"]],
309                 AC_MSG_RESULT(no)
310         )
311         [LDFLAGS="${saved_LDFLAGS}"],
312         AC_MSG_RESULT(no)
314 CFLAGS="${saved_CFLAGS}"
315 AC_SUBST(GC_CFLAGS)
316 AC_SUBST(GC_LDFLAGS)
318 AC_MSG_CHECKING(for res_ninit)
319 AC_LINK_IFELSE(
320         AC_LANG_PROGRAM([#include <resolv.h>],
321                         [int foo = res_ninit(NULL);]),
322         AC_MSG_RESULT(yes)
323         AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
324         AC_MSG_RESULT(no)
327 AC_MSG_CHECKING(for RTLD_NOLOAD)
328 AC_LINK_IFELSE(
329         AC_LANG_PROGRAM([#include <dlfcn.h>],
330                         [int foo = RTLD_NOLOAD;]),
331         AC_MSG_RESULT(yes)
332         AC_DEFINE([HAVE_RTLD_NOLOAD], 1, [Define to 1 if your system has a dynamic linker that supports RTLD_NOLOAD.]),
333         AC_MSG_RESULT(no)
336 AC_MSG_CHECKING(for IP_MTU_DISCOVER)
337 AC_LINK_IFELSE(
338         AC_LANG_PROGRAM([#include <netinet/in.h>],
339                         [int foo = IP_MTU_DISCOVER;]),
340         AC_MSG_RESULT(yes)
341         AC_DEFINE([HAVE_IP_MTU_DISCOVER], 1, [Define to 1 if your system has PMTU discovery on UDP sockets.]),
342         AC_MSG_RESULT(no)
345 AC_CHECK_HEADER([libkern/OSAtomic.h],
346                 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
348 AC_CHECK_SIZEOF(int)
350 # do the package library checks now
352 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
354 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
356 GSM_INTERNAL="yes"
357 AC_SUBST(GSM_INTERNAL)
358 GSM_SYSTEM="yes"
359 if test "${USE_GSM}" != "no"; then
360    if test "${GSM_DIR}" = "internal"; then
361       GSM_SYSTEM="no"
362    elif test "${GSM_DIR}" != ""; then
363       GSM_INTERNAL="no"
364    fi
365    if test "${GSM_SYSTEM}" = "yes"; then
366       gsmlibdir=""
367       if test "x${GSM_DIR}" != "x"; then
368          if test -d ${GSM_DIR}/lib; then
369             gsmlibdir="-L${GSM_DIR}/lib"
370          else
371             gsmlibdir="-L${GSM_DIR}"
372          fi
373       fi
374       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
375       [Define to indicate the GSM library]), [], ${gsmlibdir})
376       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
377          if test "x${GSM_DIR}" != "x" ; then
378             AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
379             AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
380          else
381             AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
382             AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
383          fi
384          if test "${GSM_HEADER_FOUND}" = "0" ; then
385             if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
386                if test "x${GSM_MANDATORY}" = "xyes" ; then
387                   AC_MSG_NOTICE([***])
388                   AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
389                   AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
390                   AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
391                   exit 1
392                fi
393             fi
394          fi
395          GSM_OK=0
396          if test "${GSM_HEADER_FOUND}" = "1" ; then
397             AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
398             GSM_OK=1
399          else
400             if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
401                AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
402                GSM_OK=1
403             fi
404          fi
405          if test "${GSM_OK}" = "1" ; then
406             GSM_LIB="-lgsm"
407             if test "x${GSM_DIR}" != "x"; then
408                GSM_LIB="${gsmlibdir} ${GSM_LIB}"
409                GSM_INCLUDE="-I${GSM_DIR}/include"
410             fi
411             PBX_GSM=1
412             GSM_INTERNAL="no"
413          fi
414       fi
415    fi
416    if test "${GSM_INTERNAL}" = "yes"; then
417       PBX_GSM=1
418       AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
419    fi
422 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
424 if test "${PBX_IKSEMEL}" = 1; then
425    AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
426    if test "${PBX_GNUTLS}" = 1; then
427       IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lgpg-error"
428    fi
431 if test "${USE_IMAP_TK}" != "no"; then
432    if test "${IMAP_TK_DIR}" = ""; then
433       IMAP_TK_DIR=`pwd`"/../imap-2004g"
434       if test  -n "${IMAP_TK_MANDATORY}"; then
435          AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
436          AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
437          AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
438          AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
439       fi
440    fi
441    AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
442    saved_cppflags="${CPPFLAGS}"
443    saved_libs="${LIBS}"
444    if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
445       imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
446    fi
447    CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
448    LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
449    AC_LINK_IFELSE(
450         AC_LANG_PROGRAM(
451                 [#include "c-client.h"
452                 void mm_searched (MAILSTREAM *stream,unsigned long number)
453                 {
454                 }
455                 void mm_exists (MAILSTREAM *stream,unsigned long number)
456                 {
457                 }
458                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
459                 {
460                 }
461                 void mm_flags (MAILSTREAM *stream,unsigned long number)
462                 {
463                 }
464                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
465                 {
466                 }
467                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
468                 {
469                 }
470                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
471                 {
472                 }
473                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
474                 {
475                 }
476                 void mm_log (char *string,long errflg)
477                 {
478                 }
479                 void mm_dlog (char *string)
480                 {
481                 }
482                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
483                 {
484                 }
485                 void mm_critical (MAILSTREAM *stream)
486                 {
487                 }
488                 void mm_nocritical (MAILSTREAM *stream)
489                 {
490                 }
491                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
492                 {
493                 }
494                 void mm_fatal (char *string)
495                 {
496                 }],
497                 [
498                 MAILSTREAM *foo = mail_open(NULL, "", 0);
499                 ]
500         ),
501         [ac_cv_imap_tk="yes"],
502         [ac_cv_imap_tk="no"]
503    )
504    if test "${ac_cv_imap_tk}" = "yes"; then
505    AC_LINK_IFELSE(
506       AC_LANG_PROGRAM(
507          [#include "c-client.h"
508          void mm_searched (MAILSTREAM *stream,unsigned long number)
509          {
510          }
511          void mm_exists (MAILSTREAM *stream,unsigned long number)
512          {
513          }
514          void mm_expunged (MAILSTREAM *stream,unsigned long number)
515          {
516          }
517          void mm_flags (MAILSTREAM *stream,unsigned long number)
518          {
519          }
520          void mm_notify (MAILSTREAM *stream,char *string,long errflg)
521          {
522          }
523          void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
524          {
525          }
526          void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
527          {
528          }
529          void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
530          {
531          }
532          void mm_log (char *string,long errflg)
533          {
534          }
535          void mm_dlog (char *string)
536          {
537          }
538          void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
539          {
540          }
541          void mm_critical (MAILSTREAM *stream)
542          {
543          }
544          void mm_nocritical (MAILSTREAM *stream)
545          {
546          }
547          long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
548          {
549          }
550          void mm_fatal (char *string)
551          {
552          }],
553          [
554          long check = mail_expunge_full(NULL, "", 0);
555          ]
556       ),
557       [ac_cv_imap_tk2006="yes"],
558       [ac_cv_imap_tk2006="no"]
559   )
560   fi
561    CPPFLAGS="${saved_cppflags}"
562    LIBS="${saved_libs}"
563    if test "${ac_cv_imap_tk}" = "yes"; then
564       AC_MSG_RESULT(yes) 
565       IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
566       IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
567       PBX_IMAP_TK=1
568       AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
569       if test "${ac_cv_imap_tk2006}" = "yes"; then
570          AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
571       fi
572    elif test -n "${IMAP_TK_MANDATORY}"; then
573       AC_MSG_RESULT(no) 
574       AC_MSG_NOTICE([***])
575       AC_MSG_NOTICE([*** The UW IMAP Toolkit installation on this system appears to be broken.])
576       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
577       AC_MSG_NOTICE([*** including --without-imap.])
578       exit 1
579    else
580       AC_MSG_RESULT(no) 
581    fi
584 AC_LANG_PUSH(C++)
586 if test "${USE_KDE}" != "no"; then
587    AC_MSG_CHECKING(for crashHandler in -lkdecore)
588    saved_libs="${LIBS}"
589    saved_cppflags="${CPPFLAGS}"
590    CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
591    if test -d ${KDE_DIR}/lib; then
592       kdelibdir="${KDE_DIR}/lib"
593    else
594       kdelibdir="${KDE_DIR}"
595    fi
596    LIBS="${LIBS} -L${kdelibdir} -lkdecore"
598    AC_LINK_IFELSE(
599         [AC_LANG_PROGRAM(
600                         [#include "kcrash.h"],
601                         [KCrash::defaultCrashHandler(1);])
602         ],
603         [ac_cv_lib_kde_crash="yes"],
604         [ac_cv_lib_kde_crash="no"])
605                 
606    LIBS="${saved_libs}"
607    CPPFLAGS="${saved_cppflags}"
608         
609    if test "${ac_cv_lib_kde_crash}" = "yes"; then
610       AC_MSG_RESULT(yes) 
611       KDE_LIB="-lkdecore -lkdeui"
612       if test "${KDE_DIR}" != ""; then
613          KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
614          KDE_INCLUDE="-I${KDE_DIR}/include"
615       fi
616       PBX_KDE=1
617       AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
618    elif test -n "${KDE_MANDATORY}"; then
619       AC_MSG_RESULT(no) 
620       AC_MSG_NOTICE([***])
621       AC_MSG_NOTICE([*** The KDE installation on this system appears to be broken.])
622       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
623       AC_MSG_NOTICE([*** including --without-kde.])
624       exit 1
625    else
626       AC_MSG_RESULT(no) 
627    fi
629 if test "${PBX_KDE}" = 1; then
630    AC_PATH_TOOL(KDEINIT, kdeinit, No)
631    if test ! x"${KDEINIT}" = xNo; then
632       KDEDIR=$(${DIRNAME} ${KDEINIT})
633       KDEDIR=$(${DIRNAME} ${KDEDIR})
634    fi
635    AC_SUBST([KDEDIR])
638 AC_LANG_POP
640 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
642 if test "${PBX_MISDN}" = 1; then
643    AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
644    AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
645    AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
648 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
650 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
652 NETSNMP_CONFIG=No
653 if test "${USE_NETSNMP}" != "no"; then  
654    if test "x${NETSNMP_DIR}" != "x"; then
655       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
656       if test x"${NETSNMP_CONFIG}" = xNo; then
657          AC_MSG_NOTICE([***])
658          AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
659          AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
660          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
661          AC_MSG_NOTICE([*** including --without-netsnmp])
662          exit 1
663       fi
664    else
665       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
666    fi
668 if test x"${NETSNMP_CONFIG}" != xNo; then
669    NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
670    
671    AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
672    [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
674    if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
675       NETSNMP_LIB="${NETSNMP_libs}"
676       PBX_NETSNMP=1
677    elif test -n "${NETSNMP_MANDATORY}";
678    then
679       AC_MSG_NOTICE([***])
680       AC_MSG_NOTICE([*** The Net-SNMP installation on this system appears to be broken.])
681       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
682       AC_MSG_NOTICE([*** including --without-netsnmp])
683       exit 1
684    fi
685 elif test -n "${NETSNMP_MANDATORY}";
686 then
687    AC_MSG_NOTICE([***])
688    AC_MSG_NOTICE([*** The Net-SNMP 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-netsnmp])
691    exit 1
694 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
696 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
698 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
700 AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
702 if test "${USE_OSS}" != "no"; then
703 PBX_OSS=0
704 AC_CHECK_HEADER([linux/soundcard.h],
705                 [
706                 PBX_OSS=1
707                 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
708                 ])
709 if test "$PBX_OSS" = "0"; then
710    AC_CHECK_HEADER([sys/soundcard.h],
711                    [
712                    PBX_OSS=1
713                    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
714                    ])
716 if test "$PBX_OSS" = "0"; then
717    AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
721 PG_CONFIG=No
722 if test "${USE_PGSQL}" != "no"; then    
723    if test "x${PGSQL_DIR}" != "x"; then
724       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
725       if test x"${PG_CONFIG}" = xNo; then
726          AC_MSG_NOTICE([***])
727          AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
728          AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
729          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
730          AC_MSG_NOTICE([*** including --without-postgres])
731          exit 1
732       fi
733    else
734       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
735    fi
737 if test "${PG_CONFIG}" != No; then
738    PGSQL_libdir=`${PG_CONFIG} --libdir`
739    PGSQL_includedir=`${PG_CONFIG} --includedir`
741    if test "x$?" != "x0" ; then
742       if test -n "${PGSQL_MANDATORY}" ; then
743          AC_MSG_NOTICE([***])
744          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
745          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
746          AC_MSG_NOTICE([*** including --without-postgres])
747          exit 1
748           fi
749    else 
750       AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
751       [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
753       if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
754          PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
755          PGSQL_INCLUDE="-I${PGSQL_includedir}"
756          PBX_PGSQL=1
757       elif test -n "${PGSQL_MANDATORY}";
758       then
759          AC_MSG_NOTICE([***])
760          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
761          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
762          AC_MSG_NOTICE([*** including --without-postgres])
763          exit 1
764       fi
765    fi
766 elif test -n "${PGSQL_MANDATORY}";
767 then
768    AC_MSG_NOTICE([***])
769    AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
770    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
771    AC_MSG_NOTICE([*** including --without-postgres])
772    exit 1
775 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
777 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
779 if test "${USE_PWLIB}" != "no"; then
780         if test -n "${PWLIB_DIR}"; then
781                 PWLIBDIR="${PWLIB_DIR}"
782         fi
783         AST_CHECK_PWLIB()
784         AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
785                 
786         if test "${HAS_PWLIB:-unset}" != "unset"; then
787                 AST_CHECK_OPENH323_PLATFORM()
789                 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
791                 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
792                         [Define if your system has the PWLib libraries.],
793                         [#include "ptlib.h"],
794                         [BOOL q = PTime::IsDaylightSavings();])
795         fi
798 if test "${USE_PWLIB}" != "no" -a "x${ac_cv_lib_PWLIB}" != "xyes" -a -n "${PWLIB_MANDATORY}"; then
799    AC_MSG_NOTICE([***])
800    AC_MSG_NOTICE([*** The PWLIB installation on this system appears to be broken.])
801    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
802    AC_MSG_NOTICE([*** including --without-pwlib])
803    exit 1
806 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
807         if test -n "${OPENH323_DIR}"; then
808                 OPENH323DIR="${OPENH323_DIR}"
809         fi
810         AST_CHECK_OPENH323()
811         AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
812         AST_CHECK_OPENH323_BUILD()
813         PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
814         AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
815                 [Define if your system has the OpenH323 libraries.],
816                 [#include "ptlib.h"
817                 #include "h323.h"
818                 #include "h323ep.h"],
819                 [H323EndPoint ep = H323EndPoint();],
820                 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
822 if test "${USE_OPENH323}" != "no" -a "x${ac_cv_lib_OPENH323}" != "xyes" -a -n "${OPENH323_MANDATORY}"; then
823    AC_MSG_NOTICE([***])
824    AC_MSG_NOTICE([*** The OPENH323 installation on this system appears to be broken.])
825    AC_MSG_NOTICE([*** Either correct the installation, or run configure])
826    AC_MSG_NOTICE([*** including --without-h323])
827    exit 1
831 AC_LANG_PUSH(C++)
833 if test "${USE_QT}" != "no"; then
834    AC_MSG_CHECKING(for QDate in -lqt)
835    saved_libs="${LIBS}"
836    saved_cppflags="${CPPFLAGS}"
837    if test "x${QT_DIR}" != "x"; then
838       LIBS="${LIBS} -L${QT_DIR}/lib"
839       CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
840    fi
841    LIBS="${LIBS} -lqt"
842    qtlib="qt"
843    AC_LINK_IFELSE(
844         [
845                 AC_LANG_PROGRAM(
846                 [#include <qt3/qdatetime.h>],
847                 [QDate date();])
848         ],
849         [ac_cv_lib_qt_qt_date="yes"],
850         [ac_cv_lib_qt_qt_date="no"])
851    LIBS="${saved_libs}"
852    CPPFLAGS="${saved_cppflags}"
853         
854    if test "${ac_cv_lib_qt_qt_date}" = "no"; then
855       saved_libs="${LIBS}"
856       saved_cppflags="${CPPFLAGS}"
857       if test "x${QT_DIR}" != "x"; then
858          LIBS="${LIBS} -L${QT_DIR}/lib"
859          CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
860       fi
861       LIBS="${LIBS} -lqt-mt"
862       qtlib="qt-mt"     
863       AC_LINK_IFELSE(
864                 [
865                         AC_LANG_PROGRAM(
866                         [#include <qt3/qdatetime.h>],
867                         [QDate date();])
868                 ],
869                 [ac_cv_lib_qt_qt_date="yes"],
870                 [ac_cv_lib_qt_qt_date="no"])
871       LIBS="${saved_libs}"
872       CPPFLAGS="${saved_cppflags}"
873    fi   
875    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
876       AC_MSG_RESULT(yes) 
877    else
878       AC_MSG_RESULT(no) 
879    fi
880         
881    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
882       QT_LIB="-l${qtlib}"
883       if test "${QT_DIR}" != ""; then
884          QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
885          QT_INCLUDE="-I${QT_DIR}/include"
886       fi
887       PBX_QT=1
888       AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
889       AC_PATH_TOOL(QTMOC, moc, No)
890    elif test -n "${QT_MANDATORY}"; 
891    then
892       AC_MSG_NOTICE([***])
893       AC_MSG_NOTICE([*** The Qt installation on this system appears to be broken.])
894       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
895       AC_MSG_NOTICE([*** including --without-qt.])
896       exit 1
897    fi
900 AC_LANG_POP
902 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
904 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
906 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
908 AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
910 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
911 if test "${PBX_FREETDS}" != "0";
912 then
913     case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
914         *0.64*)
915                 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
916         ;;
917     *0.63*)
918         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
919         ;;
920     *0.62*)
921         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
922         ;;
923     *)
924         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
925         ;;
926     esac
929 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
931 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
933 if test "${host_os}" != "linux-gnu" ; then
934   tonezone_extra="-lm"
937 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}])
939 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
941 AC_LANG_PUSH(C++)
943 if test "${USE_VPB}" != "no"; then
944    AC_MSG_CHECKING(for vpb_open in -lvpb)
945    saved_libs="${LIBS}"
946    saved_cppflags="${CPPFLAGS}"
947    if test "x${VPB_DIR}" != "x"; then
948       if test -d ${VPB_DIR}/lib; then
949          vpblibdir=${VPB_DIR}/lib
950       else
951          vpblibdir=${VPB_DIR}
952       fi
953       LIBS="${LIBS} -L${vpblibdir}"
954       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
955    fi
956    LIBS="${LIBS} -lvpb -lpthread"
957    AC_LINK_IFELSE(
958         [
959         AC_LANG_PROGRAM(
960         [#include <vpbapi.h>],
961         [int q = vpb_open(0,0);])
962         ],
963         [       AC_MSG_RESULT(yes) 
964                 ac_cv_lib_vpb_vpb_open="yes" 
965         ],
966         [       AC_MSG_RESULT(no) 
967                 ac_cv_lib_vpb_vpb_open="no" 
968         ]
969         )
970    LIBS="${saved_libs}"
971    CPPFLAGS="${saved_cppflags}"
972    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
973         VPB_LIB="-lvpb"
974         if test "${VPB_DIR}" != ""; then
975            VPB_LIB="-L${vpblibdir}  ${VPB_LIB}"
976            VPB_INCLUDE="-I${VPB_DIR}/include"
977         fi
978         PBX_VPB=1
979         AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
980    elif test -n "${VPB_MANDATORY}"; then
981       AC_MSG_NOTICE([***])
982       AC_MSG_NOTICE([*** The VoiceTronix (vpb) installation on this system appears to be broken.])
983       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
984       AC_MSG_NOTICE([*** including --without-vpb.])
985       exit 1
986    fi
989 AC_LANG_POP
991 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
993 if test "${USE_ZAPTEL}" != "no"; then
994    AC_MSG_CHECKING(for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h)
995    saved_cppflags="${CPPFLAGS}"
996    if test "x${ZAPTEL_DIR}" != "x"; then
997       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
998    fi
999    AC_COMPILE_IFELSE(
1000         [
1001         AC_LANG_PROGRAM(
1002         [#include <zaptel/zaptel.h>],
1003         [int foo = ZT_DIAL_OP_CANCEL;])
1004         ],
1005         [       AC_MSG_RESULT(yes) 
1006                 ac_cv_zaptel_h="yes" 
1007         ],
1008         [       AC_MSG_RESULT(no) 
1009                 ac_cv_zaptel_h="no" 
1010         ]
1011         )
1012    CPPFLAGS="${saved_cppflags}"
1013    if test "${ac_cv_zaptel_h}" = "yes"; then
1014         if test "${ZAPTEL_DIR}" != ""; then
1015            ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
1016         fi
1017         PBX_ZAPTEL=1
1018         AC_DEFINE([HAVE_ZAPTEL], 1, [Define if your system has the Zaptel headers.])
1019    elif test -n "${ZAPTEL_MANDATORY}"; 
1020    then
1021       AC_MSG_NOTICE([***])
1022       AC_MSG_NOTICE([*** The Zaptel installation on this system appears to be broken.])
1023       AC_MSG_NOTICE([*** Either correct the installation, or run configure])
1024       AC_MSG_NOTICE([*** including --without-zaptel.])
1025       exit 1
1026    fi
1029 if test "${PBX_ZAPTEL}" = 1; then
1030    AC_MSG_CHECKING(for ZT_EVENT_REMOVED in zaptel/zaptel.h)
1031    saved_cppflags="${CPPFLAGS}"
1032    if test "x${ZAPTEL_DIR}" != "x"; then
1033       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1034    fi
1035    AC_COMPILE_IFELSE(
1036         [
1037         AC_LANG_PROGRAM(
1038         [#include <zaptel/zaptel.h>],
1039         [int foo = ZT_EVENT_REMOVED;])
1040         ],
1041         [       AC_MSG_RESULT(yes) 
1042                 ac_cv_zaptel_vldtmf="yes" 
1043         ],
1044         [       AC_MSG_RESULT(no) 
1045                 ac_cv_zaptel_vldtmf="no" 
1046         ]
1047         )
1048    CPPFLAGS="${saved_cppflags}"
1049    if test "${ac_cv_zaptel_vldtmf}" = "yes"; then
1050         PBX_ZAPTEL_VLDTMF=1
1051    fi
1052    AC_MSG_CHECKING(for ZT_TCOP_ALLOCATE in zaptel/zaptel.h)
1053    saved_cppflags="${CPPFLAGS}"
1054    if test "x${ZAPTEL_DIR}" != "x"; then
1055       CPPFLAGS="${CPPFLAGS} -I${ZAPTEL_DIR}/include"
1056    fi
1057    AC_COMPILE_IFELSE(
1058         [
1059         AC_LANG_PROGRAM(
1060         [#include <zaptel/zaptel.h>],
1061         [int foo = ZT_TCOP_ALLOCATE;])
1062         ],
1063         [       AC_MSG_RESULT(yes) 
1064                 ac_cv_zaptel_transcode="yes" 
1065         ],
1066         [       AC_MSG_RESULT(no) 
1067                 ac_cv_zaptel_transcode="no" 
1068         ]
1069         )
1070    CPPFLAGS="${saved_cppflags}"
1071    if test "${ac_cv_zaptel_transcode}" = "yes"; then
1072         PBX_ZAPTEL_TRANSCODE=1
1073    fi
1075 AC_SUBST(PBX_ZAPTEL_VLDTMF)
1076 AC_SUBST(PBX_ZAPTEL_TRANSCODE)
1078 EDITLINE_LIB=""
1079 if test "x$TERMCAP_LIB" != "x" ; then
1080   EDITLINE_LIB="$TERMCAP_LIB"
1081 elif test "x$TINFO_LIB" != "x" ; then
1082   EDITLINE_LIB="$TINFO_LIB"
1083 elif test "x$CURSES_LIB" != "x" ; then
1084   EDITLINE_LIB="$CURSES_LIB"
1085 elif test "x$NCURSES_LIB" != "x" ; then
1086   EDITLINE_LIB="$NCURSES_LIB"
1087 else
1088   AC_MSG_ERROR(*** termcap support not found)
1090 AC_SUBST(EDITLINE_LIB)
1092 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
1093 AC_SUBST(PBX_H323)
1095 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
1096                                    #include <linux/version.h>
1097                                    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
1098                                    #include <linux/compiler.h>
1099                                    #endif
1100                                    ])
1101 AC_SUBST(PBX_IXJUSER)
1103 PBX_GTK=0
1104 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
1105 if test ! "x${GTKCONFIG}" = xNo; then
1106    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
1107    GTK_LIB=$(${GTKCONFIG} --libs gthread)
1108    PBX_GTK=1
1109    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
1111 AC_SUBST(PBX_GTK)
1112 AC_SUBST(GTK_INCLUDE)
1113 AC_SUBST(GTK_LIB)
1115 PBX_GTK2=0
1116 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
1117 if test ! "x${PKGCONFIG}" = xNo; then
1118    GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags)
1119    GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
1120    PBX_GTK2=1
1121    AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
1123 AC_SUBST(PBX_GTK2)
1124 AC_SUBST(GTK2_INCLUDE)
1125 AC_SUBST(GTK2_LIB)
1127 if test "${USE_CURL}" != "no"; then
1128    AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
1129    if test ! x"${CURL_CONFIG}" = xNo; then
1130    # check for version
1131       if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
1132          CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
1133          CURL_LIB=$(${CURL_CONFIG} --libs)
1134          PBX_CURL=1
1135          AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1136       fi
1137    fi
1140 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1141 AC_OUTPUT
1143 if test "x${silent}" != "xyes" ; then
1144 echo
1145 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
1146 echo "            .\$7\$7..          .7\$\$7:.    "
1147 echo "          .\$\$:.                 ,\$7.7   "
1148 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
1149 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
1150 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
1151 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
1152 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
1153 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
1154 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
1155 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
1156 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
1157 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
1158 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
1159 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
1160 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
1161 echo " \$\$\$\$\$                        \$\$\$       "
1162 echo "  \$\$\$\$7.                       \$\$  (TM)     "
1163 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
1164 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
1165 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
1166 echo
1169 AC_MSG_NOTICE(Package configured for: )
1170 AC_MSG_NOTICE( OS type  : $host_os)
1171 AC_MSG_NOTICE( Host CPU : $host_cpu)
1172 if test "${cross_compiling}" = "yes"; then
1173    AC_MSG_NOTICE( Cross Compilation = YES)