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