From b6b3ed661fe53037620ba8c9269016f6bbcdaa97 Mon Sep 17 00:00:00 2001 From: rizzo Date: Wed, 4 Oct 2006 23:01:45 +0000 Subject: 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 --- acinclude.m4 | 15 +++++++++++++-- 1 file 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" -- cgit v1.2.3