diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-20 15:39:00 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-20 15:39:00 +0000 |
commit | 8c6e113ab5e36cae30b2afcf2c339bbfc9be6a4c (patch) | |
tree | e76f9c5db6bb473f39c9d4deff8f2f30470089a3 /acinclude.m4 | |
parent | 1084f843d7c55067f79a1dcf7da3dd39f55d3e0e (diff) |
add an argument for extra headers to AC_EXT_LIB_CHECK,
and on passing simplify the code.
Too bad that every time we need to regenerate configure...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89452 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index bb389eaeb..045e3682c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -117,11 +117,13 @@ AC_DEFUN([AST_C_DEFINE_CHECK], # in a library, or, if no function is supplied, only check for the # existence of the header files. -# AST_EXT_LIB_CHECK([package], [library], [function], [header], [additional LIB data], [version]) +# AST_EXT_LIB_CHECK([package], [library], [function], [header], +# [extra libs], [extra cflags], [version]) AC_DEFUN([AST_EXT_LIB_CHECK], [ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then pbxlibdir="" + # if --with-$1=DIR has been specified, use it. if test "x${$1_DIR}" != "x"; then if test -d ${$1_DIR}/lib; then pbxlibdir="-L${$1_DIR}/lib" @@ -136,22 +138,21 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5) fi + # now check for the header. if test "${AST_$1_FOUND}" = "yes"; then - $1_LIB="-l$2 $5" - $1_HEADER_FOUND="1" + $1_LIB="${pbxlibdir} -l$2 $5" + # if --with-$1=DIR has been specified, use it. if test "x${$1_DIR}" != "x"; then - $1_LIB="${pbxlibdir} ${$1_LIB}" $1_INCLUDE="-I${$1_DIR}/include" - saved_cppflags="${CPPFLAGS}" - CPPFLAGS="${CPPFLAGS} -I${$1_DIR}/include" - if test "x$4" != "x" ; then - AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0]) - fi - CPPFLAGS="${saved_cppflags}" - else - if test "x$4" != "x" ; then - AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0]) - fi + fi + $1_INCLUDE="${$1_INCLUDE} $6" + if test "x$4" = "x" ; then # no header, assume found + $1_HEADER_FOUND="1" + else # check for the header + saved_cppflags="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE} $6" + AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0]) + CPPFLAGS="${saved_cppflags}" fi if test "x${$1_HEADER_FOUND}" = "x0" ; then $1_LIB="" |