do check for ixjuser.h in a way that can actually succeed :-)
[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_ARG_WITH([vpb], AC_HELP_STRING([--with-vpb=PATH],[use vpb files in PATH]),[
323 case ${withval} in
324      n|no)
325      USE_VPB=no
326      VPB_MANDATORY="yes"
327      ;;
328      y|ye|yes)
329      ;;
330      *)
331      VPB_DIR="${withval}"
332      VPB_MANDATORY="yes"
333      ;;
334 esac
335 ])
336 if test "${USE_VPB}" != "no"; then
337    echo -n "checking for vpb_open in -lvpb..."
338    saved_ldflags="${LDFLAGS}"
339    LDFLAGS="${LDFLAGS} -L${VPB_DIR} -lvpb"
340    AC_LINK_IFELSE(
341         [
342         AC_LANG_PROGRAM(
343         [#include "${VPB_DIR}vpbapi.h"],
344         [int q = vpb_open(0,0);])
345         ],
346         [       AC_MSG_RESULT(yes) 
347                 ac_cv_lib_vpb_vpb_open="yes" 
348         ],
349         [       AC_MSG_RESULT(no) 
350                 ac_cv_lib_vpb_vpb_open="no" 
351         ]
352         )
353         LDFLAGS="${saved_ldflags}"
354
355         PBX_LIBvpb=0
356         if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
357         VPB_LIB="-lvpb"
358         if test "${VPB_DIR}" != ""; then
359         VPB_LIB="-L${VPB_DIR}/lib ${VPB_LIB}"
360         VPB_INCLUDE="-I${VPB_DIR}/include"
361         AC_SUBST([VPB_INCLUDE])
362         fi
363         AC_SUBST([VPB_LIB])
364         PBX_LIBvpb=1
365         AC_DEFINE([HAVE_LIBVPB], 1, [Define if your system has the VoiceTronix (vpb) libraries.])
366    elif test ! -z "${VPB_MANDATORY}"; 
367    then
368       echo "***"
369       echo "*** The VoiceTronix (vpb) installation on this system appears to be broken."
370       echo "*** Either correct the installation, or run configure"
371       echo "*** including --without-vpb."
372       exit 1
373    fi
374 fi
375 AC_SUBST([PBX_LIBvpb])
376
377
378 AC_LANG_PUSH(C++)
379
380 AC_ARG_WITH([qt], AC_HELP_STRING([--with-qt=PATH],[use Qt files in PATH]),[
381 case ${withval} in
382      n|no)
383      USE_QT=no
384      QT_MANDATORY="yes"
385      ;;
386      y|ye|yes)
387      ;;
388      *)
389      QT_DIR="${withval}"
390      QT_MANDATORY="yes"
391      ;;
392 esac
393 ])
394
395 PBX_QT=0
396 if test "${USE_QT}" != "no"; then
397    echo -n "checking for QDate in -lqt..."
398    saved_ldflags="${LDFLAGS}"
399    LDFLAGS="${LDFLAGS} -L${QT_DIR}/lib -lqt"
400    qtlib="qt"
401         AC_LINK_IFELSE(
402         [
403                 AC_LANG_PROGRAM(
404                 [#include "${QT_DIR}include/qdatetime.h"],
405                 [QDate date();])
406         ],
407         [ac_cv_lib_qt_qt_date="yes"],
408         [ac_cv_lib_qt_qt_date="no"])
409                 
410         if test "${ac_cv_lib_qt_qt_date}" = "no"; then
411                 qtlib="qt-mt"   
412         LDFLAGS="${saved_ldflags} -L${QT_DIR}/lib -lqt-mt"
413                 AC_LINK_IFELSE(
414                 [
415                         AC_LANG_PROGRAM(
416                         [#include "${QT_DIR}include/qdatetime.h"],
417                         [QDate date();])
418                 ],
419                 [ac_cv_lib_qt_qt_date="yes"],
420                 [ac_cv_lib_qt_qt_date="no"])
421         fi      
422         
423         LDFLAGS="${saved_ldflags}"
424         
425         if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
426                 AC_MSG_RESULT(yes) 
427         else
428                 AC_MSG_RESULT(no) 
429         fi
430         
431         if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
432                 QT_LIB="-l${qtlib}"
433                 if test "${QT_DIR}" != ""; then
434                         QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
435                         QT_INCLUDE="-I${QT_DIR}/include"
436                         AC_SUBST([QT_INCLUDE])
437                 fi
438                 AC_SUBST([QT_LIB])
439                 PBX_QT=1
440                 AC_DEFINE([HAVE_LIBQT], 1, [Define if your system has the Qt library])
441                 AC_PATH_TOOL(QTMOC, moc, No)
442    elif test ! -z "${QT_MANDATORY}"; 
443    then
444       echo "***"
445       echo "*** The Qt installation on this system appears to be broken."
446       echo "*** Either correct the installation, or run configure"
447       echo "*** including --without-qt."
448       exit 1
449    fi
450 fi
451 AC_SUBST([PBX_QT])
452
453
454
455
456 AC_ARG_WITH([kde], AC_HELP_STRING([--with-kde=PATH],[use KDE files in PATH]),[
457 case ${withval} in
458      n|no)
459      USE_KDE=no
460      KDE_MANDATORY="yes"
461      ;;
462      y|ye|yes)
463      ;;
464      *)
465      KDE_DIR="${withval}"
466      KDE_MANDATORY="yes"
467      ;;
468 esac
469 ])
470
471 PBX_KDE=0
472 if test "${USE_KDE}" != "no"; then
473    echo -n "checking for crashHandler in -lkdecore..."
474    saved_ldflags="${LDFLAGS}"
475    LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
476         AC_LINK_IFELSE(
477         [
478                 AC_LANG_PROGRAM(
479                 [#include "kcrash.h"],
480                 [KCrash::defaultCrashHandler(1);])
481         ],
482         [ac_cv_lib_kde_crash="yes"],
483         [ac_cv_lib_kde_crash="no"])
484                 
485         LDFLAGS="${saved_ldflags}"
486         
487         if test "${ac_cv_lib_kde_crash}" = "yes"; then
488                 AC_MSG_RESULT(yes) 
489         else
490                 AC_MSG_RESULT(no) 
491         fi
492         
493         if test "${ac_cv_lib_kde_crash}" = "yes"; then
494                 KDE_LIBS="-lkdecore -lkdeui"
495                 if test "${KDE_DIR}" != ""; then
496                         KDE_LIBS="-L${KDE_DIR}/lib ${KDE_LIBS}"
497                         KDE_INCLUDE="-I${KDE_DIR}/include"
498                         AC_SUBST([KDE_INCLUDE])
499                 fi
500                 AC_SUBST([KDE_LIBS])
501                 PBX_KDE=1
502                 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE library])
503    elif test ! -z "${KDE_MANDATORY}"; 
504    then
505       echo "***"
506       echo "*** The KDE installation on this system appears to be broken."
507       echo "*** Either correct the installation, or run configure"
508       echo "*** including --without-kde."
509       exit 1
510    fi
511 fi
512 AC_SUBST([PBX_KDE])
513
514 if test x"${PBX_KDE}" = x1; then
515         AC_PATH_TOOL(KDEINIT, kdeinit, No)
516         if test ! x"${KDEINIT}" = xNo; then
517         KDEDIR=$(${DIRNAME} ${KDEINIT})
518         KDEDIR=$(${DIRNAME} ${KDEDIR})
519         fi
520         AC_SUBST([KDEDIR])
521 fi
522
523 AC_LANG_POP
524
525 PBX_GTK=0
526 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
527 if test ! "x${GTKCONFIG}" = xNo; then
528    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
529    GTK_LIBS=$(${GTKCONFIG} --libs gthread)
530    PBX_GTK=1
531    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
532 fi
533 AC_SUBST(PBX_GTK)
534 AC_SUBST(GTK_INCLUDE)
535 AC_SUBST(GTK_LIBS)
536
537 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
538
539 AC_ARG_WITH([pwlib], AC_HELP_STRING([--with-pwlib=PATH],[use PWLib files in PATH]),[
540 case ${withval} in
541      n|no)
542      USE_PWLIB=no
543      ;;
544      y|ye|yes)
545      ;;
546      *)
547      PWLIB_DIR="${withval}"
548      ;;
549 esac
550 ])
551 if test "${USE_PWLIB}" != "no"; then
552         echo -n "checking for existence of pwlib..."
553         
554         saved_ldflags="${LDFLAGS}"
555         LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
556         
557         AC_LINK_IFELSE(
558         [
559         AC_LANG_PROGRAM(
560         [#include "${PWDIR_DIR}ptime.h"],
561         [int q = PTime::IsDaylightSaving();])
562         ],
563         [       AC_MSG_RESULT(yes) 
564                 ac_cv_lib_pwlib="yes" 
565         ],
566         [       AC_MSG_RESULT(no) 
567                 ac_cv_lib_pwlib="no" 
568         ]
569         )
570         LDFLAGS="${saved_ldflags}"
571
572         PBX_LIBPWLIB=0
573    
574    if test "${ac_cv_lib_pwlib}" = "yes"; then
575       PWLIB_LIB="-l{PLATFORM_PWLIB}"
576       if test "${PWLIB_DIR}" != ""; then
577          PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
578                         PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
579                         AC_SUBST([PWLIB_INCLUDE])
580       fi
581         AC_SUBST([PWLIB_LIB])
582         PBX_LIBPWLIB=1
583         AC_DEFINE([HAVE_LIBPWLIB], 1, [Define if your system has the pwlib libraries.])
584    elif test ! -z "${PWLIB_DIR}"; 
585    then
586       echo "***"
587       echo "*** The PWLIB installation on this system appears to be broken."
588       echo "*** Either correct the installation, or run configure"
589       echo "*** including --without-pwlib"
590       exit 1
591    fi
592 fi
593 AC_SUBST([PBX_LIBPWLIB])
594
595 PBX_CURL=0
596 AC_PATH_TOOL([CURL], [curl-config], No)
597 if test ! x"${CURL}" = xNo; then
598 # check for version
599    CURLLIBS=$(${CURL} --libs)
600    PBX_CURL=1
601    AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
602 fi
603 AC_SUBST(PBX_CURL)
604 AC_SUBST(CURLLIBS)
605
606 AC_FUNC_ALLOCA
607 AC_HEADER_DIRENT
608 AC_HEADER_STDC
609 AC_HEADER_SYS_WAIT
610 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])
611
612 AC_SYS_LARGEFILE
613
614 # Checks for typedefs, structures, and compiler characteristics.
615 AC_HEADER_STDBOOL
616 AC_C_CONST
617 AC_TYPE_UID_T
618 AC_C_INLINE
619 AC_TYPE_MODE_T
620 AC_TYPE_OFF_T
621 AC_TYPE_PID_T
622 AC_TYPE_SIZE_T
623 AC_CHECK_MEMBERS([struct stat.st_blksize])
624 AC_HEADER_TIME
625 AC_STRUCT_TM
626 AC_C_VOLATILE
627 AC_CHECK_TYPES([ptrdiff_t])
628
629 # Checks for library functions.
630 AC_FUNC_CHOWN
631 AC_FUNC_CLOSEDIR_VOID
632 AC_FUNC_ERROR_AT_LINE
633 AC_FUNC_FORK
634 AC_FUNC_FSEEKO
635 AC_PROG_GCC_TRADITIONAL
636 AC_FUNC_MALLOC
637 AC_FUNC_MEMCMP
638 AC_FUNC_MKTIME
639 AC_FUNC_MMAP
640 AC_FUNC_REALLOC
641 AC_FUNC_SELECT_ARGTYPES
642 AC_FUNC_SETVBUF_REVERSED
643 AC_TYPE_SIGNAL
644 AC_FUNC_STAT
645 AC_FUNC_STRCOLL
646 AC_FUNC_STRFTIME
647 AC_FUNC_STRNLEN
648 AC_FUNC_STRTOD
649 AC_FUNC_UTIME_NULL
650 AC_FUNC_VPRINTF
651 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])
652
653 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
654 AC_OUTPUT
655
656 echo
657 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
658 echo "            .\$7\$7..          .7\$\$7:.    "
659 echo "          .\$\$:.                 ,\$7.7   "
660 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
661 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
662 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
663 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
664 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
665 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
666 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
667 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
668 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
669 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
670 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
671 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
672 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
673 echo " \$\$\$\$\$                        \$\$\$       "
674 echo "  \$\$\$\$7.                       \$\$  (TM)     "
675 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
676 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
677 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
678 echo
679
680 echo "Package configured for: "
681 echo " OS type  : $PBX_OSTYPE"
682 echo " host cpu : $host_cpu"
683 if test "x${crossCompile}" = xYes; then
684    echo ""
685    echo " Cross Compilation = YES"
686    echo " Target            = ${host}"
687 fi
688