diff options
Diffstat (limited to 'autoconf/ast_ext_lib.m4')
-rw-r--r-- | autoconf/ast_ext_lib.m4 | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/autoconf/ast_ext_lib.m4 b/autoconf/ast_ext_lib.m4 index cd5a3a779..e8ce2013d 100644 --- a/autoconf/ast_ext_lib.m4 +++ b/autoconf/ast_ext_lib.m4 @@ -117,15 +117,15 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then pbxlibdir="-L${$1_DIR}" fi fi - pbxfuncname="$3" - if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers + m4_ifblank([$3], [ + # empty lib, assume only headers AST_$1_FOUND=yes - else + ], [ ast_ext_lib_check_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $6" - AC_CHECK_LIB([$2], [${pbxfuncname}], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], [${pbxlibdir} $5]) + AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], [${pbxlibdir} $5]) CFLAGS="${ast_ext_lib_check_save_CFLAGS}" - fi + ]) # now check for the header. if test "${AST_$1_FOUND}" = "yes"; then @@ -135,21 +135,24 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then $1_INCLUDE="-I${$1_DIR}/include" fi $1_INCLUDE="${$1_INCLUDE} $6" - if test "x$4" = "x" ; then # no header, assume found + m4_ifblank([$4], [ + # no header, assume found $1_HEADER_FOUND="1" - else # check for the header + ], [ + # check for the header ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}" AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0]) CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}" - fi + ]) if test "x${$1_HEADER_FOUND}" = "x0" ; then $1_LIB="" $1_INCLUDE="" else - if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library + m4_ifblank([$3], [ + # only checking headers -> no library $1_LIB="" - fi + ]) PBX_$1=1 cat >>confdefs.h <<_ACEOF [@%:@define] HAVE_$1 1 |