[svn-commits] rizzo: trunk r44420 - /trunk/acinclude.m4
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed Oct 4 16:01:46 MST 2006
Author: rizzo
Date: Wed Oct 4 18:01:45 2006
New Revision: 44420
URL: http://svn.digium.com/view/asterisk?rev=44420&view=rev
Log:
document, and extend a bit the macro AST_EXT_LIB_CHECK so that
it can be used in more places in configure.ac
Modified:
trunk/acinclude.m4
Modified: trunk/acinclude.m4
URL: http://svn.digium.com/view/asterisk/trunk/acinclude.m4?rev=44420&r1=44419&r2=44420&view=diff
==============================================================================
--- trunk/acinclude.m4 (original)
+++ trunk/acinclude.m4 Wed Oct 4 18:01:45 2006
@@ -37,11 +37,17 @@
AC_SUBST([PBX_$1])
])
+# Check for existence of a given package ($1), looking up a function
+# in a library, or, if no function is supplied, only check for the
+# existence of the header files.
+# Only check if PBX_$1 != 1, and set PBX_$1=1 and HAVE_$1 if found.
+# Should be called after AST_EXT_LIB_SETUP($1, ...)
+
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
AC_DEFUN([AST_EXT_LIB_CHECK],
[
-if test "${USE_$1}" != "no"; then
+if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
pbxlibdir=""
if test "x${$1_DIR}" != "x"; then
if test -d ${$1_DIR}/lib; then
@@ -50,7 +56,12 @@
pbxlibdir="-L${$1_DIR}"
fi
fi
- AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+ pbxfuncname="$3"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_$1_FOUND=yes
+ else
+ AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
+ fi
if test "${AST_$1_FOUND}" = "yes"; then
$1_LIB="-l$2 $5"
More information about the svn-commits
mailing list