added CLI 'iax2 unregister <peername>' for issue 9812, thanks eliel
[asterisk/asterisk.git] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 #
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.
8
9 AC_PREREQ(2.59)
10
11 m4_define([PBX_VERSION],
12           m4_bpatsubst(m4_esyscmd([build_tools/make_version .]),
13                        [\([0-9.]*\)\(\w\|\W\)*],
14                        [\1]))
15 AC_INIT(asterisk, PBX_VERSION, www.asterisk.org)
16
17 # cross-compile macros
18 AC_CANONICAL_BUILD
19 AC_CANONICAL_HOST
20
21 # check existence of the package
22 AC_CONFIG_SRCDIR([main/asterisk.c])
23
24 # specify output header file
25 AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
26
27 AC_COPYRIGHT("Asterisk")
28 AC_REVISION($Revision$)
29
30 AC_GNU_SOURCE
31 AC_USE_SYSTEM_EXTENSIONS        # note- does not work on FreeBSD
32
33 case "${host_os}" in
34      freebsd*)
35      ac_default_prefix=/usr/local
36      CPPFLAGS=-I/usr/local/include
37      LDFLAGS=-L/usr/local/lib
38      ;;
39
40      *)
41      ac_default_prefix=/usr
42      if test ${sysconfdir} = '${prefix}/etc'; then
43         sysconfdir=/etc
44      fi
45      if test ${mandir} = '${prefix}/man'; then
46         mandir=/usr/share/man
47      fi
48      ;;
49 esac
50
51 if test ${localstatedir} = '${prefix}/var'; then
52      localstatedir=/var
53 fi
54
55 BUILD_PLATFORM=${build}
56 BUILD_CPU=${build_cpu}
57 BUILD_VENDOR=${build_vendor}
58 BUILD_OS=${build_os}
59
60 AC_SUBST(BUILD_PLATFORM)
61 AC_SUBST(BUILD_CPU)
62 AC_SUBST(BUILD_VENDOR)
63 AC_SUBST(BUILD_OS)
64
65 HOST_PLATFORM=${host}
66 HOST_CPU=${host_cpu}
67 HOST_VENDOR=${host_vendor}
68 HOST_OS=${host_os}
69
70 AC_SUBST(HOST_PLATFORM)
71 AC_SUBST(HOST_CPU)
72 AC_SUBST(HOST_VENDOR)
73 AC_SUBST(HOST_OS)
74
75 case "${host_os}" in
76      freebsd*)
77      OSARCH=FreeBSD
78      ;;
79      netbsd*)
80      OSARCH=NetBSD
81      ;;
82      openbsd*)
83      OSARCH=OpenBSD
84      ;;
85      solaris*)
86      OSARCH=SunOS
87      ;;
88      *)
89      OSARCH=${HOST_OS}
90      ;;
91 esac
92
93 AC_SUBST(OSARCH)
94
95 #  check for uname
96 AC_PATH_TOOL([UNAME], [uname], No)
97 if test ! x"${UNAME}" = xNo; then
98    PBX_OSREV=$(${UNAME} -r)
99 fi
100 AC_SUBST(PBX_OSREV)
101
102 AH_TOP(
103 #ifndef ASTERISK_AUTOCONFIG_H
104 #define ASTERISK_AUTOCONFIG_H
105
106 #include "asterisk/buildopts.h"
107
108 )
109
110 AH_BOTTOM(
111 #endif
112 )
113
114 # cross-compile checks
115 if test "${cross_compiling}" = "yes"; 
116 then
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 fi
122
123 # Checks for programs.
124 AC_PROG_CC
125 AC_PROG_CXX
126 AC_PROG_CPP
127 AC_PROG_CXXCPP
128 # This macro is just copied into our local acinclude.m4 from libtool.m4 so that
129 # the developers regenerating the configure script don't have to install libtool.
130 AST_PROG_LD     # note, does not work on FreeBSD
131 AC_PROG_AWK
132 AC_PROG_INSTALL
133 AC_PROG_LN_S
134 AC_PROG_RANLIB
135 AST_CHECK_GNU_MAKE
136
137 AC_PATH_TOOL([STRIP], [strip], :)
138 AC_PATH_TOOL([AR], [ar], :)
139
140 GNU_LD=0
141 if test "x$with_gnu_ld" = "xyes" ; then
142    GNU_LD=1
143 fi
144 AC_SUBST(GNU_LD)
145
146 AC_PATH_PROG([GREP], [grep], :)
147 AC_PATH_PROG([FIND], [find], :)
148 AC_PATH_PROG([COMPRESS], [compress], :)
149 AC_PATH_PROG([BASENAME], [basename], :)
150 AC_PATH_PROG([ID], [id], :)
151 AC_PATH_PROG([DIRNAME], [dirname], :)
152 AC_PATH_PROG([SHELL], [sh], :)
153 AC_PATH_PROG([LN], [ln], :)
154 AC_PATH_PROG([DOT], [dot], :)
155 AC_PATH_PROG([WGET], [wget], :)
156 AC_PATH_PROG([RUBBER], [rubber], :)
157 if test "${WGET}" != ":" ; then
158   DOWNLOAD=${WGET}
159 else
160   AC_PATH_PROG([FETCH], [fetch], [:])
161   DOWNLOAD=${FETCH}
162 fi
163 AC_SUBST(DOWNLOAD)
164
165 ACX_PTHREAD
166
167 AC_LANG(C)
168
169 AC_ARG_ENABLE(dev-mode,
170         [  --enable-dev-mode    Turn on developer mode],
171         [case "${enableval}" in
172               y|ye|yes) AST_DEVMODE=yes ;;
173               n|no)  AST_DEVMODE=no ;;
174               *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
175         esac])
176 AC_SUBST(AST_DEVMODE)
177
178 # package option names should be in alphabetical order
179 # by the --with option name, to make things easier for the users :-)
180
181 AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
182
183 # BKTR is used for backtrace support on platforms that do not
184 # have it natively.
185 AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace support], [execinfo])
186 AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
187 AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
188 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
189 AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography support], [crypto])
190 AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
191 AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
192 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
193 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
194 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
195 AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
196 AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
197 AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
198 AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses])
199 AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
200 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
201 AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
202 AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
203 AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
204 AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
205 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
206 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
207 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
208 AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
209 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
210 AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
211 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
212 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
213 AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
214 AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
215 AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
216 AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
217 AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer support], [ssl])
218 AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
219 AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
220 AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
221 AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
222 AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
223 AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
224 AST_EXT_LIB_SETUP([ZLIB], [zlib], [z])
225 AST_EXT_LIB_SETUP([ZAPTEL], [Zaptel], [zaptel])
226 AST_EXT_LIB_SETUP([ZAPTEL_TRANSCODE], [Zaptel_transcode], [zaptel_transcode])
227 AST_EXT_LIB_SETUP([ZAPTEL_VLDTMF], [Zaptel_vldtmf], [zaptel_vldtmf])
228
229 # check for basic system features and functionality before
230 # checking for package libraries
231
232 AC_FUNC_ALLOCA
233 AC_HEADER_DIRENT
234 AC_HEADER_STDC
235 AC_HEADER_SYS_WAIT
236 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
238 AC_SYS_LARGEFILE
239
240 # Checks for typedefs, structures, and compiler characteristics.
241 AC_HEADER_STDBOOL
242 AC_C_CONST
243 AC_TYPE_UID_T
244 AC_C_INLINE
245 AC_TYPE_MODE_T
246 AC_TYPE_OFF_T
247 AC_TYPE_PID_T
248 AC_TYPE_SIZE_T
249 AC_CHECK_MEMBERS([struct stat.st_blksize])
250 AC_HEADER_TIME
251 AC_STRUCT_TM
252 AC_C_VOLATILE
253 AC_CHECK_TYPES([ptrdiff_t])
254
255 # Checks for library functions.
256 AC_FUNC_CHOWN
257 AC_FUNC_CLOSEDIR_VOID
258 AC_FUNC_ERROR_AT_LINE
259 AST_FUNC_FORK
260 AC_FUNC_FSEEKO
261 AC_PROG_GCC_TRADITIONAL
262 # XXX: these are commented out until we determine whether it matters if our malloc()
263 # acts exactly like glibc's or not
264 # AC_FUNC_MALLOC
265 # AC_FUNC_REALLOC
266 AC_FUNC_MEMCMP
267 AC_FUNC_MKTIME
268 AC_FUNC_MMAP
269 AC_FUNC_SELECT_ARGTYPES
270 AC_FUNC_SETVBUF_REVERSED
271 AC_TYPE_SIGNAL
272 AC_FUNC_STAT
273 AC_FUNC_STRCOLL
274 AC_FUNC_STRFTIME
275 AC_FUNC_STRNLEN
276 AC_FUNC_STRTOD
277 AC_FUNC_UTIME_NULL
278 AC_FUNC_VPRINTF
279 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])
280
281 # https support (in main/http.c) uses funopen on BSD systems,
282 # fopencookie on linux
283 AC_CHECK_FUNCS([funopen fopencookie])
284
285 # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
286 AC_CHECK_FUNCS([gethostbyname_r])
287
288 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
289 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
290
291 AC_MSG_CHECKING(for compiler atomic operations)
292 AC_LINK_IFELSE(
293 AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
294 AC_MSG_RESULT(yes)
295 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides atomic operations.]),
296 AC_MSG_RESULT(no)
297 )
298
299 AST_GCC_ATTRIBUTE(pure)
300 AST_GCC_ATTRIBUTE(malloc)
301 AST_GCC_ATTRIBUTE(const)
302 AST_GCC_ATTRIBUTE(unused)
303 AST_GCC_ATTRIBUTE(always_inline)
304
305 AC_MSG_CHECKING(for -ffunction-sections support)
306 saved_CFLAGS="${CFLAGS}"
307 CFLAGS="${CFLAGS} -ffunction-sections"
308 AC_COMPILE_IFELSE(
309         AC_LANG_PROGRAM([], [int x = 1;]),
310         AC_MSG_RESULT(yes)
311         [saved_LDFLAGS="${LDFLAGS}"]
312         [LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
313         AC_MSG_CHECKING(for --gc-sections support)
314         AC_LINK_IFELSE(
315                 AC_LANG_PROGRAM([], [int x = 1;]),
316                 AC_MSG_RESULT(yes)
317                 [GC_CFLAGS="-ffunction-sections"]
318                 [[GC_LDFLAGS="-Wl,--gc-sections"]],
319                 AC_MSG_RESULT(no)
320         )
321         [LDFLAGS="${saved_LDFLAGS}"],
322         AC_MSG_RESULT(no)
323 )
324 CFLAGS="${saved_CFLAGS}"
325 AC_SUBST(GC_CFLAGS)
326 AC_SUBST(GC_LDFLAGS)
327
328 AC_MSG_CHECKING(for sysinfo)
329 AC_LINK_IFELSE(
330         AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
331                         [struct sysinfo sys_info;]),
332         AC_MSG_RESULT(yes)
333         AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]),
334         AC_MSG_RESULT(no)
335 )
336
337 AC_MSG_CHECKING(for res_ninit)
338 AC_LINK_IFELSE(
339         AC_LANG_PROGRAM([#include <resolv.h>],
340                         [int foo = res_ninit(NULL);]),
341         AC_MSG_RESULT(yes)
342         AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]),
343         AC_MSG_RESULT(no)
344 )
345
346 AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
347
348 AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
349
350 AC_CHECK_HEADER([libkern/OSAtomic.h],
351                 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
352
353 AC_CHECK_SIZEOF(int)
354
355 # do the package library checks now
356
357 AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
358
359 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
360
361 if test "x${host_os}" = "xlinux-gnu" ; then
362   AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
363 fi
364
365 GSM_INTERNAL="yes"
366 AC_SUBST(GSM_INTERNAL)
367 GSM_SYSTEM="yes"
368 if test "${USE_GSM}" != "no"; then
369    if test "${GSM_DIR}" = "internal"; then
370       GSM_SYSTEM="no"
371    elif test "${GSM_DIR}" != ""; then
372       GSM_INTERNAL="no"
373    fi
374    if test "${GSM_SYSTEM}" = "yes"; then
375       gsmlibdir=""
376       if test "x${GSM_DIR}" != "x"; then
377          if test -d ${GSM_DIR}/lib; then
378             gsmlibdir="-L${GSM_DIR}/lib"
379          else
380             gsmlibdir="-L${GSM_DIR}"
381          fi
382       fi
383       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
384       [Define to indicate the GSM library]), [], ${gsmlibdir})
385       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
386          if test "x${GSM_DIR}" != "x" ; then
387             AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
388             AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
389          else
390             AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
391             AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
392          fi
393          if test "${GSM_HEADER_FOUND}" = "0" ; then
394             if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
395                if test "x${GSM_MANDATORY}" = "xyes" ; then
396                   AC_MSG_NOTICE([***])
397                   AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
398                   AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
399                   AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
400                   exit 1
401                fi
402             fi
403          fi
404          GSM_OK=0
405          if test "${GSM_HEADER_FOUND}" = "1" ; then
406             AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
407             GSM_OK=1
408          else
409             if test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
410                AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
411                GSM_OK=1
412             fi
413          fi
414          if test "${GSM_OK}" = "1" ; then
415             GSM_LIB="-lgsm"
416             if test "x${GSM_DIR}" != "x"; then
417                GSM_LIB="${gsmlibdir} ${GSM_LIB}"
418                GSM_INCLUDE="-I${GSM_DIR}/include"
419             fi
420             PBX_GSM=1
421             GSM_INTERNAL="no"
422          fi
423       fi
424    fi
425    if test "${GSM_INTERNAL}" = "yes"; then
426       PBX_GSM=1
427       AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
428    fi
429 fi
430
431 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
432
433 if test "${PBX_IKSEMEL}" = 1; then
434    AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye], [gnutls/gnutls.h], [-lz -lgcrypt -lgpg-error])
435 fi
436
437 if test "${USE_IMAP_TK}" != "no"; then
438    if test "${IMAP_TK_DIR}" = ""; then
439       IMAP_TK_DIR=`pwd`"/../imap-2004g"
440       if test  -n "${IMAP_TK_MANDATORY}"; then
441          AC_MSG_NOTICE([The --with-imap option does not search your system for installed])
442          AC_MSG_NOTICE([c-client library/header files. Since you did not provide a path])
443          AC_MSG_NOTICE([the configure script will assume you have placed built the c-client])
444          AC_MSG_NOTICE([files at ${IMAP_TK_DIR}, as outlined in the doc/imapstorage.txt file.])
445       fi
446    fi
447    AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
448    saved_cppflags="${CPPFLAGS}"
449    saved_libs="${LIBS}"
450    if test -f ${IMAP_TK_DIR}/c-client/LDFLAGS ; then
451       imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
452    fi
453    CPPFLAGS="${CPPFLAGS} -I${IMAP_TK_DIR}/c-client"
454    LIBS="${LIBS} ${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
455    AC_LINK_IFELSE(
456         AC_LANG_PROGRAM(
457                 [#include "c-client.h"
458                 void mm_searched (MAILSTREAM *stream,unsigned long number)
459                 {
460                 }
461                 void mm_exists (MAILSTREAM *stream,unsigned long number)
462                 {
463                 }
464                 void mm_expunged (MAILSTREAM *stream,unsigned long number)
465                 {
466                 }
467                 void mm_flags (MAILSTREAM *stream,unsigned long number)
468                 {
469                 }
470                 void mm_notify (MAILSTREAM *stream,char *string,long errflg)
471                 {
472                 }
473                 void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
474                 {
475                 }
476                 void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
477                 {
478                 }
479                 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
480                 {
481                 }
482                 void mm_log (char *string,long errflg)
483                 {
484                 }
485                 void mm_dlog (char *string)
486                 {
487                 }
488                 void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
489                 {
490                 }
491                 void mm_critical (MAILSTREAM *stream)
492                 {
493                 }
494                 void mm_nocritical (MAILSTREAM *stream)
495                 {
496                 }
497                 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
498                 {
499                 }
500                 void mm_fatal (char *string)
501                 {
502                 }],
503                 [
504                 MAILSTREAM *foo = mail_open(NULL, "", 0);
505                 ]
506         ),
507         [ac_cv_imap_tk="yes"],
508         [ac_cv_imap_tk="no"]
509    )
510    if test "${ac_cv_imap_tk}" = "yes"; then
511    AC_LINK_IFELSE(
512       AC_LANG_PROGRAM(
513          [#include "c-client.h"
514          void mm_searched (MAILSTREAM *stream,unsigned long number)
515          {
516          }
517          void mm_exists (MAILSTREAM *stream,unsigned long number)
518          {
519          }
520          void mm_expunged (MAILSTREAM *stream,unsigned long number)
521          {
522          }
523          void mm_flags (MAILSTREAM *stream,unsigned long number)
524          {
525          }
526          void mm_notify (MAILSTREAM *stream,char *string,long errflg)
527          {
528          }
529          void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
530          {
531          }
532          void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
533          {
534          }
535          void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
536          {
537          }
538          void mm_log (char *string,long errflg)
539          {
540          }
541          void mm_dlog (char *string)
542          {
543          }
544          void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
545          {
546          }
547          void mm_critical (MAILSTREAM *stream)
548          {
549          }
550          void mm_nocritical (MAILSTREAM *stream)
551          {
552          }
553          long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
554          {
555          }
556          void mm_fatal (char *string)
557          {
558          }],
559          [
560          long check = mail_expunge_full(NULL, "", 0);
561          ]
562       ),
563       [ac_cv_imap_tk2006="yes"],
564       [ac_cv_imap_tk2006="no"]
565   )
566   fi
567    CPPFLAGS="${saved_cppflags}"
568    LIBS="${saved_libs}"
569    if test "${ac_cv_imap_tk}" = "yes"; then
570       AC_MSG_RESULT(yes) 
571       IMAP_TK_LIB="${IMAP_TK_DIR}/c-client/c-client.a "`echo ${imap_ldflags}`
572       IMAP_TK_INCLUDE="-I${IMAP_TK_DIR}/c-client"
573       PBX_IMAP_TK=1
574       AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
575       if test "${ac_cv_imap_tk2006}" = "yes"; then
576          AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
577       fi
578    else
579       AC_MSG_RESULT(no) 
580    fi
581 fi
582
583 AC_LANG_PUSH(C++)
584
585 if test "${USE_KDE}" != "no"; then
586    AC_MSG_CHECKING(for crashHandler in -lkdecore)
587    saved_libs="${LIBS}"
588    saved_cppflags="${CPPFLAGS}"
589    CPPFLAGS="${CPPFLAGS} -I${KDE_DIR}/include"
590    if test -d ${KDE_DIR}/lib; then
591       kdelibdir="${KDE_DIR}/lib"
592    else
593       kdelibdir="${KDE_DIR}"
594    fi
595    LIBS="${LIBS} -L${kdelibdir} -lkdecore"
596
597    AC_LINK_IFELSE(
598         [AC_LANG_PROGRAM(
599                         [#include "kcrash.h"],
600                         [KCrash::defaultCrashHandler(1);])
601         ],
602         [ac_cv_lib_kde_crash="yes"],
603         [ac_cv_lib_kde_crash="no"])
604                 
605    LIBS="${saved_libs}"
606    CPPFLAGS="${saved_cppflags}"
607         
608    if test "${ac_cv_lib_kde_crash}" = "yes"; then
609       AC_MSG_RESULT(yes) 
610       KDE_LIB="-lkdecore -lkdeui"
611       if test "${KDE_DIR}" != ""; then
612          KDE_LIB="-L${kdelibdir} ${KDE_LIB}"
613          KDE_INCLUDE="-I${KDE_DIR}/include"
614       fi
615       PBX_KDE=1
616       AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE libraries.])
617    else
618       AC_MSG_RESULT(no) 
619    fi
620 fi
621 if test "${PBX_KDE}" = 1; then
622    AC_PATH_TOOL(KDEINIT, kdeinit, No)
623    if test ! x"${KDEINIT}" = xNo; then
624       KDEDIR=$(${DIRNAME} ${KDEINIT})
625       KDEDIR=$(${DIRNAME} ${KDEDIR})
626    fi
627    AC_SUBST([KDEDIR])
628 fi
629
630 AC_LANG_POP
631
632 AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
633
634 if test "${PBX_MISDN}" = 1; then
635    AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
636    AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
637    AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
638 fi
639
640 AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
641
642 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
643
644 NETSNMP_CONFIG=No
645 if test "${USE_NETSNMP}" != "no"; then  
646    if test "x${NETSNMP_DIR}" != "x"; then
647       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
648       if test x"${NETSNMP_CONFIG}" = xNo; then
649          AC_MSG_NOTICE([***])
650          AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
651          AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
652          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
653          AC_MSG_NOTICE([*** including --without-netsnmp])
654          exit 1
655       fi
656    else
657       AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
658    fi
659 fi
660 if test x"${NETSNMP_CONFIG}" != xNo; then
661    NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
662    
663    AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
664    [Define to indicate the Net-SNMP library]), [], ${NETSNMP_libs})
665
666    if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
667       NETSNMP_LIB="${NETSNMP_libs}"
668       PBX_NETSNMP=1
669    fi
670 fi
671
672 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
673
674 AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
675
676 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
677
678 AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h], [-lexecinfo])
679
680 # possible places for oss definitions
681 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
682 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
683 AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
684
685 PG_CONFIG=No
686 if test "${USE_PGSQL}" != "no"; then    
687    if test "x${PGSQL_DIR}" != "x"; then
688       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
689       if test x"${PG_CONFIG}" = xNo; then
690          AC_MSG_NOTICE([***])
691          AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
692          AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
693          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
694          AC_MSG_NOTICE([*** including --without-postgres])
695          exit 1
696       fi
697    else
698       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
699    fi
700 fi
701 if test "${PG_CONFIG}" != No; then
702    PGSQL_libdir=`${PG_CONFIG} --libdir`
703    PGSQL_includedir=`${PG_CONFIG} --includedir`
704    if test "x$?" != "x0" ; then
705       if test -n "${PGSQL_MANDATORY}" ; then
706          AC_MSG_NOTICE([***])
707          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
708          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
709          AC_MSG_NOTICE([*** including --without-postgres])
710          exit 1
711           fi
712    else 
713       AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
714       [Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
715
716       if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
717          PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
718          PGSQL_INCLUDE="-I${PGSQL_includedir}"
719          PBX_PGSQL=1
720       elif test -n "${PGSQL_MANDATORY}";
721       then
722          AC_MSG_NOTICE([***])
723          AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
724          AC_MSG_NOTICE([*** Either correct the installation, or run configure])
725          AC_MSG_NOTICE([*** including --without-postgres])
726          exit 1
727       fi
728    fi
729 fi
730
731 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
732
733 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
734
735 AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
736
737 if test "${USE_PWLIB}" != "no"; then
738         if test -n "${PWLIB_DIR}"; then
739                 PWLIBDIR="${PWLIB_DIR}"
740         fi
741         AST_CHECK_PWLIB()
742         AST_CHECK_PWLIB_VERSION([PWLib], [PWLIB], [ptbuildopts.h], [1], [9], [2])
743                 
744         if test "${HAS_PWLIB:-unset}" != "unset"; then
745                 AST_CHECK_OPENH323_PLATFORM()
746
747                 PLATFORM_PWLIB="pt_${PWLIB_PLATFORM}_r"
748
749                 AST_CHECK_PWLIB_BUILD([PWLib], [PWLIB],
750                         [Define if your system has the PWLib libraries.],
751                         [#include "ptlib.h"],
752                         [BOOL q = PTime::IsDaylightSavings();])
753         fi
754 fi
755
756 if test "${PBX_PWLIB}" = "1" -a "${USE_OPENH323}" != "no" ; then
757         if test -n "${OPENH323_DIR}"; then
758                 OPENH323DIR="${OPENH323_DIR}"
759         fi
760         AST_CHECK_OPENH323()
761         AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
762         AST_CHECK_OPENH323_BUILD()
763         PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
764         AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
765                 [Define if your system has the OpenH323 libraries.],
766                 [#include "ptlib.h"
767                 #include "h323.h"
768                 #include "h323ep.h"],
769                 [H323EndPoint ep = H323EndPoint();],
770                 [${PWLIB_INCLUDE}], [${PWLIB_LIB}])
771 fi
772
773 AC_LANG_PUSH(C++)
774
775 if test "${USE_QT}" != "no"; then
776    AC_MSG_CHECKING(for QDate in -lqt)
777    saved_libs="${LIBS}"
778    saved_cppflags="${CPPFLAGS}"
779    if test "x${QT_DIR}" != "x"; then
780       LIBS="${LIBS} -L${QT_DIR}/lib"
781       CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
782    fi
783    LIBS="${LIBS} -lqt"
784    qtlib="qt"
785    AC_LINK_IFELSE(
786         [
787                 AC_LANG_PROGRAM(
788                 [#include <qt3/qdatetime.h>],
789                 [QDate date();])
790         ],
791         [ac_cv_lib_qt_qt_date="yes"],
792         [ac_cv_lib_qt_qt_date="no"])
793    LIBS="${saved_libs}"
794    CPPFLAGS="${saved_cppflags}"
795         
796    if test "${ac_cv_lib_qt_qt_date}" = "no"; then
797       saved_libs="${LIBS}"
798       saved_cppflags="${CPPFLAGS}"
799       if test "x${QT_DIR}" != "x"; then
800          LIBS="${LIBS} -L${QT_DIR}/lib"
801          CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
802       fi
803       LIBS="${LIBS} -lqt-mt"
804       qtlib="qt-mt"     
805       AC_LINK_IFELSE(
806                 [
807                         AC_LANG_PROGRAM(
808                         [#include <qt3/qdatetime.h>],
809                         [QDate date();])
810                 ],
811                 [ac_cv_lib_qt_qt_date="yes"],
812                 [ac_cv_lib_qt_qt_date="no"])
813       LIBS="${saved_libs}"
814       CPPFLAGS="${saved_cppflags}"
815    fi   
816
817    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
818       AC_MSG_RESULT(yes) 
819    else
820       AC_MSG_RESULT(no) 
821    fi
822         
823    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
824       QT_LIB="-l${qtlib}"
825       if test "${QT_DIR}" != ""; then
826          QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
827          QT_INCLUDE="-I${QT_DIR}/include"
828       fi
829       PBX_QT=1
830       AC_DEFINE([HAVE_QT], 1, [Define if your system has the Qt library])
831       AC_PATH_TOOL(QTMOC, moc, No)
832    fi
833 fi
834
835 AC_LANG_POP
836
837 AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
838
839 AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
840
841 AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
842
843 AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h])
844
845 AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
846
847 if test "$PBX_CRYPTO" = "1";
848 then
849     AST_EXT_LIB_CHECK([OPENSSL], [ssl], [ssl2_connect], [openssl/ssl.h], [-lcrypto])
850 fi
851
852 if test "$PBX_OPENSSL" = "1";
853 then
854     AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
855 fi
856
857 AST_EXT_LIB_CHECK([FREETDS], [tds], [tds_version], [tds.h])
858 if test "${PBX_FREETDS}" != "0";
859 then
860     case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr}/include/tdsver.h` in
861         *0.64*)
862                 FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_64"
863         ;;
864     *0.63*)
865         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
866         ;;
867     *0.62*)
868         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
869         ;;
870     *)
871         FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
872         ;;
873     esac
874 fi
875
876 AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
877
878 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
879
880 if test "${host_os}" != "linux-gnu" ; then
881   tonezone_extra="-lm"
882 fi
883
884 # new tonezone, version 1.4.0
885 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/tonezone.h], [${tonezone_extra}], [140])
886 # other case, old tonezone (0.80)
887 AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel/zaptel.h], [${tonezone_extra}], [80])
888
889 AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc])
890
891 AC_LANG_PUSH(C++)
892
893 if test "${USE_VPB}" != "no"; then
894    AC_MSG_CHECKING(for vpb_open in -lvpb)
895    saved_libs="${LIBS}"
896    saved_cppflags="${CPPFLAGS}"
897    if test "x${VPB_DIR}" != "x"; then
898       if test -d ${VPB_DIR}/lib; then
899          vpblibdir=${VPB_DIR}/lib
900       else
901          vpblibdir=${VPB_DIR}
902       fi
903       LIBS="${LIBS} -L${vpblibdir}"
904       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
905    fi
906    LIBS="${LIBS} -lvpb -lpthread"
907    AC_LINK_IFELSE(
908         [
909         AC_LANG_PROGRAM(
910         [#include <vpbapi.h>],
911         [int q = vpb_open(0,0);])
912         ],
913         [       AC_MSG_RESULT(yes) 
914                 ac_cv_lib_vpb_vpb_open="yes" 
915         ],
916         [       AC_MSG_RESULT(no) 
917                 ac_cv_lib_vpb_vpb_open="no" 
918         ]
919         )
920    LIBS="${saved_libs}"
921    CPPFLAGS="${saved_cppflags}"
922    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
923         VPB_LIB="-lvpb"
924         if test "${VPB_DIR}" != ""; then
925            VPB_LIB="-L${vpblibdir}  ${VPB_LIB}"
926            VPB_INCLUDE="-I${VPB_DIR}/include"
927         fi
928         PBX_VPB=1
929         AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
930    fi
931 fi
932
933 AC_LANG_POP
934
935 AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
936
937 # Check for various zaptel features and locations.
938 # The version number, which goes into HAVE_ZAPTEL_VERSION,
939 # will be used in the system headers to determine the location
940 # of the zaptel.h header.
941
942 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_TONE_DTMF_BASE], [zaptel/zaptel.h], [140])
943 AST_C_DEFINE_CHECK([ZAPTEL], [ZT_DIAL_OP_CANCEL], [zaptel/zaptel.h], [90])
944
945 # Check for VLDTMF support
946 AST_C_DEFINE_CHECK([ZAPTEL_VLDTMF], [ZT_EVENT_REMOVED], [zaptel/zaptel.h])
947
948 # Check for transcode support
949 AST_C_DEFINE_CHECK([ZAPTEL_TRANSCODE], [ZT_TCOP_ALLOCATE], [zaptel/zaptel.h])
950
951 # On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
952 case "${host_os}" in
953     freebsd*)
954         AST_EXT_LIB_CHECK([ZAPTEL], [zaptel],, [zaptel.h],, [80])
955         AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel/zaptel.h],, [90])
956         AST_EXT_LIB_CHECK([ZAPTEL_VLDTMF], [zaptel],, [zaptel.h],, [80])
957
958         # other case, old tonezone (0.80)
959         AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [zaptel.h], [${tonezone_extra}], [80])
960         ;;
961 esac
962
963 EDITLINE_LIB=""
964 if test "x$TERMCAP_LIB" != "x" ; then
965   EDITLINE_LIB="$TERMCAP_LIB"
966 elif test "x$TINFO_LIB" != "x" ; then
967   EDITLINE_LIB="$TINFO_LIB"
968 elif test "x$CURSES_LIB" != "x" ; then
969   EDITLINE_LIB="$CURSES_LIB"
970 elif test "x$NCURSES_LIB" != "x" ; then
971   EDITLINE_LIB="$NCURSES_LIB"
972 else
973   AC_MSG_ERROR(*** termcap support not found)
974 fi
975 AC_SUBST(EDITLINE_LIB)
976
977 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
978 AC_SUBST(PBX_H323)
979
980 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
981                                    #include <linux/version.h>
982                                    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
983                                    #include <linux/compiler.h>
984                                    #endif
985                                    ])
986 AC_SUBST(PBX_IXJUSER)
987
988 PBX_GTK=0
989 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
990 if test ! "x${GTKCONFIG}" = xNo; then
991    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
992    GTK_LIB=$(${GTKCONFIG} --libs gthread)
993    PBX_GTK=1
994    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
995 fi
996 AC_SUBST(PBX_GTK)
997 AC_SUBST(GTK_INCLUDE)
998 AC_SUBST(GTK_LIB)
999
1000 PBX_GTK2=0
1001 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)
1002 if test ! "x${PKGCONFIG}" = xNo; then
1003    GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags)
1004    GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
1005    PBX_GTK2=1
1006    AC_DEFINE([HAVE_GTK2], 1, [Define if your system has the GTK2 libraries.])
1007 fi
1008 AC_SUBST(PBX_GTK2)
1009 AC_SUBST(GTK2_INCLUDE)
1010 AC_SUBST(GTK2_LIB)
1011
1012 if test "${USE_CURL}" != "no"; then
1013    AC_PATH_TOOL([CURL_CONFIG], [curl-config], No)
1014    if test ! x"${CURL_CONFIG}" = xNo; then
1015    # check for version
1016       if test $(printf "%d" 0x$(${CURL_CONFIG} --vernum)) -ge $(printf "%d" 0x070907); then
1017          CURL_INCLUDE=$(${CURL_CONFIG} --cflags)
1018          CURL_LIB=$(${CURL_CONFIG} --libs)
1019
1020          AC_MSG_CHECKING(for curl_version() in curl/curl.h)
1021          saved_cppflags="${CPPFLAGS}"
1022          CPPFLAGS="${CPPFLAGS} ${CURL_INCLUDE}"
1023          AC_COMPILE_IFELSE(
1024             [AC_LANG_PROGRAM(
1025                 [#include <curl/curl.h>],
1026                     [curl_version();])
1027             ],[
1028                 AC_MSG_RESULT(yes)
1029                 ac_cv_curl_h="yes"
1030             ],[
1031                 AC_MSG_RESULT(no)
1032                 ac_cv_curl_h="no"
1033             ]
1034          )
1035          CPPFLAGS="${saved_cppflags}"
1036          if test "${ac_cv_curl_h}" = "yes"; then
1037              PBX_CURL=1
1038              AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
1039          fi
1040       fi
1041    fi
1042 fi
1043
1044 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
1045 AST_CHECK_MANDATORY
1046
1047 AC_OUTPUT
1048
1049 if test "x${silent}" != "xyes" ; then
1050 echo
1051 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
1052 echo "            .\$7\$7..          .7\$\$7:.    "
1053 echo "          .\$\$:.                 ,\$7.7   "
1054 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
1055 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
1056 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
1057 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
1058 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
1059 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
1060 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
1061 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
1062 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
1063 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
1064 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
1065 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
1066 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
1067 echo " \$\$\$\$\$                        \$\$\$       "
1068 echo "  \$\$\$\$7.                       \$\$  (TM)     "
1069 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
1070 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
1071 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
1072 echo
1073 fi
1074
1075 AC_MSG_NOTICE(Package configured for: )
1076 AC_MSG_NOTICE( OS type  : $host_os)
1077 AC_MSG_NOTICE( Host CPU : $host_cpu)
1078 if test "${cross_compiling}" = "yes"; then
1079    AC_MSG_NOTICE( Cross Compilation = YES)
1080 fi