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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Apr 13 14:39:06 MST 2006


Author: kpfleming
Date: Thu Apr 13 16:39:05 2006
New Revision: 19931

URL: http://svn.digium.com/view/asterisk?rev=19931&view=rev
Log:
add support for insane distros that install libraries/headers under subdirectories of standard directories

Modified:
    team/group/autoconf_and_menuselect/acinclude.m4
    team/group/autoconf_and_menuselect/configure.ac

Modified: team/group/autoconf_and_menuselect/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/acinclude.m4?rev=19931&r1=19930&r2=19931&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/acinclude.m4 (original)
+++ team/group/autoconf_and_menuselect/acinclude.m4 Thu Apr 13 16:39:05 2006
@@ -43,3 +43,61 @@
 fi
 AC_SUBST([PBX_LIB$1])
 ])
+
+# AST_EXT_LIB_SUFFIX([NAME], [FUNCTION], [package symbol name], [package friendly name], [additional LIB data])
+
+AC_DEFUN([AST_EXT_LIB_SUFFIX],
+[
+AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=PATH],[use $4 files in PATH]),[
+case ${withval} in
+     n|no)
+     USE_$1=no
+     ;;
+     y|ye|yes)
+     $1_MANDATORY="yes"
+     ;;
+     *)
+     $1_DIR="${withval}"
+     $1_MANDATORY="yes"
+     ;;
+esac
+])
+AC_ARG_WITH([$1]-suffix, AC_HELP_STRING([--with-$1-suffix=PATH],[add PATH suffix for $4 files]),[
+case ${withval} in
+     *)
+     if test "x${$1_DIR}" != "x"; then
+        $1_SUFFIX="/${withval}"
+        $1_MANDATORY="yes"
+     else
+	echo "--with-$1-suffix ignored because --with-$1 was not specified."
+     fi
+     ;;
+esac
+])
+
+PBX_LIB$1=0
+
+if test "${USE_$1}" != "no"; then	
+   AC_CHECK_LIB([$1], [$2], AC_DEFINE_UNQUOTED([HAVE_$3], 1,
+   [Define to indicate the $4 library]), [], -L${$1_DIR}/lib${$1_SUFFIX} $5)
+
+   if test "${ac_cv_lib_$1_$2}" = "yes"; then
+      $1_LIB="-l$1 $5"
+      if test "x${$1_DIR}" != "x"; then
+         $1_LIB="-L${$1_DIR}/lib${$1_SUFFIX} ${$1_LIB}"
+	 $1_INCLUDE="-I${$1_DIR}/include${$1_SUFFIX}"
+	 AC_SUBST([$1_INCLUDE])
+      fi
+      AC_SUBST([$1_LIB])
+      PBX_LIB$1=1
+   elif test ! -z "${$1_MANDATORY}";
+   then
+      echo "***"
+      echo "*** The $4 installation on this system appears to be broken."
+      echo "*** Either correct the installation, or run configure"
+      echo "*** including --without-$1"
+      exit 1
+   fi
+fi
+AC_SUBST([PBX_LIB$1])
+])

Modified: team/group/autoconf_and_menuselect/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configure.ac?rev=19931&r1=19930&r2=19931&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/configure.ac (original)
+++ team/group/autoconf_and_menuselect/configure.ac Thu Apr 13 16:39:05 2006
@@ -155,7 +155,7 @@
 AST_EXT_LIB([mfcr2], [mfcr2_MakeCall], [MFCR2], [MFCR2])
 AST_EXT_LIB([osptk], [OSPPCryptoDecrypt], [OSPTK], [OSP Toolkit])
 AST_EXT_LIB([odbc], [SQLConnect], [UNIXODBC], [unixODBC])
-AST_EXT_LIB([pq], [PQexec], [PQ], [PostgreSQL])
+AST_EXT_LIB_SUFFIX([pq], [PQexec], [PQ], [PostgreSQL])
 AST_EXT_LIB([sqlite], [sqlite_exec], [SQLITE], [SQLite])
 AST_EXT_LIB([tds], [tds_version], [FREETDS], [FreeTDS])
 AST_EXT_LIB([popt], [poptStrerror], [POPT], [popt])



More information about the asterisk-commits mailing list