don't put bogus paths like -L/lib into link commands
[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 AC_CHECK_HEADER([linux/soundcard.h],
179                 [
180                 PBX_LIBossaudio=1
181                 AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
182                 ])
183 if test "$PBX_LIBossaudio" = "0"; then
184    AC_CHECK_HEADER([sys/soundcard.h],
185                    [
186                    PBX_LIBossaudio=1
187                    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
188                    ])
189 fi
190 if test "$PBX_LIBossaudio" = "0"; 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 AST_EXT_LIB([tonezone], [tone_zone_find], [linux/zaptel.h], [ZAPTEL], [Zaptel])
197 if test "$PBX_LIBtonezone" = "0"; then
198    AST_EXT_LIB([tonezone], [tone_zone_find], [zaptel.h], [ZAPTEL], [Zaptel], [-lm])
199 fi
200
201 GSM_INTERNAL="yes"
202 GSM_SYSTEM="yes"
203 AC_ARG_WITH([gsm], AC_HELP_STRING([--with-gsm=PATH], [use libgsm files in PATH, or 'internal']), [
204 case ${withval} in
205      n|no)
206      USE_GSM=no
207      ;;
208      y|ye|yes)
209      ;;
210      internal)
211      GSM_SYSTEM="no"
212      ;;
213      *)
214      GSM_DIR="${withval}"
215      GSM_INTERNAL="no"
216      ;;
217 esac
218 ])
219
220 PBX_LIBgsm=0
221
222 if test "${USE_GSM}" != "no"; then
223    if test "${GSM_SYSTEM}" = "yes"; then
224       libdir=""
225       if test "x${GSM_DIR}" != "x"; then
226          libdir="-L${GSM_DIR}/lib"
227       fi
228       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
229       [Define to indicate the GSM library]), [], ${libdir})
230       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
231          gsm_LIB="-lgsm"
232          if test "x${GSM_DIR}" != "x"; then
233             gsm_LIB="${libdir} ${gsm_LIB}"
234             gsm_INCLUDE="-I${GSM_DIR}/include"
235          fi
236          PBX_LIBgsm=1
237          GSM_INTERNAL="no"
238       fi
239    fi
240    if test "${GSM_INTERNAL}" = "yes"; then
241       gsm_LIB="internal"
242       PBX_LIBgsm=1
243    fi
244    if test "x${PBX_LIBgsm}" = "x0"; then
245       echo "***"
246       echo "*** The GSM installation on this system appears to be broken."
247       echo "*** Either correct the installation, or run configure"
248       echo "*** including --without-gsm"
249       exit 1
250    fi
251 fi
252
253 AC_SUBST([gsm_LIB])
254 AC_SUBST([gsm_INCLUDE])
255 AC_SUBST([PBX_LIBgsm])
256
257 AC_ARG_WITH([pq], AC_HELP_STRING([--with-pq=PATH],[use PostgreSQL files in PATH]),[
258 case ${withval} in
259      n|no)
260      USE_PQ=no
261      ;;
262      y|ye|yes)
263      PQ_MANDATORY="yes"
264      ;;
265      *)
266      PQ_DIR="${withval}"
267      PQ_MANDATORY="yes"
268      ;;
269 esac
270 ])
271
272 PBX_LIBpq=0
273 PG_CONFIG=No
274 if test "${USE_PQ}" != "no"; then       
275    if test "x${PQ_DIR}" != "x"; then
276       AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PQ_DIR}/bin])
277       if test x"${PG_CONFIG}" = xNo; then
278          echo "***"
279          echo "*** pg_config was not found in the path you specified:"
280          echo "*** ${PQ_DIR}/bin"
281          echo "*** Either correct the installation, or run configure"
282          echo "*** including --without-pq"
283          exit 1
284       fi
285    else
286       AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
287    fi
288 fi
289
290 if test x"${PG_CONFIG}" != xNo; then
291    PQ_libdir=`pg_config --libdir`
292    PQ_includedir=`pg_config --includedir`
293    
294    AC_CHECK_LIB([pq], [PQexec], AC_DEFINE_UNQUOTED([HAVE_PQ], 1,
295    [Define to indicate the PostgreSQL library]), [], -L${PQ_libdir} -lz)
296
297    if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
298       pq_LIB="-L${PQ_libdir} -lpq -lz"
299       pq_INCLUDE="-I${PQ_includedir}"
300       PBX_LIBpq=1
301    elif test ! -z "${PQ_MANDATORY}";
302    then
303       echo "***"
304       echo "*** The PostgreSQL installation on this system appears to be broken."
305       echo "*** Either correct the installation, or run configure"
306       echo "*** including --without-pq"
307       exit 1
308    fi
309 fi
310 AC_SUBST([pq_INCLUDE])
311 AC_SUBST([pq_LIB])
312 AC_SUBST([PBX_LIBpq])
313
314 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
315 AC_SUBST(PBX_H323)
316
317 AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
318                                    #include <linux/version.h>
319                                    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
320                                    #include <linux/compiler.h>
321                                    #endif
322                                    ])
323 AC_SUBST(PBX_IXJUSER)
324
325 AC_LANG_PUSH(C++)
326
327 AC_ARG_WITH([vpb], AC_HELP_STRING([--with-vpb=PATH],[use vpb files in PATH]),[
328 case ${withval} in
329      n|no)
330      USE_VPB=no
331      VPB_MANDATORY="yes"
332      ;;
333      y|ye|yes)
334      ;;
335      *)
336      VPB_DIR="${withval}"
337      VPB_MANDATORY="yes"
338      ;;
339 esac
340 ])
341 if test "${USE_VPB}" != "no"; then
342    echo -n "checking for vpb_open in -lvpb..."
343    saved_libs="${LIBS}"
344    saved_cppflags="${CPPFLAGS}"
345    if test "x${VPB_DIR}" != "x"; then
346       LIBS="${LIBS} -L${VPB_DIR}/lib"
347       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
348    fi
349    LIBS="${LIBS} -lvpb -lpthread"
350    AC_LINK_IFELSE(
351         [
352         AC_LANG_PROGRAM(
353         [#include <vpbapi.h>],
354         [int q = vpb_open(0,0);])
355         ],
356         [       AC_MSG_RESULT(yes) 
357                 ac_cv_lib_vpb_vpb_open="yes" 
358         ],
359         [       AC_MSG_RESULT(no) 
360                 ac_cv_lib_vpb_vpb_open="no" 
361         ]
362         )
363    LIBS="${saved_libs}"
364    CPPFLAGS="${saved_cppflags}"
365    PBX_LIBvpb=0
366    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
367         VPB_LIB="-lvpb"
368         if test "${VPB_DIR}" != ""; then
369            VPB_LIB="-L${VPB_DIR}/lib ${VPB_LIB}"
370            VPB_INCLUDE="-I${VPB_DIR}/include"
371            AC_SUBST([VPB_INCLUDE])
372         fi
373         AC_SUBST([VPB_LIB])
374         PBX_LIBvpb=1
375         AC_DEFINE([HAVE_LIBVPB], 1, [Define if your system has the VoiceTronix (vpb) libraries.])
376    elif test ! -z "${VPB_MANDATORY}"; 
377    then
378       echo "***"
379       echo "*** The VoiceTronix (vpb) installation on this system appears to be broken."
380       echo "*** Either correct the installation, or run configure"
381       echo "*** including --without-vpb."
382       exit 1
383    fi
384 fi
385 AC_SUBST([PBX_LIBvpb])
386
387 AC_ARG_WITH([qt], AC_HELP_STRING([--with-qt=PATH],[use Qt files in PATH]),[
388 case ${withval} in
389      n|no)
390      USE_QT=no
391      QT_MANDATORY="yes"
392      ;;
393      y|ye|yes)
394      ;;
395      *)
396      QT_DIR="${withval}"
397      QT_MANDATORY="yes"
398      ;;
399 esac
400 ])
401
402 PBX_QT=0
403 if test "${USE_QT}" != "no"; then
404    echo -n "checking for QDate in -lqt..."
405    saved_libs="${LIBS}"
406    saved_cppflags="${CPPFLAGS}"
407    if test "x${QT_DIR}" != "x"; then
408       LIBS="${LIBS} -L${QT_DIR}/lib"
409       CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
410    fi
411    LIBS="${LIBS} -lqt"
412    qtlib="qt"
413    AC_LINK_IFELSE(
414         [
415                 AC_LANG_PROGRAM(
416                 [#include <qt3/qdatetime.h>],
417                 [QDate date();])
418         ],
419         [ac_cv_lib_qt_qt_date="yes"],
420         [ac_cv_lib_qt_qt_date="no"])
421    LIBS="${saved_libs}"
422    CPPFLAGS="${saved_cppflags}"
423         
424    if test "${ac_cv_lib_qt_qt_date}" = "no"; then
425       saved_libs="${LIBS}"
426       saved_cppflags="${CPPFLAGS}"
427       if test "x${QT_DIR}" != "x"; then
428          LIBS="${LIBS} -L${QT_DIR}/lib"
429          CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
430       fi
431       LIBS="${LIBS} -lqt-mt"
432       qtlib="qt-mt"     
433       AC_LINK_IFELSE(
434                 [
435                         AC_LANG_PROGRAM(
436                         [#include <qt3/qdatetime.h>],
437                         [QDate date();])
438                 ],
439                 [ac_cv_lib_qt_qt_date="yes"],
440                 [ac_cv_lib_qt_qt_date="no"])
441       LIBS="${saved_libs}"
442       CPPFLAGS="${saved_cppflags}"
443    fi   
444
445    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
446       AC_MSG_RESULT(yes) 
447    else
448       AC_MSG_RESULT(no) 
449    fi
450         
451    if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
452       QT_LIB="-l${qtlib}"
453       if test "${QT_DIR}" != ""; then
454          QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
455          QT_INCLUDE="-I${QT_DIR}/include"
456          AC_SUBST([QT_INCLUDE])
457       fi
458       AC_SUBST([QT_LIB])
459       PBX_QT=1
460       AC_DEFINE([HAVE_LIBQT], 1, [Define if your system has the Qt library])
461       AC_PATH_TOOL(QTMOC, moc, No)
462    elif test ! -z "${QT_MANDATORY}"; 
463    then
464       echo "***"
465       echo "*** The Qt installation on this system appears to be broken."
466       echo "*** Either correct the installation, or run configure"
467       echo "*** including --without-qt."
468       exit 1
469    fi
470 fi
471 AC_SUBST([PBX_QT])
472
473 AC_ARG_WITH([kde], AC_HELP_STRING([--with-kde=PATH],[use KDE files in PATH]),[
474 case ${withval} in
475      n|no)
476      USE_KDE=no
477      KDE_MANDATORY="yes"
478      ;;
479      y|ye|yes)
480      ;;
481      *)
482      KDE_DIR="${withval}"
483      KDE_MANDATORY="yes"
484      ;;
485 esac
486 ])
487
488 PBX_KDE=0
489 if test "${USE_KDE}" != "no"; then
490    echo -n "checking for crashHandler in -lkdecore..."
491    saved_ldflags="${LDFLAGS}"
492    LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
493         AC_LINK_IFELSE(
494         [
495                 AC_LANG_PROGRAM(
496                 [#include "kcrash.h"],
497                 [KCrash::defaultCrashHandler(1);])
498         ],
499         [ac_cv_lib_kde_crash="yes"],
500         [ac_cv_lib_kde_crash="no"])
501                 
502         LDFLAGS="${saved_ldflags}"
503         
504         if test "${ac_cv_lib_kde_crash}" = "yes"; then
505                 AC_MSG_RESULT(yes) 
506         else
507                 AC_MSG_RESULT(no) 
508         fi
509         
510         if test "${ac_cv_lib_kde_crash}" = "yes"; then
511                 KDE_LIBS="-lkdecore -lkdeui"
512                 if test "${KDE_DIR}" != ""; then
513                         KDE_LIBS="-L${KDE_DIR}/lib ${KDE_LIBS}"
514                         KDE_INCLUDE="-I${KDE_DIR}/include"
515                         AC_SUBST([KDE_INCLUDE])
516                 fi
517                 AC_SUBST([KDE_LIBS])
518                 PBX_KDE=1
519                 AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE library])
520    elif test ! -z "${KDE_MANDATORY}"; 
521    then
522       echo "***"
523       echo "*** The KDE installation on this system appears to be broken."
524       echo "*** Either correct the installation, or run configure"
525       echo "*** including --without-kde."
526       exit 1
527    fi
528 fi
529 AC_SUBST([PBX_KDE])
530
531 if test x"${PBX_KDE}" = x1; then
532         AC_PATH_TOOL(KDEINIT, kdeinit, No)
533         if test ! x"${KDEINIT}" = xNo; then
534         KDEDIR=$(${DIRNAME} ${KDEINIT})
535         KDEDIR=$(${DIRNAME} ${KDEDIR})
536         fi
537         AC_SUBST([KDEDIR])
538 fi
539
540 AC_LANG_POP
541
542 PBX_GTK=0
543 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
544 if test ! "x${GTKCONFIG}" = xNo; then
545    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
546    GTK_LIBS=$(${GTKCONFIG} --libs gthread)
547    PBX_GTK=1
548    AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
549 fi
550 AC_SUBST(PBX_GTK)
551 AC_SUBST(GTK_INCLUDE)
552 AC_SUBST(GTK_LIBS)
553
554 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
555
556 AC_ARG_WITH([pwlib], AC_HELP_STRING([--with-pwlib=PATH],[use PWLib files in PATH]),[
557 case ${withval} in
558      n|no)
559      USE_PWLIB=no
560      ;;
561      y|ye|yes)
562      ;;
563      *)
564      PWLIB_DIR="${withval}"
565      ;;
566 esac
567 ])
568 if test "${USE_PWLIB}" != "no"; then
569         echo -n "checking for existence of pwlib..."
570         
571         saved_ldflags="${LDFLAGS}"
572         LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
573         
574         AC_LINK_IFELSE(
575         [
576         AC_LANG_PROGRAM(
577         [#include "${PWDIR_DIR}ptime.h"],
578         [int q = PTime::IsDaylightSaving();])
579         ],
580         [       AC_MSG_RESULT(yes) 
581                 ac_cv_lib_pwlib="yes" 
582         ],
583         [       AC_MSG_RESULT(no) 
584                 ac_cv_lib_pwlib="no" 
585         ]
586         )
587         LDFLAGS="${saved_ldflags}"
588
589         PBX_LIBPWLIB=0
590    
591    if test "${ac_cv_lib_pwlib}" = "yes"; then
592       PWLIB_LIB="-l{PLATFORM_PWLIB}"
593       if test "${PWLIB_DIR}" != ""; then
594          PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
595                         PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
596                         AC_SUBST([PWLIB_INCLUDE])
597       fi
598         AC_SUBST([PWLIB_LIB])
599         PBX_LIBPWLIB=1
600         AC_DEFINE([HAVE_LIBPWLIB], 1, [Define if your system has the pwlib libraries.])
601    elif test ! -z "${PWLIB_DIR}"; 
602    then
603       echo "***"
604       echo "*** The PWLIB installation on this system appears to be broken."
605       echo "*** Either correct the installation, or run configure"
606       echo "*** including --without-pwlib"
607       exit 1
608    fi
609 fi
610 AC_SUBST([PBX_LIBPWLIB])
611
612 PBX_CURL=0
613 AC_PATH_TOOL([CURL], [curl-config], No)
614 if test ! x"${CURL}" = xNo; then
615 # check for version
616    CURLLIBS=$(${CURL} --libs)
617    PBX_CURL=1
618    AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
619 fi
620 AC_SUBST(PBX_CURL)
621 AC_SUBST(CURLLIBS)
622
623 AC_FUNC_ALLOCA
624 AC_HEADER_DIRENT
625 AC_HEADER_STDC
626 AC_HEADER_SYS_WAIT
627 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])
628
629 AC_SYS_LARGEFILE
630
631 # Checks for typedefs, structures, and compiler characteristics.
632 AC_HEADER_STDBOOL
633 AC_C_CONST
634 AC_TYPE_UID_T
635 AC_C_INLINE
636 AC_TYPE_MODE_T
637 AC_TYPE_OFF_T
638 AC_TYPE_PID_T
639 AC_TYPE_SIZE_T
640 AC_CHECK_MEMBERS([struct stat.st_blksize])
641 AC_HEADER_TIME
642 AC_STRUCT_TM
643 AC_C_VOLATILE
644 AC_CHECK_TYPES([ptrdiff_t])
645
646 # Checks for library functions.
647 AC_FUNC_CHOWN
648 AC_FUNC_CLOSEDIR_VOID
649 AC_FUNC_ERROR_AT_LINE
650 AC_FUNC_FORK
651 AC_FUNC_FSEEKO
652 AC_PROG_GCC_TRADITIONAL
653 AC_FUNC_MALLOC
654 AC_FUNC_MEMCMP
655 AC_FUNC_MKTIME
656 AC_FUNC_MMAP
657 AC_FUNC_REALLOC
658 AC_FUNC_SELECT_ARGTYPES
659 AC_FUNC_SETVBUF_REVERSED
660 AC_TYPE_SIGNAL
661 AC_FUNC_STAT
662 AC_FUNC_STRCOLL
663 AC_FUNC_STRFTIME
664 AC_FUNC_STRNLEN
665 AC_FUNC_STRTOD
666 AC_FUNC_UTIME_NULL
667 AC_FUNC_VPRINTF
668 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])
669
670 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
671 AC_OUTPUT
672
673 echo
674 echo "               .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=..      "
675 echo "            .\$7\$7..          .7\$\$7:.    "
676 echo "          .\$\$:.                 ,\$7.7   "
677 echo "        .\$7.     7\$\$\$\$           .\$\$77  "
678 echo "     ..\$\$.       \$\$\$\$\$            .\$\$\$7 "
679 echo "    ..7\$   .?.   \$\$\$\$\$   .?.       7\$\$\$."
680 echo "   \$.\$.   .\$\$\$7. \$\$\$\$7 .7\$\$\$.      .\$\$\$."
681 echo " .777.   .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7.      \$\$\$,"
682 echo " \$\$\$~      .7\$\$\$\$\$\$\$\$\$\$\$\$\$7.       .\$\$\$."
683 echo ".\$\$7          .7\$\$\$\$\$\$\$7:          ?\$\$\$."
684 echo "\$\$\$          ?7\$\$\$\$\$\$\$\$\$\$I        .\$\$\$7 "
685 echo "\$\$\$       .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$      :\$\$\$. "
686 echo "\$\$\$       \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$    .\$\$\$.  "
687 echo "\$\$\$        \$\$\$   7\$\$\$7  .\$\$\$    .\$\$\$.   "
688 echo "\$\$\$\$             \$\$\$\$7         .\$\$\$.    "
689 echo "7\$\$\$7            7\$\$\$\$        7\$\$\$      "
690 echo " \$\$\$\$\$                        \$\$\$       "
691 echo "  \$\$\$\$7.                       \$\$  (TM)     "
692 echo "   \$\$\$\$\$\$\$.           .7\$\$\$\$\$\$  \$\$      "
693 echo "     \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$      "
694 echo "       \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$.                "
695 echo
696
697 echo "Package configured for: "
698 echo " OS type  : $PBX_OSTYPE"
699 echo " host cpu : $host_cpu"
700 if test "x${crossCompile}" = xYes; then
701    echo ""
702    echo " Cross Compilation = YES"
703    echo " Target            = ${host}"
704 fi
705