[asterisk-commits] branch group/autoconf_and_menuselect r15063 - /team/group/autoconf_and_menuse...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Mar 26 11:30:43 MST 2006


Author: dancho
Date: Sun Mar 26 12:30:41 2006
New Revision: 15063

URL: http://svn.digium.com/view/asterisk?rev=15063&view=rev
Log:
Changed external library checks

Modified:
    team/group/autoconf_and_menuselect/autoconf/configure.ac

Modified: team/group/autoconf_and_menuselect/autoconf/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/autoconf/configure.ac?rev=15063&r1=15062&r2=15063&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/autoconf/configure.ac (original)
+++ team/group/autoconf_and_menuselect/autoconf/configure.ac Sun Mar 26 12:30:41 2006
@@ -20,7 +20,6 @@
 # specifiy output header file
 AC_CONFIG_HEADER(autoconfig.h)
 
-# AM_INIT_AUTOMAKE(asterisk, 1.2)
 AC_COPYRIGHT("Asterisk")
 AC_REVISION($Revision: 1.0 $)
 
@@ -99,10 +98,9 @@
 then
    AC_CHECK_TOOL(CC, gcc, :)
    AC_CHECK_TOOL(CXX, g++, :)
-   AC_CHECK_TOOL(AR, ar)
    AC_CHECK_TOOL(RANLIB, ranlib, :)
    AC_CHECK_TOOL(AR, ar, :)
-   
+
    if test x"${PBX_OSTYPE}" = xWin32;
    then
       AC_CHECK_TOOL(NM, nm, :)
@@ -110,32 +108,7 @@
       AC_CHECK_TOOL(DLLWRAP, dllwrap, :)
    fi
    crossCompile="Yes"
-
-   z_OPTIONS=-DLOW_MEMORY
-fi
-
-# setup cross compilation root..
-AC_ARG_WITH(cross_prefix,
-	[  --with-cross-prefix=PATH	directory where cross tools are installed],
-	[ if test "$withval" != no; then
-	     if test "$withval" != yes; then
-		crossPrefix=$withval
-	     fi
-	fi])
-if test x"${crossCompile}" = xYes; then
-   if test -z $crossPrefix; then 
-      AC_MSG_ERROR(You have to specify cross compile prefix!. Set with --with-cross-prefix.)
-   else
-	CROSS_COMPILE_ROOT=$crossPrefix
-	CROSS_COMPILE_BIN=$crossPrefix/bin/
-	CROSS_COMPILE_TARGET=$crossPrefix
-
-	AC_SUBST(CROSS_COMPILE_ROOT)
-	AC_SUBST(CROSS_COMPILE_BIN)
-	AC_SUBST(CROSS_COMPILE_TARGET)
-   fi
-fi
-
+fi
 
 # Checks for programs.
 AC_PROG_CC
@@ -160,208 +133,738 @@
 AC_PATH_PROG([LN], [ln], :)
 
 
-# turn on/off debug...
+# turn on/off developer mode...
 AC_ARG_ENABLE(debug,
-	[  --enable-debug    Turn on debugging],
+	[  --enable-developer-mode    Turn on developer mode],
 	[case "${enableval}" in
-	      yes) debug=true ;;
-	      no)  debug=false ;;
-	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug)  ;;
+	      yes) PBX_DEBUG=Yes ;;
+	      no)  PBX_DEBUG=No ;;
+	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-developer-mode)  ;;
 	esac])
-AM_CONDITIONAL(PBX_DEBUG, test x$debug = xtrue)
-
-
-# turn on/off profile...
-AC_ARG_ENABLE(profile,
-	[  --enable-profile    Turn on profiling],
-	[case "${enableval}" in
-	      yes) profile=true ;;
-	      no)  profile=false ;;
-	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-profile)  ;;
-	esac])
-AM_CONDITIONAL(PBX_PROFILE, test x$profile = xtrue)
-
 
 
 AC_LANG(C)
 
 #######################
 #
-#    check for the existance of the modules..
+#    check for the existance of external libraries..
 #
 #######################
 
-xInclude=$CROSS_COMPILE_ROOT/usr/include
-xLInclude=$CROSS_COMPILE_ROOT/usr/local/include
-
-xLib=$CROSS_COMPILE_ROOT/lib
-xULib=$CROSS_COMPILE_ROOT/usr/lib
-xLLib=$CROSS_COMPILE_ROOT/usr/local/lib
-
+#######################
+#  non mandatory library..
+#######################
+
+echo "->> cheking external libraries..."
+
+#######################
+#  Audio/Voice codecs...
 #######################
 # OGG/Vorbis 
-
-PBX_OGGVORBIS=1
-# check header & lib
-AC_CHECK_HEADERS([${xInclude}/vorbis/codec.h], [], [PBX_OGGVORBIS=0])
-AC_SUBST(PBX_OGGVORBIS)
-
-#######################
-# zaptel module
-
-PBX_ZAPTEL=1
-# check header & lib
-AC_CHECK_HEADER([${xInclude}/zaptel.h], [],
-  [AC_CHECK_HEADER([${xInclude}/linux/zaptel.h], [],
-    [AC_CHECK_HEADER([${xLInclude}/zaptel.h], [], [PBX_ZAPTEL=0])])])
-AC_CHECK_LIB([tonezone], [tone_zone_register], [], [PBX_ZAPTEL=0])
-AC_SUBST(PBX_ZAPTEL)
+# check for ogg lib
+AC_ARG_WITH([ogg], AC_HELP_STRING([--with-ogg=PATH],[use OGG files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_OGG=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     OGG_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBOGG=0
+if test "${USE_OGG}" != "no"; then	
+   AC_CHECK_LIB([ogg], [ogg_sync_init], AC_DEFINE([HAVE_LIBOGG], [], [Define to indicate the Ogg libraries]), [], -L${OGG_DIR}/lib)
+   if test "${ac_cv_lib_ogg_ogg_sync_init}" = "yes"; then
+      OGG_LIB="-logg"
+      if test "${OGG_DIR}" != ""; then
+         OGG_LIB="-L${OGG_DIR}/lib ${OGG_LIB}"
+	 		OGG_INCLUDE="-I${OGG_DIR}/include"
+	 		AC_SUBST([OGG_INCLUDE])
+      fi
+      AC_SUBST([OGG_LIB])
+      HAVE_LIBOGG=1
+   elif test ! -z "${OGG_DIR}"; 
+   then
+      echo "***"
+      echo "*** The OGG installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-ogg"
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBOGG])
+
+#######################
+# check for vorbis libs
+AC_ARG_WITH([vorbis], AC_HELP_STRING([--with-vorbis=PATH],[use vorbis files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_VORBIS=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     VORBIS_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBVORBIS=0
+if test "${USE_VORBIS}" != "no"; then
+   AC_CHECK_LIB([vorbis], [vorbis_info_init], AC_DEFINE([HAVE_LIBVORBIS], [], [Define to indicate the vorbis libraries should be used.]), [], -L${VORBIS_DIR}/lib -logg)
+   if test "${ac_cv_lib_vorbis_vorbis_info_init}" = "yes"; then
+      VORBIS_LIB="-lvorbis -lvorbisenc"
+      if test "${VORBIS_DIR}" != ""; then
+         VORBIS_LIB="-L${VORBIS_DIR}/lib ${VORBIS_LIB}"
+	 VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
+	 AC_SUBST([VORBIS_INCLUDE])
+      fi
+      AC_SUBST([VORBIS_LIB])
+      HAVE_LIBVORBIS=1
+   elif test ! -z "${VORBIS_DIR}"; 
+   then
+      echo "***"
+      echo "*** The vorbis installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-vorbis."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBVORBIS])
+
+#######################
+# turn on asound..
+AC_ARG_WITH([alsa-sound], AC_HELP_STRING([--with-alsa-sound=PATH],[use ALSA sound files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_ASOUND=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     ASOUND_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBASOUND=0
+if test "${USE_ASOUND}" != "no"; then
+   AC_CHECK_LIB([asound], [snd_spcm_init], AC_DEFINE([HAVE_LIBASOUND], [], [Define to indicate the ALSA sound libraries should be used]), [], -L${ASOUND_DIR}/lib)
+   if test "${ac_cv_lib_asound_snd_spcm_init}" = "yes"; then
+      ASOUND_LIB="-lasound"
+      if test "${ASOUND_DIR}" != ""; then
+         ASOUND_LIB="-L${ASOUND_DIR}/lib ${ASOUND_LIB}"
+	 		ASOUND_INCLUDE="-I${ASOUND_DIR}/include"
+	 		AC_SUBST([ASOUND_INCLUDE])
+      fi
+      AC_SUBST([ASOUND_LIB])
+      HAVE_LIBASOUND=1
+   elif test ! -z "${ASOUND_DIR}"; 
+   then
+      echo "***"
+      echo "*** The ALSA sound installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-alsa-sound."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBASOUND])
+
+
+####################### 
+# turn on nbs.. xxx
+AC_ARG_WITH([nbs], AC_HELP_STRING([--with-nbs=PATH],[use nbs files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_NBS=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     NBS_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBNBS=0
+if test "${USE_NBS}" != "no"; then
+   AC_CHECK_LIB([nbs], [nbs_setup], AC_DEFINE([HAVE_LIBNBS], [], [Define to indicate the NBS (Network Broadcast Sound) libraries should be used for sound operations.]), [], -L${NBS_DIR}/lib)
+   if test "${ac_cv_lib_nbs_nbs_setup}" = "yes"; then
+      NBS_LIB="-lnbs"
+      if test "${NBS_DIR}" != ""; then
+         NBS_LIB="-L${NBS_DIR}/lib ${NBS_LIB}"
+	 		NBS_INCLUDE="-I${NBS_DIR}/include"
+	 		AC_SUBST([NBS_INCLUDE])
+      fi
+   	AC_SUBST([NBS_LIB])
+   	HAVE_LIBNBS=1
+   elif test ! -z "${NBS_DIR}"; 
+   then
+      echo "***"
+      echo "*** The Network Broadcast Soundinstallation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-nbs."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBNBS])
+
+
+
+####################### 
+# turn on oss.. xxx
+AC_ARG_WITH([ossaudio], AC_HELP_STRING([--with-ossaudio=PATH],[use ossaudio files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_OSSAUDIO=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     OSSAUDIO_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBOSSAUDIO=0
+if test "${USE_OSSAUDIO}" != "no"; then
+   AC_CHECK_LIB([ossaudio], [oss_ioctl_mixer], AC_DEFINE([HAVE_LIBOSSAUDIO], [], [Define to indicate the OSS audio libraries should be used for sound operations.]), [], -L${NBS_DIR}/lib)
+   if test "${ac_cv_lib_ossaudio_oss_ioctl_mixer}" = "yes"; then
+      OSSAUDIO_LIB="-lossaudio"
+      if test "${OSSAUDIO_DIR}" != ""; then
+         OSSAUDIO_LIB="-L${OSSAUDIO_DIR}/lib ${OSSAUDIO_LIB}"
+	 		OSSAUDIO_INCLUDE="-I${OSSAUDIO_DIR}/include"
+	 		AC_SUBST([OSSAUDIO_INCLUDE])
+      fi
+   	AC_SUBST([OSSAUDIO_LIB])
+   	HAVE_LIBOSSAUDIO=1
+   elif test ! -z "${OSSAUDIO_DIR}"; 
+   then
+      echo "***"
+      echo "*** The OSS Audio installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-ossaudio."
+   fi
+fi
+AC_SUBST([HAVE_LIBOSSAUDIO])
+
+####################### 
+# turn on libspeex.. xxx
+AC_ARG_WITH([speex], AC_HELP_STRING([--with-speex=PATH],[use SPEEX files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_SPEEX=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     SPEEX_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBSPEEX=0
+if test "${USE_SPEEX}" != "no"; then
+   AC_CHECK_LIB([speex], [speex_encode], AC_DEFINE([HAVE_LIBSPEEX], [], [Define to indicate the SPEEX libraries should be used for audio operations.]), [], -L${SPEEX_DIR}/lib)
+   if test "${ac_cv_lib_speex_speex_encode}" = "yes"; then
+      SPEEX_LIB="-lspeex"
+      if test "${SPEEX_DIR}" != ""; then
+         SPEEX_LIB="-L${SPEEX_DIR}/lib ${SPEEX_LIB}"
+	 		SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
+	 		AC_SUBST([SPEEX_INCLUDE])
+      fi
+   	AC_SUBST([SPEEX_LIB])
+   	HAVE_LIBSPEEX=1
+   elif test ! -z "${SPEEX_DIR}"; 
+   then
+      echo "***"
+      echo "*** The SPEEX installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-speex."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBSPEEX])
+
+
+
+#######################
+#  Drivers/Protocols..
+#######################
+# Zaptel drivers..
+AC_ARG_WITH([zaptel], AC_HELP_STRING([--with-zaptel=PATH],[use Zaptel files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_ZAPTEL=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     ZAPTEL_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBZAPTEL=0
+if test "${USE_ZAPTEL}" != "no"; then
+   AC_CHECK_LIB([tonezone], [tone_zone_find], AC_DEFINE([HAVE_LIBZAPTEL], [], [Define to indicate the Zaptel libraries]), [], -L${ZAPTEL_DIR/lib})
+   if test "${ac_cv_lib_tonezone_tone_zone_find}" = "yes"; then
+      ZAPTEL_LIB="-ltonezone"
+      if test "${ZAPTEL_DIR}" != ""; then
+         ZAPTEL_LIB="-L${ZAPTEL_DIR}/lib ${ZAPTEL_LIB}"
+	 ZAPTEL_INCLUDE="-I${ZAPTEL_DIR}/include"
+	 AC_SUBST([ZAPTEL_INCLUDE])
+      fi
+      AC_SUBST([ZAPTEL_LIB])
+      HAVE_LIBZAPTEL=1
+   elif test ! -z "${ZAPTEL_DIR}";
+   then
+      echo "***"
+      echo "*** The Zaptel installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-zaptel."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBZAPTEL])
+
+
+#######################
+# turn on QuickNet driver(ixjuser)..
+HAVE_QUICKNET=1
+AC_CHECK_HEADER([ixjuser.h], [HAVE_QUICKNET=1],[])
+AC_SUBST(HAVE_QUICKNET)
+
+
+AC_LANG(C++)
+####################### 
+# turn on vpb..
+AC_ARG_WITH([vpb], AC_HELP_STRING([--with-vpb=PATH],[use vpb files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_VPB=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     VPB_DIR="${withval}"
+     ;;
+esac
+])
+if test "${USE_VPB}" != "no"; then
+	
+	echo "checking for vpb_open in -lvpb..."
+	
+	saved_ldflags="${LDFLAGS}"
+	LDFLAGS="${LDFLAGS} -L${VPB_DIR} -lvpb"
+	
+	AC_LINK_IFELSE(
+	[
+	AC_LANG_PROGRAM(
+	[#include "${VPB_DIR}/vpbapi.h"],
+	[ 
+	int q = vpb_open(0,0);])
+	],
+	[	AC_MSG_RESULT(yes) 
+		ac_cv_lib_vpb_vpb_open="yes" 
+	],
+	[	AC_MSG_RESULT(no) 
+		ac_cv_lib_vpb_vpb_open="no" 
+	]
+	)
+	LDFLAGS="${saved_ldflags}"
+
+	HAVE_LIBVPB=0
+   if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
+      VPB_LIB="-lvpb"
+      if test "${VPB_DIR}" != ""; then
+         VPB_LIB="-L${VPB_DIR}/lib ${VPB_LIB}"
+	 		VPB_INCLUDE="-I${VPB_DIR}/include"
+	 		AC_SUBST([VPB_INCLUDE])
+      fi
+      AC_SUBST([VPB_LIB])
+      HAVE_LIBVPB=1
+   elif test ! -z "${VPB_DIR}"; 
+   then
+      echo "***"
+      echo "*** The Voice-Tronix installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-vpb."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBVPB])
+
+AC_LANG(C)
+
+
+####################### 
+# turn on libpri..(ISDN)
+AC_ARG_WITH([pri], AC_HELP_STRING([--with-pri=PATH],[use PRI files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_PRI=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     PRI_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBPRI=0
+if test "${USE_PRI}" != "no"; then
+   AC_CHECK_LIB([pri], [pri_call], AC_DEFINE([HAVE_LIBPRI], [], [Define to indicate the PRI libraries should be used]), [], -L${PRI_DIR}/lib)
+   if test "${ac_cv_lib_pri_pri_call}" = "yes"; then
+      PRI_LIB="-lpri"
+      if test "${PRI_DIR}" != ""; then
+         PRI_LIB="-L${PRI_DIR}/lib ${PRI_LIB}"
+	 		PRI_INCLUDE="-I${PRI_DIR}/include"
+	 		AC_SUBST([PRI_INCLUDE])
+      fi
+   	AC_SUBST([PRI_LIB])
+   	HAVE_LIBPRI=1
+   elif test ! -z "${PRI_DIR}"; 
+   then
+      echo "***"
+      echo "*** The PRI installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-pri."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBPRI])
+
+####################### 
+# turn on libmfcr2.. (zapata)
+AC_ARG_WITH([mfcr2], AC_HELP_STRING([--with-mfcr2=PATH],[use MFCR2 files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_MFCR2=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     MFCR2_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBMFCR2=0
+if test "${USE_MFCR2}" != "no"; then
+   AC_CHECK_LIB([mfcr2], [mfcr2_MakeCall], AC_DEFINE([HAVE_LIBMFCR2], [], [Define to indicate the MFCR2 libraries should be used]), [], -L${MFCR2_DIR}/lib)
+   if test "${ac_cv_lib_mfcr2_mfcr2_MakeCall}" = "yes"; then
+      MFCR2_LIB="-lmfcr2"
+      if test "${MFCR2_DIR}" != ""; then
+         MFCR2_LIB="-L${MFCR2_DIR}/lib ${MFCR2_LIB}"
+	 		MFCR2_INCLUDE="-I${MFCR2_DIR}/include"
+	 		AC_SUBST([MFCR2_INCLUDE])
+      fi
+   	AC_SUBST([MFCR2_LIB])
+   	HAVE_LIBMFCR2=1
+   elif test ! -z "${MFCR2_DIR}"; 
+   then
+      echo "***"
+      echo "*** The MFCR2 installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-mfcr2"
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBMFCR2])
+
+####################### 
+# turn on libosptk.. xxx
+AC_ARG_WITH([osptk], AC_HELP_STRING([--with-osptk=PATH],[use OSPTK files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_OSPTK=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     OSPTK_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBOSPTK=0
+if test "${USE_OSPTK}" != "no"; then
+   AC_CHECK_LIB([osptk], [OSPPCryptoDecrypt], AC_DEFINE([HAVE_LIBOSPTK], [], [Define to indicate the OSPTK libraries should be used for audio operations.]), [], -L${OSPTK_DIR}/lib)
+   if test "${ac_cv_lib_osptk_OSPPCryptoDecrypt}" = "yes"; then
+      OSPTK_LIB="-losptk"
+      if test "${OSPTK_DIR}" != ""; then
+         OSPTK_LIB="-L${OSPTK_DIR}/lib ${OSPTK_LIB}"
+	 		OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
+	 		AC_SUBST([OSPTK_INCLUDE])
+      fi
+   	AC_SUBST([OSPTK_LIB])
+   	HAVE_LIBOSPTK=1
+   elif test ! -z "${OSPTK_DIR}"; 
+   then
+      echo "***"
+      echo "*** The OSPTK installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-osptk."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBOSPTK])
+
+
+####################### 
+# turn on h323.. xxx
+HAVE_H323=1
+AC_CHECK_HEADER([h323.h], [], [HAVE_H323=0])
+AC_SUBST(HAVE_H323)
+
+AC_LANG(C)
+
+
+#######################
+#  Database...
+#######################
+# ODBC checks
+AC_ARG_WITH([odbc], AC_HELP_STRING([--with-odbc=PATH],[use unixODBC files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_ODBC=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     ODBC_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_UNIXODBC=0
+if test "${USE_ODBC}" != "no"; then
+   AC_CHECK_LIB([odbc], [SQLConnect], AC_DEFINE([HAVE_UNIXODBC], [], [Define to indicate the unixODBC libraries should be used for database operations.]), [], -L${ODBC_DIR}/lib)
+   if test "${ac_cv_lib_odbc_SQLConnect}" = "yes"; then
+      ODBC_LIB="-lodbc"
+      if test "${ODBC_DIR}" != ""; then
+         ODBC_LIB="-L${ODBC_DIR}/lib ${ODBC_LIB}"
+	 		ODBC_INCLUDE="-I${ODBC_DIR}/include"
+	 		AC_SUBST([ODBC_INCLUDE])
+      fi
+   	AC_SUBST([ODBC_LIB])
+   	HAVE_UNIXODBC=1
+   elif test ! -z "${ODBC_DIR}"; 
+   then
+      echo "***"
+      echo "*** The unixODBC installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-unixodbc."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_UNIXODBC])
+
+#######################
+# pgsql checks
+AC_ARG_WITH([pgsql], AC_HELP_STRING([--with-pgsql=PATH],[use PostgreSQL files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_PGSQL=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     PGSQL_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_PGSQL=0
+if test "${USE_PGSQL}" != "no"; then
+   AC_CHECK_LIB([pq], [PQexec], AC_DEFINE([HAVE_PGSQL], [], [Define to indicate the PostgreSQL libraries should be used for database operations.]), [], -L${PGSQL_DIR}/lib)
+   if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
+      PGSQL_LIB="-lpq"
+      if test "${PGSQL_DIR}" != ""; then
+         PGSQL_LIB="-L${PGSQL_DIR}/lib ${PGSQL_LIB}"
+	 		PGSQL_INCLUDE="-I${PGSQL_DIR}/include"
+	 		AC_SUBST([PGSQL_INCLUDE])
+      fi
+   	AC_SUBST([PGSQL_LIB])
+   	HAVE_PGSQL=1
+   elif test ! -z "${PGSQL_DIR}"; 
+   then
+      echo "***"
+      echo "*** The PostgreSQL installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-pgsql."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_PGSQL])
 
 #######################
 # turn on sqlite..
-PBX_SQLITE=1
-AC_CHECK_HEADER([${xInclude}/sqlite.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/sqlite.h], [], [PBX_SQLITE=0])])
-AC_CHECK_LIB([sqlite], [sqlite_exec], [], 
-  [AC_CHECK_LIB([sqlite], [sqlite3_exec], [], [PBX_SQLITE=0])])
-AC_SUBST(PBX_SQLITE)
-
+AC_ARG_WITH([sqlite], AC_HELP_STRING([--with-sqlite=PATH],[use sqlite files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_SQLITE=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     SQLITE_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBSQLITE=0
+if test "${USE_SQLITE}" != "no"; then
+   AC_CHECK_LIB([sqlite], [sqlite_exec], AC_DEFINE([HAVE_LIBSQLITE], [], [Define to indicate the sqlite libraries should be used for database operations.]), [], -L${SQLITE_DIR}/lib)
+   if test "${ac_cv_lib_sqlite_sqlite_exec}" = "yes"; then
+      SQLITE_LIB="-lsqlite"
+      if test "${SQLITE_DIR}" != ""; then
+         SQLITE_LIB="-L${SQLITE_DIR}/lib ${SQLITE_LIB}"
+	 		SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
+	 		AC_SUBST([SQLITE_INCLUDE])
+      fi
+      AC_SUBST([SQLITE_LIB])
+      HAVE_LIBSQLITE=1
+   elif test ! -z "${SQLITE_DIR}"; 
+   then
+      echo "***"
+      echo "*** The SQLite installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-sqlite."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBSQLITE])
 
 #######################
 # turn on tds..
-PBX_FREETDS=1
-AC_CHECK_HEADER([${xInclude}/tds.h], [],
-   [AC_CHECK_HEADER([${xLInclude}/tds.h], [], [PBX_FREETDS=0])])
-AC_CHECK_LIB([tds], [tds_connect], [], [PBX_FREETDS=0])
-AC_SUBST(PBX_FREETDS)
-
-#######################
-# turn on ixjuser..
-PBX_IXJUSER=1
-AC_CHECK_HEADER([${xInclude}/ixjuser.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/ixjuser.h], [], [PBX_IXJUSER=0])])
-AC_SUBST(PBX_IXJUSER)
-
-#######################
-# turn on asound..
-PBX_ASOUND=1
-AC_CHECK_HEADER([${xInclude}/alsa/asoundlib.h], [], 
-  [AC_CHECK_HEADER([${xInclude}/sys/asoundlib.h], [], [PBX_ASOUND=0])])
-AC_CHECK_LIB([asound], [alsa_lisp], [], [PBX_ASOUND=0])
-AC_SUBST(PBX_ASOUND)
-
-####################### 
-# turn on vpb.. xxx
-PBX_VPBAPI=1
-AC_CHECK_HEADER([${xInclude}/vpbapi.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/vpbapi.h], [], [PBX_VPBAPI=0])])
-AC_CHECK_LIB([vpb], [vpb_open], [], [PBX_VPBAPI=0])
-AC_SUBST(PBX_VPBAPI)
-
-####################### 
-# turn on nbs.. xxx
-PBX_NBS=1
-AC_CHECK_HEADER([${xInclude}/nbs.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/nbs.h], [], [PBX_NBS=0])])
-AC_CHECK_LIB([nbs], [nbs_setup], [], [PBX_NBS=0])
-AC_SUBST(PBX_NBS)
-
-####################### 
-# turn on oss.. xxx
-PBX_OSSAUDIO=1
-AC_CHECK_LIB([ossaudio], [oss_ioctl_mixer], [], [PBX_OSSAUDIO=0])
-AC_SUBST(PBX_OSSAUDIO)
-
-
-####################### 
-# turn on libpri.. xxx
-PBX_LIBPRI=1
-AC_CHECK_HEADER([${xInclude}/libpri.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/libpri.h], [], [PBX_LIBPRI=0])])
-AC_CHECK_LIB([pri], [pri_call], [], [PBX_LIBPRI=0])
-AC_SUBST(PBX_LIBPRI)
-
-
-
-####################### 
-# turn on libmfcr2.. xxx
-PBX_LIBMFCR2=1
-AC_CHECK_HEADER([${xInclude}/libmfcr2.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/libmfcr2.h], [], [PBX_LIBMFCR2=0])])
-AC_CHECK_LIB([mfcr2], [mfcr2_MakeCall], [], [PBX_LIBMFCR2=0])
-AC_SUBST(PBX_LIBMFCR2)
-
-
-####################### 
-# turn on libspeex.. xxx
-PBX_LIBSPEEX=1
-AC_CHECK_HEADER([${xInclude}/speex.h], [], 
-  [AC_CHECK_HEADER([${xLInclude}/speex.h], [], [PBX_LIBSPEEX=0])])
-AC_CHECK_LIB([speex], [speex_encode], [], [PBX_LIBSPEEX=0])
-AC_SUBST(PBX_LIBSPEEX)
-
-
-####################### 
-# turn on libvorbix.. xxx
-PBX_LIBVORBIS=1
-AC_CHECK_HEADER([${xInclude}/vorbis/codec.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/vorbis/codec.h], [], [PBX_LIBVORBIS=0])])
-AC_CHECK_LIB([vorbis], [vorbis_info_init], [], [PBX_LIBVORBIS=0])
-AC_CHECK_LIB([vorbisenc], [vorbis_encode_ctl], [], [PBX_LIBVORBIS=0])
-AC_SUBST(PBX_LIBVORBIS)
-
-
-####################### 
-# turn on libosptk.. xxx
-PBX_LIBOSPTK=1
-AC_CHECK_HEADER([${xInclude}/osp/osp.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/osp/osp.h], [], [PBX_LIBOSPTK=0])])
-AC_CHECK_LIB([osptk], [OSPPCryptoDecrypt], [], [PBX_LIBOSPTK=0])
-AC_SUBST(PBX_LIBOSPTK)
-
-####################### 
-# turn on libpopt.. xxx
-PBX_LIBPOPT=1
-AC_CHECK_HEADER([${xInclude}/popt.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/popt.h], [], [PBX_LIBPOPT=0])])
-AC_CHECK_LIB([popt], [poptStrerror], [], [PBX_LIBPOPT=0])
-AC_SUBST(PBX_LIBPOPT)
+# 1TODO: check lib version..
+AC_ARG_WITH([feetds], AC_HELP_STRING([--with-freetds=PATH],[use freetds files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_FREETDS=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     FREETDS_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBTDS=0
+if test "${USE_FREETDS}" != "no"; then
+   AC_CHECK_LIB([tds], [tds_version], AC_DEFINE([HAVE_LIBTDS], [], [Define to indicate the FreeTDS libraries should be used]), [], -L${TDS_DIR}/lib)
+   if test "${ac_cv_lib_tds_tds_version}" = "yes"; then
+      TDS_LIB="-ltds"
+      if test "${TDS_DIR}" != ""; then
+         TDS_LIB="-L${TDS_DIR}/lib ${TDS_LIB}"
+	 		TDS_INCLUDE="-I${TDS_DIR}/include"
+	 		AC_SUBST([TDS_INCLUDE])
+      fi
+      AC_SUBST([TDS_LIB])
+      HAVE_LIBTDS=1
+   elif test ! -z "${TDS_DIR}"; 
+   then
+      echo "***"
+      echo "*** The FreeTDS installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-freetds."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBTDS])
+
+
+####################### 
+#  GUI toolkits..
+####################### 
+# turn on libpopt.. 
+AC_ARG_WITH([popt], AC_HELP_STRING([--with-popt=PATH],[use popt files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_POPT=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     POPT_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBPOPT=0
+if test "${USE_POPT}" != "no"; then
+   AC_CHECK_LIB([popt], [poptStrerror], AC_DEFINE([HAVE_LIBPOPT], [], [Define to indicate the popt libraries should be used for GUI operations.]), [], -L${POPT_DIR}/lib)
+   if test "${ac_cv_lib_popt_poptStrerror}" = "yes"; then
+      POPT_LIB="-lpopt"
+      if test "${POPT_DIR}" != ""; then
+         POPT_LIB="-L${POPT_DIR}/lib ${POPT_LIB}"
+	 		POPT_INCLUDE="-I${POPT_DIR}/include"
+	 		AC_SUBST([POPT_INCLUDE])
+      fi
+   	AC_SUBST([POPT_LIB])
+   	HAVE_LIBPOPT=1
+   elif test ! -z "${POPT_DIR}"; 
+   then
+      echo "***"
+      echo "*** The POPT installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-popt."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBPOPT])
 
 
 ####################### 
 # turn on libnewt.. xxx
-PBX_LIBNEWT=1
-AC_CHECK_HEADER([${xInclude}/newt.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/newt.h], [], [PBX_LIBNEWT=0])])
-AC_CHECK_LIB([newt], [newtBell], [], [PBX_LIBNEWT=0])
-AC_SUBST(PBX_LIBNEWT)
-
-
-####################### 
-# turn on poll.. xxx
-PBX_POLL=1
-AC_CHECK_HEADERS([${xInclude}/sys/poll.h], [], [PBX_POLL=0])
-AC_SUBST(PBX_POLL)
+
+AC_ARG_WITH([newt], AC_HELP_STRING([--with-newt=PATH],[use newt files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_NEWT=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     NEWT_DIR="${withval}"
+     ;;
+esac
+])
+HAVE_LIBNEWT=0
+if test "${USE_NEWT}" != "no"; then
+   AC_CHECK_LIB([newt], [newtBell], AC_DEFINE([HAVE_LIBNEWT], [], [Define to indicate the newt libraries should be used for GUI operations.]), [], -L${NEWT_DIR}/lib)
+   if test "${ac_cv_lib_newt_newtBell}" = "yes"; then
+      NEWT_LIB="-lnewt"
+      if test "${NEWT_DIR}" != ""; then
+         NEWT_LIB="-L${NEWT_DIR}/lib ${NEWT_LIB}"
+	 		NEWT_INCLUDE="-I${NEWT_DIR}/include"
+	 		AC_SUBST([NEWT_INCLUDE])
+      fi
+   	AC_SUBST([NEWT_LIB])
+   	HAVE_LIBNEWT=1
+   elif test ! -z "${NEWT_DIR}"; 
+   then
+      echo "***"
+      echo "*** The NEWT installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-newt."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBNEWT])
 
 
 AC_LANG(C++)
 
 ####################### 
 # turn on Qt.. xxx
-PBX_QT=0
+HAVE_QT=0
 AC_PATH_TOOL(QTMOC, moc, No)
 if test ! x"${QTMOC}" = xNo; then
    QTDIR=$(${DIRNAME} ${QTMOC})
    QTDIR=$(${DIRNAME} ${QTDIR})
    
-   AC_CHECK_HEADER([${QTDIR}/include/qapplication.h], [PBX_QT=1])
-fi
-AC_SUBST(PBX_QT)
+   AC_CHECK_HEADER([${QTDIR}/include/qapplication.h], [HAVE_QT=1])
+fi
+AC_SUBST(HAVE_QT)
 AC_SUBST(QTDIR)
 
 ####################### 
 # turn on KDE.. xxx
-PBX_KDE=0
+HAVE_KDE=0
 AC_PATH_TOOL(KDEINIT, kdeinit, No)
 if test ! x"${KDEINIT}" = xNo; then
    KDEDIR=$(${DIRNAME} ${KDEINIT})
@@ -370,73 +873,108 @@
    KDE_LIBS="-L${KDEDIR}/lib -L${QTDIR}/lib -lqt -lkdecore -lkdeui"
 
    AC_CHECK_HEADER([${KDEDIR}/include/kdebug.h], [PBX_KDE=1])
-   AC_CHECK_HEADER([${KDEDIR}/include/kdebug.h], [PBX_KDE=1])
-fi
-AC_SUBST(PBX_KDE)
+fi
+AC_SUBST(HAVE_KDE)
 AC_SUBST(KDEDIR)
 AC_SUBST(KDE_CFLAGS)
 AC_SUBST(KDE_LIBS)
 
 
 ####################### 
-# turn on ptlib.. xxx
-PBX_PTLIB=1
-AC_CHECK_HEADER([${xInclude}/ptlib.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/ptlib.h], [], [PBX_PTLIB=0])])
-AC_SUBST(PBX_PTLIB)
-
-####################### 
-# turn on h323.. xxx
-PBX_H323=1
-AC_CHECK_HEADER([${xInclude}/h323.h], [],
-  [AC_CHECK_HEADER([${xLInclude}/h323.h], [], [PBX_H323=0])])
-AC_SUBST(PBX_H323)
-
-AC_LANG(C)
+# setup GTK
+HAVE_GTK=0
+AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
+if test ! "x${GTKCONFIG}" = xNo; then
+   GTK_CFLAGS=$(${GTKCONFIG} --cflags gthread)
+   GTK_LIBS=$(${GTKCONFIG} --libs gthread)
+   PBX_GTK=1
+fi
+AC_SUBST(HAVE_GTK)
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+
+
+
+
+####################### 
+#  Miscelanious libs..
+####################### 
+# turn on pwlib..
+PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
+#PLATFORM_PTLIB="ptlib_linux_x86_r"
+
+AC_ARG_WITH([pwlib], AC_HELP_STRING([--with-pwlib=PATH],[use PWLib files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_PWLIB=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     PWLIB_DIR="${withval}"
+     ;;
+esac
+])
+if test "${USE_PWLIB}" != "no"; then
+	echo "checking for existence of pwlib..."
+	
+	saved_ldflags="${LDFLAGS}"
+	LDFLAGS="${LDFLAGS} -L${PWLIB_DIR} -l${PLATFORM_PTLIB}"
+	
+	AC_LINK_IFELSE(
+	[
+	AC_LANG_PROGRAM(
+	[#include "${PWDIR_DIR}/ptime.h"],
+	[ 
+	int q = PTime::IsDaylightSaving();])
+	],
+	[	AC_MSG_RESULT(yes) 
+		ac_cv_lib_pwlib="yes" 
+	],
+	[	AC_MSG_RESULT(no) 
+		ac_cv_lib_pwlib="no" 
+	]
+	)
+	LDFLAGS="${saved_ldflags}"
+
+	HAVE_LIBPWLIB=0
+   
+   if test "${ac_cv_lib_pwlib}" = "yes"; then
+      PWLIB_LIB="-l{PLATFORM_PWLIB}"
+      if test "${PWLIB_DIR}" != ""; then
+         PWLIB_LIB="-L${PWLIB_DIR}/lib ${PWLIB_LIB}"
+	 		PWLIB_INCLUDE="-I${PWLIB_DIR}/include"
+	 		AC_SUBST([PWLIB_INCLUDE])
+      fi
+   	AC_SUBST([PWLIB_LIB])
+   	HAVE_LIBPWLIB=1
+   elif test ! -z "${PWLIB_DIR}"; 
+   then
+      echo "***"
+      echo "*** The PWLIB installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-pwlib"
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBPWLIB])
+
+
 
 ####################### 
 # turn on CURL library.. xxx
-PBX_CURL=0
+HAVE_CURL=0
 AC_PATH_TOOL([CURL], [curl-config], No)
 if test ! x"${CURL}" = xNo; then
 # check for version
    CURLLIBS=$(${CURL} --libs)
    PBX_CURL=1
 fi
-AC_SUBST(PBX_CURL)
+AC_SUBST(HAVE_CURL)
 AC_SUBST(CURLLIBS)
 
 
-####################### 
-# setup GTK
-PBX_GTK=0
-AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
-if test ! "x${GTKCONFIG}" = xNo; then
-   GTK_CFLAGS=$(${GTKCONFIG} --cflags gthread)
-   GTK_LIBS=$(${GTKCONFIG} --libs gthread)
-   PBX_GTK=1
-fi
-AC_SUBST(PBX_GTK)
-AC_SUBST(GTK_CFLAGS)
-AC_SUBST(GTK_LIBS)
-
-
-
-
-# Checks for prerequisite libraries..
-AC_CHECK_LIB([c], [memcpy], [], [AC_MSG_ERROR("you need c library to compile asterisk")])
-AC_CHECK_LIB([crypto], [CRYPTO_malloc], [], [AC_MSG_ERROR("you need crypto library to compile asterisk")])
-AC_CHECK_LIB([dl], [dlopen], [], [AC_MSG_ERROR("you need dl library to compile asterisk")])
-#AC_CHECK_LIB([expat], [XML_SetBase], [], [AC_MSG_ERROR("you need expat library to compile asterisk")])
-AC_CHECK_LIB([m], [powl], [], [AC_MSG_ERROR("you need m library to compile asterisk")])
-AC_CHECK_LIB([ncurses], [wclear], [], [AC_MSG_ERROR("you need ncurses library to compile asterisk")])
-#AC_CHECK_LIB([nsl], [nis_perror], [], [AC_MSG_ERROR("you need nsl library to compile asterisk")])
-AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR("you need pthread library to compile asterisk")])
-AC_CHECK_LIB([resolv], [inet_neta], [], [AC_MSG_ERROR("you need resolv library to compile asterisk")])
-#AC_CHECK_LIB([rt], [mq_send], [], [AC_MSG_ERROR("you need rt library to compile asterisk")])
-AC_CHECK_LIB([socket], [socket])
-AC_CHECK_LIB([z], [compress])
-
+# SSL checks
 AC_ARG_WITH([ssl], AC_HELP_STRING([--with-ssl=PATH],[use OpenSSL files in PATH]),[
 case ${withval} in
      n|no)
@@ -449,101 +987,93 @@
      ;;
 esac
 ])
-
+HAVE_LIBSSL=0
 if test "${USE_SSL}" != "no"; then
    AC_CHECK_LIB([ssl], [ssl2_connect], AC_DEFINE([HAVE_LIBSSL], [], [Define to indicate the OpenSSL libraries should be used for cryptographic operations.]), [], -L${SSL_DIR}/lib -lcrypto)
    if test "${ac_cv_lib_ssl_ssl2_connect}" = "yes"; then
       SSL_LIB="-lssl -lcrypto"
       if test "${SSL_DIR}" != ""; then
          SSL_LIB="-L${SSL_DIR}/lib ${SSL_LIB}"
-	 SSL_INCLUDE="-I${SSL_DIR}/include"
-	 AC_SUBST([SSL_INCLUDE])
-      fi
-   AC_SUBST([SSL_LIB])
-   HAVE_LIBSSL=1
-   else
+	 		SSL_INCLUDE="-I${SSL_DIR}/include"
+	 		AC_SUBST([SSL_INCLUDE])
+      fi
+   	AC_SUBST([SSL_LIB])
+   	HAVE_LIBSSL=1
+   elif test ! -z "${SSL_DIR}"; 
+   then
       echo "***"
       echo "*** The ssl installation on this system appears to be broken."
       echo "*** Either correct the installation, or run configure"
       echo "*** including --without-ssl."
+      exit 1
+   fi
+fi
+AC_SUBST([HAVE_LIBSSL])
+
+
+
+
+# Z lib checks
+AC_CHECK_LIB([z], [compress])
+# pgsql checks
+AC_ARG_WITH([z], AC_HELP_STRING([--with-z=PATH],[use Z files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_Z=no
+     ;;
+     y|ye|yes)
+     ;;
+     *)
+     Z_DIR="${withval}"
+     ;;
+esac
+])
+if test "${USE_Z}" != "no"; then
+   AC_CHECK_LIB([z], [compress], AC_DEFINE([HAVE_Z], [], [Define to indicate the Z libraries should be used for compression operations.]), [], -L${Z_DIR}/lib)
+   if test "${ac_cv_lib_z_compress}" = "yes"; then
+      Z_LIB="-lz"
+      if test "${Z_DIR}" != ""; then
+         Z_LIB="-L${Z_DIR}/lib ${Z_LIB}"
+	 		Z_INCLUDE="-I${Z_DIR}/include"
+	 		AC_SUBST([Z_INCLUDE])
+      fi
+   	AC_SUBST([Z_LIB])
+   	HAVE_Z=1
+   elif test ! -z "${Z_DIR}"; 
+   then
+      echo "***"
+      echo "*** The z(compress library) installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-z."
+      exit
    fi
 else
-   HAVE_LIBSSL=0
-fi
-
-AC_SUBST([HAVE_LIBSSL])
-
-AC_ARG_WITH([odbc], AC_HELP_STRING([--with-odbc=PATH],[use unixODBC files in PATH]),[
-case ${withval} in
-     n|no)
-     USE_ODBC=no
-     ;;
-     y|ye|yes)
-     ;;
-     *)
-     ODBC_DIR="${withval}"
-     ;;
-esac
-])
-
-if test "${USE_ODBC}" != "no"; then
-   AC_CHECK_LIB([odbc], [SQLConnect], AC_DEFINE([HAVE_UNIXODBC], [], [Define to indicate the unixODBC libraries should be used for database operations.]), [], -L${ODBC_DIR}/lib)
-   if test "${ac_cv_lib_odbc_SQLConnect}" = "yes"; then
-      ODBC_LIB="-lodbc"
-      if test "${ODBC_DIR}" != ""; then
-         ODBC_LIB="-L${ODBC_DIR}/lib ${ODBC_LIB}"
-	 ODBC_INCLUDE="-I${ODBC_DIR}/include"
-	 AC_SUBST([ODBC_INCLUDE])
-      fi
-   AC_SUBST([ODBC_LIB])
-   HAVE_UNIXODBC=1
-   else
-      echo "***"
-      echo "*** The unixODBC installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** including --without-unixodbc."
-   fi
-else
-   HAVE_UNIXODBC=0
-fi
-
-AC_SUBST([HAVE_UNIXODBC])
-
-AC_ARG_WITH([pgsql], AC_HELP_STRING([--with-pgsql=PATH],[use PostgreSQL files in PATH]),[
-case ${withval} in
-     n|no)
-     USE_PGSQL=no
-     ;;
-     y|ye|yes)
-     ;;
-     *)
-     PGSQL_DIR="${withval}"
-     ;;
-esac
-])
-
-if test "${USE_PGSQL}" != "no"; then
-   AC_CHECK_LIB([pq], [PQexec], AC_DEFINE([HAVE_PGSQL], [], [Define to indicate the PostgreSQL libraries should be used for database operations.]), [], -L${PGSQL_DIR}/lib)
-   if test "${ac_cv_lib_pq_PQexec}" = "yes"; then
-      PGSQL_LIB="-lpq"
-      if test "${PGSQL_DIR}" != ""; then
-         PGSQL_LIB="-L${PGSQL_DIR}/lib ${PGSQL_LIB}"
-	 PGSQL_INCLUDE="-I${PGSQL_DIR}/include"
-	 AC_SUBST([PGSQL_INCLUDE])
-      fi
-   AC_SUBST([PGSQL_LIB])
-   HAVE_PGSQL=1
-   else
-      echo "***"
-      echo "*** The PostgreSQL installation on this system appears to be broken."
-      echo "*** Either correct the installation, or run configure"
-      echo "*** including --without-pgsql."
-   fi
-else
-   HAVE_PGSQL=0
-fi
-
-AC_SUBST([HAVE_PGSQL])
+   HAVE_Z=0
+fi
+AC_SUBST([HAVE_Z])
+
+
+
+
+
+#######################
+#  mandatory libraries..
+#######################
+AC_CHECK_LIB([c], [memcpy], [], [AC_MSG_ERROR("you need c library to compile asterisk")])
+AC_CHECK_LIB([crypto], [CRYPTO_malloc], [], [AC_MSG_ERROR("you need crypto library to compile asterisk")])
+AC_CHECK_LIB([dl], [dlopen], [], [AC_MSG_ERROR("you need dl library to compile asterisk")])
+#AC_CHECK_LIB([expat], [XML_SetBase], [], [AC_MSG_ERROR("you need expat library to compile asterisk")])
+AC_CHECK_LIB([m], [powl], [], [AC_MSG_ERROR("you need m library to compile asterisk")])
+AC_CHECK_LIB([curses], [wclear], [],
+  [AC_CHECK_LIB([ncurses], [wclear], [],[AC_MSG_ERROR("you need ncurses library to compile asterisk")])])
+#AC_CHECK_LIB([nsl], [nis_perror], [], [AC_MSG_ERROR("you need nsl library to compile asterisk")])
+AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR("you need pthread library to compile asterisk")])
+AC_CHECK_LIB([resolv], [inet_neta], [], [AC_MSG_ERROR("you need resolv library to compile asterisk")])
+#AC_CHECK_LIB([rt], [mq_send], [], [AC_MSG_ERROR("you need rt library to compile asterisk")])
+AC_CHECK_LIB([socket], [socket])
+
+
+
 
 # Checks for header files.
 AC_FUNC_ALLOCA
@@ -591,75 +1121,15 @@
 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 strspn strstr strtol utime])
 
 
-
-# export some FLAGS..
-z_CFLAGS_DEFINE="-D_REENTRANT -D_GNU_SOURCE"
-z_CFLAGS_WARN="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
-z_CFLAGS_INCLUDE="-Iinclude -I../include -I${xInclude} -I${xLInclude}"
-z_CFLAGS_OPTIMIZATION="-O6 -march=${host_cpu}"
-
-if test "x${PBX_DEBUG}" = xYes; then
-	z_CFLAGS_DEBUG="-g3"
-fi
-
-if test "x${PBX_PROFILE}" = xYes; then
-	z_CFLAGS_PROFILE="-pg"
-fi
-z_CFLAGS_MISC="-fomit-frame-pointer"
-z_LDFLAGS="-L${xLib} -L${xULib} -L${xLLib}"
-
-z_CFLAGS_SHLIB="-fPIC"
-z_LDFLAGS_SHLIB="-shared -Xlinker -x"
-
-# NetBSD...
-if test "x${PBX_OSTYPE}" = xNetBSD; then
-	z_CFLAGS_MISC+="-pthread"
-	z_CFLAGS_INCLUDE+="-I${CROSS_COMPILE_ROOT}/usr/pkg/include"
-	z_LDFLAGS+="-L${CROSS_COMPILE_ROOT}/usr/pkg/lib"
-fi
-# OpenBSD...
-if test "x${PBX_OSTYPE}" = xOpenBSD; then
-	z_CFLAGS_MISC+="-pthread"
-fi
-# SunOS...
-if test "x${PBX_OSTYPE}" = xSunOS; then
-	 z_CFLAGS_DEFINE+="-Wcast-align -DSOLARIS"
-	 z_CFLAGS_INCLUDE+="-Iinclude/solaris-compat -I${CROSS_COMPILE_TARGET}/usr/local/ssl/include"
-	 z_LDFLAGS+="-L${CROSS_COMPILE_ROOT}/usr/local/ssl/lib"
-	 z_CFLAGS_SHLIB="-fpic"
-	 z_LDFLAGS_SHLIB="-shared"
-fi
-# CYGWIN...
-if test "x${PBX_OSTYPE}" = xCYGWIN; then
-	z_CFLAGS_SHLIB="-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols"
-	z_LDFLAGS_SHLIB="-L.. -L."
-fi
-
-z_CFLAGS="${z_CFLAGS_DEFINE} ${z_CFLAGS_WARN} ${z_CFLAGS_INCLUDE} ${z_CFLAGS_OPTIMIZATION} ${z_CFLAGS_DEBUG} ${z_CFLAGS_PROFILE} ${z_CFLAGS_MISC}"
-AC_SUBST(z_CFLAGS)
-AC_SUBST(z_LDFLAGS)
-AC_SUBST(z_CFLAGS_SHLIB)
-AC_SUBST(z_LDFLAGS_SHLIB)
-
-
-AC_CONFIG_FILES([menuselect-deps makeopts Makefile])
+AC_CONFIG_FILES([menuselect-deps makeopts])
 AC_OUTPUT
 
 echo "Package configured for: "
 echo " OS type  : $PBX_OSTYPE"
 echo " host cpu : $host_cpu"
-echo " CFLAGS   : $CFLAGS $z_CFLAGS"
-echo " CXXFLAGS : $CXXFLAGS"
-echo " LIBS     : $LIBS"
-
-echo " CFLAGS  shared libs : $z_CFLAGS_SHLIB"
-echo " LDFLAGS shared libs : $z_LDFLAGS_SHLIB"
-
 if test "x${crossCompile}" = xYes; then

[... 10 lines stripped ...]


More information about the asterisk-commits mailing list