bc3fd3ea8412fbfaa6d731d4bcafc0f48451c510
[asterisk/asterisk.git] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 AC_PREREQ(2.59)
4
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)
10
11 # cross-compile macros
12 AC_CANONICAL_BUILD
13 AC_CANONICAL_HOST
14 AC_CANONICAL_TARGET
15
16 # check existence of the package
17 AC_CONFIG_SRCDIR([asterisk.c])
18
19 # specify output header file
20 AC_CONFIG_HEADER(include/autoconfig.h)
21
22 AC_COPYRIGHT("Asterisk")
23 AC_REVISION($Revision$)
24
25 AC_PREFIX_DEFAULT()
26
27 ### ** Platform.
28 AC_DEFINE_UNQUOTED(PBX_PLATFORM, "${host}",
29 [Define this to be the canonical name (cpu-vendor-os) of your system.])
30 AC_DEFINE_UNQUOTED(PBX_CPU, "${host_cpu}",
31 [Define this to be the name of the CPU of your system.])
32 AC_DEFINE_UNQUOTED(PBX_VENDOR, "${host_vendor}",
33 [Define this to be the name of the vendor of your system.])
34 AC_DEFINE_UNQUOTED(PBX_OS, "${host_os}",
35 [Define this to be the name of the OS of your system.])
36
37 # export some useful defines
38 PBX_PLATFORM=${host}
39 PBX_CPU=${host_cpu}
40 PBX_VENDOR=${host_vendor}
41 PBX_OS=${host_os}
42 AC_SUBST(PBX_PLATFORM)
43 AC_SUBST(PBX_CPU)
44 AC_SUBST(PBX_VENDOR)
45 AC_SUBST(PBX_OS)
46
47 #  check for uname
48 AC_PATH_TOOL([UNAME], [uname], No)
49 if test ! x"${UNAME}" = xNo; then
50    PBX_OSREV=$(${UNAME} -r)
51 fi
52 AC_SUBST(PBX_OSREV)
53
54 # guest OS type
55 case "${host}" in
56   cygwin*|mingw*|windows*|winnt)
57     AC_DEFINE(Win32, 1,
58               [Define according to your operating system type.])
59     PBX_OSTYPE="CYGWIN"
60 # this is ugly - KPF
61   OSISWIN32=1
62   AC_SUBST(OSISWIN32)
63     ;;
64   *linux*)
65     AC_DEFINE(Linux, 1,
66               [Define according to your operating system type.])
67     PBX_OSTYPE="Linux"
68     ;;
69   *netbsd*)
70     AC_DEFINE(NetBSD, 1,
71               [Define according to your operating system type.])
72     PBX_OSTYPE="NetBSD"
73     ;;
74   *freebsd*)
75     AC_DEFINE(FreeBSD, 1,
76               [Define according to your operating system type.])
77     PBX_OSTYPE="FreeBSD"
78     ;;
79   *openbsd*)
80     AC_DEFINE(OpenBSD, 1,
81               [Define according to your operating system type.])
82     PBX_OSTYPE="OpenBSD"
83     ;;
84   *sun*)
85     AC_DEFINE(SunOS, 1,
86               [Define according to your operating system type.])
87     PBX_OSTYPE="SunOS"
88     ;;
89   *darwin*)
90     AC_DEFINE(Darwin, 1,
91               [Define according to your operating system type.])
92     PBX_OSTYPE="Darwin"
93     ;;
94   *)
95     AC_DEFINE(Unix, 1,
96               [Define according to your operating system type.])
97     PBX_OSTYPE="Unix"
98    ;;
99 esac
100 AC_SUBST(PBX_OSTYPE)
101
102 # This needs to be before any macros that use the C compiler
103 AC_GNU_SOURCE
104
105 AH_TOP(
106 #ifndef _REENTRANT
107 #define _REENTRANT
108 #endif
109 )
110
111 # cross-compile checks
112 if test x"${build}" != x"${host}"; 
113 then
114    AC_CHECK_TOOL(CC, gcc, :)
115    AC_CHECK_TOOL(CXX, g++, :)
116    AC_CHECK_TOOL(RANLIB, ranlib, :)
117    AC_CHECK_TOOL(AR, ar, :)
118
119    if test x"${PBX_OSTYPE}" = xWin32;
120    then
121       AC_CHECK_TOOL(NM, nm, :)
122       AC_CHECK_TOOL(WINDRES, windres, :)
123       AC_CHECK_TOOL(DLLWRAP, dllwrap, :)
124    fi
125    crossCompile="Yes"
126 fi
127
128 # Checks for programs.
129 AC_PROG_CC
130 AC_PROG_CXX
131 AC_PROG_CPP
132 AC_PROG_CXXCPP
133 AC_PROG_AWK
134 AC_PROG_INSTALL
135 AC_PROG_LN_S
136 AC_PROG_RANLIB
137 AST_CHECK_GNU_MAKE
138
139 AC_PATH_PROG([GREP], [grep], :)
140 AC_PATH_PROG([AR], [ar], :)
141 AC_PATH_PROG([FIND], [find], :)
142 AC_PATH_PROG([COMPRESS], [compress], :)
143 AC_PATH_PROG([BASENAME], [basename], :)
144 AC_PATH_PROG([DIRNAME], [dirname], :)
145 AC_PATH_PROG([SHELL], [sh], :)
146 AC_PATH_PROG([LN], [ln], :)
147 AC_PATH_PROG([DOT], [dot], :)
148
149 AC_LANG(C)
150
151 AC_ARG_ENABLE(dev-mode,
152         [  --enable-dev-mode    Turn on developer mode],
153         [case "${enableval}" in
154               y|ye|yes) AST_DEVMODE=yes ;;
155               n|no)  AST_DEVMODE=no ;;
156               *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
157         esac])
158 AC_SUBST(AST_DEVMODE)
159
160 AST_EXT_LIB([asound], [snd_spcm_init], [alsa/asoundlib.h], [ALSA], [Advanced Linux Sound Architecture], [-lm -ldl])
161 AST_EXT_LIB([curses], [initscr], [curses.h], [CURSES], [curses], [])
162 AST_EXT_LIB([nbs], [nbs_connect], [nbs.h], [NBS], [Network Broadcast Sound])
163 AST_EXT_LIB([ncurses], [initscr], [curses.h], [NCURSES], [ncurses], [])
164 AST_EXT_LIB([newt], [newtBell], [newt.h], [NEWT], [newt])
165 AST_EXT_LIB([odbc], [SQLConnect], [sql.h], [UNIXODBC], [unixODBC])
166 AST_EXT_LIB([ogg], [ogg_sync_init], [], [OGG], [OGG])
167 AST_EXT_LIB([osptk], [OSPPCryptoDecrypt], [osp/osp.h], [OSPTK], [OSP Toolkit], [-lcrypto -lssl])
168 AST_EXT_LIB([popt], [poptStrerror], [popt.h], [POPT], [popt])
169 AST_EXT_LIB([pri], [pri_call], [libpri.h], [LIBPRI], [ISDN PRI])
170 AST_EXT_LIB([speex], [speex_encode], [speex/speex.h], [SPEEX], [Speex], [-lm])
171 AST_EXT_LIB([sqlite], [sqlite_exec], [sqlite.h], [SQLITE], [SQLite])
172 AST_EXT_LIB([ssl], [ssl2_connect], [openssl/ssl.h], [OPENSSL], [OpenSSL], [-lcrypto])
173 AST_EXT_LIB([tds], [tds_version], [tds.h], [FREETDS], [FreeTDS])
174 AST_EXT_LIB([vorbis], [vorbis_info_init], [vorbis/codec.h], [VORBIS], [Vorbis], [-lm -lvorbisenc])
175 AST_EXT_LIB([z], [compress], [zlib.h], [ZLIB], [zlib])
176
177 PBX_LIBossaudio=0
178 if test "x${PBX_OSTYPE}" = "xLinux" ; then
179    AC_CHECK_HEADER([linux/soundcard.h],
180                    [PBX_LIBossaudio=1
181                     AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
182                   ])
183 elif test "x${PBX_OSTYPE}" = "xFreeBSD" ; then
184    AC_CHECK_HEADER([sys/soundcard.h],
185                    [PBX_LIBossaudio=1
186                     AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
187                   ])
188 elif test "x${PBX_OSTYPE}" = "xOpenBSD" ; then
189    AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
190 elif test "x${PBX_OSTYPE}" = "xNetBSD" ; then
191    AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
192 fi
193
194 AC_SUBST([PBX_LIBossaudio])
195
196 if test "x${PBX_OSTYPE}" = "xLinux" ; then
197    AST_EXT_LIB([tonezone], [tone_zone_find], [linux/zaptel.h], [ZAPTEL], [Zaptel])
198 else
199    AST_EXT_LIB([tonezone], [tone_zone_find], [zaptel.h], [ZAPTEL], [Zaptel], [-lm])
200 fi
201
202 GSM_INTERNAL="yes"
203 GSM_SYSTEM="yes"
204 AC_ARG_WITH([gsm], AC_HELP_STRING([--with-gsm=PATH], [use libgsm files in PATH, or 'internal']), [
205 case ${withval} in
206      n|no)
207      USE_GSM=no
208      ;;
209      y|ye|yes)
210      ;;
211      internal)
212      GSM_SYSTEM="no"
213      ;;
214      *)
215      GSM_DIR="${withval}"
216      GSM_INTERNAL="no"
217      ;;
218 esac
219 ])
220
221 PBX_LIBgsm=0
222
223 if test "${USE_GSM}" != "no"; then
224    if test "${GSM_SYSTEM}" = "yes"; then
225       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
226       [Define to indicate the GSM library]), [], -L${GSM_DIR}/lib)
227       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
228          gsm_LIB="-lgsm"
229          if test "x${GSM_DIR}" != "x"; then
230             gsm_LIB="-L${GSM_DIR}/lib ${gsm_LIB}"
231             gsm_INCLUDE="-I${GSM_DIR}/include"
232          fi
233          PBX_LIBgsm=1
234          GSM_INTERNAL="no"
235       fi
236    fi
237    if test "${GSM_INTERNAL}" = "yes"; then
238       gsm_LIB="internal"
239       PBX_LIBgsm=1
240    fi
241    if test "x${PBX_LIBgsm}" = "x0"; then
242       echo "***"
243       echo "*** The GSM installation on this system appears to be broken."
244       echo "*** Either correct the installation, or run configure"
245       echo "*** including --without-gsm"
246       exit 1
247    fi
248 fi
249
250 AC_SUBST([gsm_LIB])
251 AC_SUBST([gsm_INCLUDE])
252 AC_SUBST([PBX_LIBgsm])
253
254 AC_ARG_WITH([pq], AC_HELP_STRING([--with-pq=PATH],[use PostgreSQL files in PATH]),[
255 case ${withval} in
256      n|no)
257      USE_PQ=no
258      ;;
259      y|ye|yes)
260      PQ_MANDATORY="yes"
261      ;;
262      *)
263      PQ_DIR="${withval}"
264      PQ_MANDATORY="yes"
265      ;;
266 esac
267 ])
268
269 PBX_LIBpq=0
270 PG_CONFIG=No
271 if test "${USE_PQ}" != "no"; then       
272    if test "x${PQ_DIR}" != "x"; then
273       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PQ_DIR}/bin])
274       if test x"${PG_CONFIG}" = xNo; then
275          echo "***"
276          echo "*** pg_config was not found in the path you specified:"
277          echo "*** ${PQ_DIR}/bin"
278          echo "*** Either correct the installation, or run configure"
279          echo "*** including --without-pq"
280          exit 1
281       fi
282    else
283       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
284    fi
285 fi
286
287 if test x"${PG_CONFIG}" != xNo; then
288    PQ_libdir=`pg_config --libdir`
289    PQ_includedir=`pg_config --includedir`
290    
291    AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PQ], 1,
292    [Define to indicate the PostgreSQL library]), [], -L${PQ_libdir} -lz)
293
294    if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
295       pq_LIB="-L${PQ_libdir} -lpq -lz"
296       pq_INCLUDE="-I${PQ_includedir}"
297       PBX_LIBpq=1
298    elif test ! -z "${PQ_MANDATORY}";
299    then
300       echo "***"
301       echo "*** The PostgreSQL installation on this system appears to be broken."
302       echo "*** Either correct the installation, or run configure"
303       echo "*** including --without-pq"
304       exit 1
305    fi
306 fi
307 AC_SUBST([pq_INCLUDE])
308 AC_SUBST([pq_LIB])
309 AC_SUBST([PBX_LIBpq])
310
311 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
312 AC_SUBST(PBX_H323)
313
314 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
315                                    #include <linux/version.h>
316                                    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
317                                    #include <linux/compiler.h>
318                                    #endif
319                                    ])
320 AC_SUBST(PBX_IXJUSER)
321
322 AC_LANG_PUSH(C++)
323
324 AC_ARG_WITH([vpb], AC_HELP_STRING([--with-vpb=PATH],[use vpb files in PATH]),[
325 case ${withval} in
326      n|no)
327      USE_VPB=no
328      VPB_MANDATORY="yes"
329      ;;
330      y|ye|yes)
331      ;;
332      *)
333      VPB_DIR="${withval}"
334      VPB_MANDATORY="yes"
335      ;;
336 esac
337 ])
338 if test "${USE_VPB}" != "no"; then
339    echo -n "checking for vpb_open in -lvpb..."
340    saved_libs="${LIBS}"
341    saved_cppflags="${CPPFLAGS}"
342    if test "x${VPB_DIR}" != "x" ; then
343       LIBS="${LIBS} -L${VPB_DIR}/lib"
344       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
345    fi
346    LIBS="${LIBS} -lvpb -lpthread"
347    AC_LINK_IFELSE(
348         [
349         AC_LANG_PROGRAM(
350         [#include <vpbapi.h>],
351         [int q = vpb_open(0,0);])
352         ],
353         [       AC_MSG_RESULT(yes) 
354                 ac_cv_lib_vpb_vpb_open="yes" 
355         ],
356         [       AC_MSG_RESULT(no) 
357                 ac_cv_lib_vpb_vpb_open="no" 
358         ]
359         )
360    LIBS="${saved_libs}"
361    CPPFLAGS="${saved_cppflags}"
362    PBX_LIBvpb=0
363    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
364         VPB_LIB="-lvpb"
365         if test "${VPB_DIR}" != ""; then
366            VPB_LIB="-L${VPB_DIR}/lib ${VPB_LIB}"
367            VPB_INCLUDE="-I${VPB_DIR}/include"
368            AC_SUBST([VPB_INCLUDE])
369         fi
370         AC_SUBST([VPB_LIB])
371         PBX_LIBvpb=1
372         AC_DEFINE([HAVE_LIBVPB], 1, [Define if your system has the VoiceTronix (vpb) libraries.])
373    elif test ! -z "${VPB_MANDATORY}"; 
374    then
375       echo "***"
376       echo "*** The VoiceTronix (vpb) installation on this system appears to be broken."
377       echo "*** Either correct the installation, or run configure"
378       echo "*** including --without-vpb."
379       exit 1
380    fi
381 fi
382 AC_SUBST([PBX_LIBvpb])
383
384 AC_ARG_WITH([qt], AC_HELP_STRING([--with-qt=PATH],[use Qt files in PATH]),[
385 case ${withval} in
386      n|no)
387      USE_QT=no
388      QT_MANDATORY="yes"
389      ;;
390      y|ye|yes)
391      ;;
392      *)
393      QT_DIR="${withval}"
394      QT_MANDATORY="yes"
395      ;;
396 esac
397 ])
398
399 PBX_QT=0
400 if test "${USE_QT}" != "no"; then
401    echo -n "checking for QDate in -lqt..."
402    saved_ldflags="${LDFLAGS}"
403    LDFLAGS="${LDFLAGS} -L${QT_DIR}/lib -lqt"
404    qtlib="qt"
405         AC_LINK_IFELSE(
406         [
407                 AC_LANG_PROGRAM(
408                 [#include "${QT_DIR}include/qdatetime.h"],
409                 [QDate date();])
410         ],
411         [ac_cv_lib_qt_qt_date="yes"],
412         [ac_cv_lib_qt_qt_date="no"])
413                 
414         if test "${ac_cv_lib_qt_qt_date}" = "no"; then
415                 qtlib="qt-mt"   
416         LDFLAGS="${saved_ldflags} -L${QT_DIR}/lib -lqt-mt"
417                 AC_LINK_IFELSE(
418                 [
419                         AC_LANG_PROGRAM(
420                         [#include "${QT_DIR}include/qdatetime.h"],
421                         [QDate date();])
422                 ],
423                 [ac_cv_lib_qt_qt_date="yes"],
424                 [ac_cv_lib_qt_qt_date="no"])
425         fi      
426         
427         LDFLAGS="${saved_ldflags}"
428         
429         if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
430                 AC_MSG_RESULT(yes) 
431         else
432                 AC_MSG_RESULT(no) 
433         fi
434         
435         if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
436                 QT_LIB="-l${qtlib}"
437                 if test "${QT_DIR}" != ""; then
438                         QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
439                         QT_INCLUDE="-I${QT_DIR}/include"
440                         AC_SUBST([QT_INCLUDE])
441                 fi
442                 AC_SUBST([QT_LIB])
443                 PBX_QT=1
444                 AC_DEFINE([HAVE_LIBQT], 1, [Define if your system has the Qt library])
445                 AC_PATH_TOOL(QTMOC, moc, No)
446    elif test ! -z "${QT_MANDATORY}"; 
447    then
448       echo "***"
449       echo "*** The Qt installation on this system appears to be broken."
450       echo "*** Either correct the installation, or run configure"
451       echo "*** including --without-qt."
452       exit 1
453    fi
454 fi
455 AC_SUBST([PBX_QT])
456
457
458
459
460 AC_ARG_WITH([kde], AC_HELP_STRING([--with-kde=PATH],[use KDE files in PATH]),[
461 case ${withval} in
462      n|no)
463      USE_KDE=no
464      KDE_MANDATORY="yes"
465      ;;
466      y|ye|yes)
467      ;;
468      *)
469      KDE_DIR="${withval}"
470      KDE_MANDATORY="yes"
471      ;;
472 esac
473 ])
474
475 PBX_KDE=0
476 if test "${USE_KDE}" != "no"; then
477    echo -n "checking for crashHandler in -lkdecore..."
478    saved_ldflags="${LDFLAGS}"
479    LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
480         AC_LINK_IFELSE(
481         [
482                 AC_LANG_PROGRAM(
483                 [#include "kcrash.h"],
484                 [KCrash::defaultCrashHandler(1);])
485         ],
486         [ac_cv_lib_kde_crash="yes"],
487         [ac_cv_lib_kde_crash="no"])
488                 
489         LDFLAGS="${saved_ldflags}"
490         
491         if test "${ac_cv_lib_kde_crash}" = "yes"; then
492                 AC_MSG_RESULT(yes) 
493         else
494                 AC_MSG_RESULT(no) 
495         fi
496         
497         if test "${ac_cv_lib_kde_crash}" = "yes"; then
498                 KDE_LIBS="-lkdecore -lkdeui"
499                 if test "${KDE_DIR}" != ""; then
500                         KDE_LIBS="-L${KDE_DIR}/lib ${KDE_LIBS}"
501                         KDE_INCLUDE="-I${KDE_DIR}/include"
502                         AC_SUBST([KDE_INCLUDE])
503                 fi
504                 AC_SUBST([KDE_LIBS])
505                 PBX_KDE=1
506                 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE library])
507    elif test ! -z "${KDE_MANDATORY}"; 
508    then
509       echo "***"
510       echo "*** The KDE installation on this system appears to be broken."
511       echo "*** Either correct the installation, or run configure"
512       echo "*** including --without-kde."
513       exit 1
514    fi
515 fi
516 AC_SUBST([PBX_KDE])
517
518 if test x"${PBX_KDE}" = x1; then
519         AC_PATH_TOOL(KDEINIT, kdeinit, No)
520         if test ! x"${KDEINIT}" = xNo; then
521         KDEDIR=$(${DIRNAME} ${KDEINIT})
522         KDEDIR=$(${DIRNAME} ${KDEDIR})
523         fi
524         AC_SUBST([KDEDIR])
525 fi
526
527 AC_LANG_POP
528
529 PBX_GTK=0
530 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
531 if test ! "x${GTKCONFIG}" = xNo; then
532    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
533    GTK_LIBS=$(${GTKCONFIG} --libs gthread)
534    PBX_GTK=1
535    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
536 fi
537 AC_SUBST(PBX_GTK)
538 AC_SUBST(GTK_INCLUDE)
539 AC_SUBST(GTK_LIBS)
540
541 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
542
543 AC_ARG_WITH([pwlib], AC_HELP_STRING([--with-pwlib=PATH],[use PWLib files in PATH]),[
544 case ${withval} in
545      n|no)
546      USE_PWLIB=no
547      ;;
548      y|ye|yes)
549      ;;
550      *)
551      PWLIB_DIR="${withval}"
552      ;;
553 esac
554 ])
555 if test "${USE_PWLIB}" != "no"; then
556         echo -n "checking for existence of pwlib..."
557         
558         saved_ldflags="${LDFLAGS}"
559         LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
560         
561         AC_LINK_IFELSE(
562         [
563         AC_LANG_PROGRAM(
564         [#include "${PWDIR_DIR}ptime.h"],
565         [int q = PTime::IsDaylightSaving();])
566         ],
567         [       AC_MSG_RESULT(yes) 
568                 ac_cv_lib_pwlib="yes" 
569         ],
570         [       AC_MSG_RESULT(no) 
571                 ac_cv_lib_pwlib="no" 
572         ]
573         )
574         LDFLAGS="${saved_ldflags}"
575
576         PBX_LIBPWLIB=0
577    
578    if test "${ac_cv_lib_pwlib}" = "yes"; then
579       PWLIB_LIB="-l{PLATFORM_PWLIB}"
580       if test "${PWLIB_DIR}" != ""; then
581          PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
582                         PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
583                         AC_SUBST([PWLIB_INCLUDE])
584       fi
585         AC_SUBST([PWLIB_LIB])
586         PBX_LIBPWLIB=1
587         AC_DEFINE([HAVE_LIBPWLIB], 1, [Define if your system has the pwlib libraries.])
588    elif test ! -z "${PWLIB_DIR}"; 
589    then
590       echo "***"
591       echo "*** The PWLIB installation on this system appears to be broken."
592       echo "*** Either correct the installation, or run configure"
593       echo "*** including --without-pwlib"
594       exit 1
595    fi
596 fi
597 AC_SUBST([PBX_LIBPWLIB])
598
599 PBX_CURL=0
600 AC_PATH_TOOL([CURL], [curl-config], No)
601 if test ! x"${CURL}" = xNo; then
602 # check for version
603    CURLLIBS=$(${CURL} --libs)
604    PBX_CURL=1
605    AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
606 fi
607 AC_SUBST(PBX_CURL)
608 AC_SUBST(CURLLIBS)
609
610 AC_FUNC_ALLOCA
611 AC_HEADER_DIRENT
612 AC_HEADER_STDC
613 AC_HEADER_SYS_WAIT
614 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])
615
616 AC_SYS_LARGEFILE
617
618 # Checks for typedefs, structures, and compiler characteristics.
619 AC_HEADER_STDBOOL
620 AC_C_CONST
621 AC_TYPE_UID_T
622 AC_C_INLINE
623 AC_TYPE_MODE_T
624 AC_TYPE_OFF_T
625 AC_TYPE_PID_T
626 AC_TYPE_SIZE_T
627 AC_CHECK_MEMBERS([struct stat.st_blksize])
628 AC_HEADER_TIME
629 AC_STRUCT_TM
630 AC_C_VOLATILE
631 AC_CHECK_TYPES([ptrdiff_t])
632
633 # Checks for library functions.
634 AC_FUNC_CHOWN
635 AC_FUNC_CLOSEDIR_VOID
636 AC_FUNC_ERROR_AT_LINE
637 AC_FUNC_FORK
638 AC_FUNC_FSEEKO
639 AC_PROG_GCC_TRADITIONAL
640 AC_FUNC_MALLOC
641 AC_FUNC_MEMCMP
642 AC_FUNC_MKTIME
643 AC_FUNC_MMAP
644 AC_FUNC_REALLOC
645 AC_FUNC_SELECT_ARGTYPES
646 AC_FUNC_SETVBUF_REVERSED
647 AC_TYPE_SIGNAL
648 AC_FUNC_STAT
649 AC_FUNC_STRCOLL
650 AC_FUNC_STRFTIME
651 AC_FUNC_STRNLEN
652 AC_FUNC_STRTOD
653 AC_FUNC_UTIME_NULL
654 AC_FUNC_VPRINTF
655 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 strrchr strsep strspn strstr strtol unsetenv utime strtoq strcasestr asprintf vasprintf])
656
657 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
658 AC_OUTPUT
659
660 echo
661 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
662 echo "            .\$7\$7..          .7\$\$7:.    "
663 echo "          .\$\$:.                 ,\$7.7   "
664 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
665 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
666 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
667 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
668 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
669 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
670 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
671 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
672 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
673 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
674 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
675 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
676 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
677 echo " \$\$\$\$\$                        \$\$\$       "
678 echo "  \$\$\$\$7.                       \$\$  (TM)     "
679 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
680 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
681 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
682 echo
683
684 echo "Package configured for: "
685 echo " OS type  : $PBX_OSTYPE"
686 echo " host cpu : $host_cpu"
687 if test "x${crossCompile}" = xYes; then
688    echo ""
689    echo " Cross Compilation = YES"
690    echo " Target            = ${host}"
691 fi
692