diff options
author | Luigi Rizzo <rizzo@icir.org> | 2007-11-20 15:39:00 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2007-11-20 15:39:00 +0000 |
commit | 52619b6ec59dbc2be11ba3693f86c3b570452991 (patch) | |
tree | e76f9c5db6bb473f39c9d4deff8f2f30470089a3 /acinclude.m4 | |
parent | 463723296dcaf31cec88dfdac5081128325d4b54 (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: https://origsvn.digium.com/svn/asterisk/trunk@89452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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="" |