aboutsummaryrefslogtreecommitdiffstats
path: root/acinclude.m4
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-04 23:01:45 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-04 23:01:45 +0000
commitb6b3ed661fe53037620ba8c9269016f6bbcdaa97 (patch)
tree17dfefcbb2bd03b40583ffd40f6d6e502132bdc9 /acinclude.m4
parent08e703466f8ea169b11edd7a217f5be88024d5f3 (diff)
document, and extend a bit the macro AST_EXT_LIB_CHECK so that
it can be used in more places in configure.ac git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44420 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m415
1 files changed, 13 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index bef250d8b..c3c3e12b4 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -37,11 +37,17 @@ AC_SUBST([$1_INCLUDE])
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 @@ if test "${USE_$1}" != "no"; then
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"