[asterisk-commits] trunk r23897 - in /trunk: acinclude.m4 configure.ac

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 1 03:34:20 MST 2006


Author: kpfleming
Date: Mon May  1 05:34:20 2006
New Revision: 23897

URL: http://svn.digium.com/view/asterisk?rev=23897&view=rev
Log:
don't put bogus paths like -L/lib into link commands
do the QT check properly

Modified:
    trunk/acinclude.m4
    trunk/configure.ac

Modified: trunk/acinclude.m4
URL: http://svn.digium.com/view/asterisk/trunk/acinclude.m4?rev=23897&r1=23896&r2=23897&view=diff
==============================================================================
--- trunk/acinclude.m4 (original)
+++ trunk/acinclude.m4 Mon May  1 05:34:20 2006
@@ -19,14 +19,18 @@
 
 PBX_LIB$1=0
 
-if test "${USE_$1}" != "no"; then	
-   AC_CHECK_LIB([$1], [$2], [:], [], -L${$1_DIR}/lib $6)
+if test "${USE_$1}" != "no"; then
+   libdir=""
+   if test "x${$1_DIR}" != "x"; then
+      libdir="-L${$1_DIR}/lib"
+   fi
+   AC_CHECK_LIB([$1], [$2], [:], [], ${libdir} $6)
 
    if test "${ac_cv_lib_$1_$2}" = "yes"; then
       $1_LIB="-l$1 $6"
       $4_HEADER_FOUND="1"
       if test "x${$1_DIR}" != "x"; then
-         $1_LIB="-L${$1_DIR}/lib ${$1_LIB}"
+         $1_LIB="${libdir} ${$1_LIB}"
 	 $1_INCLUDE="-I${$1_DIR}/include"
 	 if test "x$3" != "x" ; then
 	    AC_CHECK_HEADER([${$1_DIR}/include/$3], [$4_HEADER_FOUND=1], [$4_HEADER_FOUND=0] )

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?rev=23897&r1=23896&r2=23897&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon May  1 05:34:20 2006
@@ -175,27 +175,26 @@
 AST_EXT_LIB([z], [compress], [zlib.h], [ZLIB], [zlib])
 
 PBX_LIBossaudio=0
-if test "x${PBX_OSTYPE}" = "xLinux" ; then
-   AC_CHECK_HEADER([linux/soundcard.h],
-                   [PBX_LIBossaudio=1
-		    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
-		  ])
-elif test "x${PBX_OSTYPE}" = "xFreeBSD" ; then
+AC_CHECK_HEADER([linux/soundcard.h],
+	        [
+		PBX_LIBossaudio=1
+                AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
+		])
+if test "$PBX_LIBossaudio" = "0"; then
    AC_CHECK_HEADER([sys/soundcard.h],
-                   [PBX_LIBossaudio=1
-		    AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
-		  ])
-elif test "x${PBX_OSTYPE}" = "xOpenBSD" ; then
+                   [
+		   PBX_LIBossaudio=1
+		   AC_DEFINE_UNQUOTED([HAVE_OSS], 1, [Define to indicate the Open Sound System library])
+		   ])
+fi
+if test "$PBX_LIBossaudio" = "0"; then
    AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
-elif test "x${PBX_OSTYPE}" = "xNetBSD" ; then
-   AST_EXT_LIB([ossaudio], [oss_ioctl_mixer], [soundcard.h], [OSS], [Open Sound System])
 fi
 
 AC_SUBST([PBX_LIBossaudio])
 
-if test "x${PBX_OSTYPE}" = "xLinux" ; then
-   AST_EXT_LIB([tonezone], [tone_zone_find], [linux/zaptel.h], [ZAPTEL], [Zaptel])
-else
+AST_EXT_LIB([tonezone], [tone_zone_find], [linux/zaptel.h], [ZAPTEL], [Zaptel])
+if test "$PBX_LIBtonezone" = "0"; then
    AST_EXT_LIB([tonezone], [tone_zone_find], [zaptel.h], [ZAPTEL], [Zaptel], [-lm])
 fi
 
@@ -222,12 +221,16 @@
 
 if test "${USE_GSM}" != "no"; then
    if test "${GSM_SYSTEM}" = "yes"; then
+      libdir=""
+      if test "x${GSM_DIR}" != "x"; then
+         libdir="-L${GSM_DIR}/lib"
+      fi
       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
-      [Define to indicate the GSM library]), [], -L${GSM_DIR}/lib)
+      [Define to indicate the GSM library]), [], ${libdir})
       if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
 	 gsm_LIB="-lgsm"
 	 if test "x${GSM_DIR}" != "x"; then
-	    gsm_LIB="-L${GSM_DIR}/lib ${gsm_LIB}"
+	    gsm_LIB="${libdir} ${gsm_LIB}"
 	    gsm_INCLUDE="-I${GSM_DIR}/include"
 	 fi
 	 PBX_LIBgsm=1
@@ -339,7 +342,7 @@
    echo -n "checking for vpb_open in -lvpb..."
    saved_libs="${LIBS}"
    saved_cppflags="${CPPFLAGS}"
-   if test "x${VPB_DIR}" != "x" ; then
+   if test "x${VPB_DIR}" != "x"; then
       LIBS="${LIBS} -L${VPB_DIR}/lib"
       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
    fi
@@ -399,50 +402,63 @@
 PBX_QT=0
 if test "${USE_QT}" != "no"; then
    echo -n "checking for QDate in -lqt..."
-   saved_ldflags="${LDFLAGS}"
-   LDFLAGS="${LDFLAGS} -L${QT_DIR}/lib -lqt"
+   saved_libs="${LIBS}"
+   saved_cppflags="${CPPFLAGS}"
+   if test "x${QT_DIR}" != "x"; then
+      LIBS="${LIBS} -L${QT_DIR}/lib"
+      CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
+   fi
+   LIBS="${LIBS} -lqt"
    qtlib="qt"
-	AC_LINK_IFELSE(
+   AC_LINK_IFELSE(
 	[
 		AC_LANG_PROGRAM(
-		[#include "${QT_DIR}include/qdatetime.h"],
+		[#include <qt3/qdatetime.h>],
 		[QDate date();])
 	],
 	[ac_cv_lib_qt_qt_date="yes"],
 	[ac_cv_lib_qt_qt_date="no"])
-		
-	if test "${ac_cv_lib_qt_qt_date}" = "no"; then
-		qtlib="qt-mt"	
-   	LDFLAGS="${saved_ldflags} -L${QT_DIR}/lib -lqt-mt"
-		AC_LINK_IFELSE(
+   LIBS="${saved_libs}"
+   CPPFLAGS="${saved_cppflags}"
+	
+   if test "${ac_cv_lib_qt_qt_date}" = "no"; then
+      saved_libs="${LIBS}"
+      saved_cppflags="${CPPFLAGS}"
+      if test "x${QT_DIR}" != "x"; then
+      	 LIBS="${LIBS} -L${QT_DIR}/lib"
+	 CPPFLAGS="${CPPFLAGS} -I${QT_DIR}/include"
+      fi
+      LIBS="${LIBS} -lqt-mt"
+      qtlib="qt-mt"	
+      AC_LINK_IFELSE(
 		[
 			AC_LANG_PROGRAM(
-			[#include "${QT_DIR}include/qdatetime.h"],
+			[#include <qt3/qdatetime.h>],
 			[QDate date();])
 		],
 		[ac_cv_lib_qt_qt_date="yes"],
 		[ac_cv_lib_qt_qt_date="no"])
-	fi	
+      LIBS="${saved_libs}"
+      CPPFLAGS="${saved_cppflags}"
+   fi	
+
+   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
+      AC_MSG_RESULT(yes) 
+   else
+      AC_MSG_RESULT(no) 
+   fi
 	
-	LDFLAGS="${saved_ldflags}"
-	
-	if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
-		AC_MSG_RESULT(yes) 
-	else
-		AC_MSG_RESULT(no) 
-	fi
-	
-	if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
-		QT_LIB="-l${qtlib}"
-		if test "${QT_DIR}" != ""; then
-			QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
-			QT_INCLUDE="-I${QT_DIR}/include"
-			AC_SUBST([QT_INCLUDE])
-		fi
-		AC_SUBST([QT_LIB])
-		PBX_QT=1
-		AC_DEFINE([HAVE_LIBQT], 1, [Define if your system has the Qt library])
-		AC_PATH_TOOL(QTMOC, moc, No)
+   if test "${ac_cv_lib_qt_qt_date}" = "yes"; then
+      QT_LIB="-l${qtlib}"
+      if test "${QT_DIR}" != ""; then
+      	 QT_LIB="-L${QT_DIR}/lib ${QT_LIB}"
+	 QT_INCLUDE="-I${QT_DIR}/include"
+	 AC_SUBST([QT_INCLUDE])
+      fi
+      AC_SUBST([QT_LIB])
+      PBX_QT=1
+      AC_DEFINE([HAVE_LIBQT], 1, [Define if your system has the Qt library])
+      AC_PATH_TOOL(QTMOC, moc, No)
    elif test ! -z "${QT_MANDATORY}"; 
    then
       echo "***"
@@ -453,9 +469,6 @@
    fi
 fi
 AC_SUBST([PBX_QT])
-
-
-
 
 AC_ARG_WITH([kde], AC_HELP_STRING([--with-kde=PATH],[use KDE files in PATH]),[
 case ${withval} in



More information about the asterisk-commits mailing list