summaryrefslogtreecommitdiff
path: root/autoconf/ast_ext_lib.m4
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-11-17 11:38:48 -0500
committerCorey Farrell <git@cfware.com>2017-11-28 10:41:31 -0500
commit6274e58a25d5d21c4483d047e4ea7ae2600e2470 (patch)
treeec70dc51b67fd0994f29748ae1f017e66ffce90a /autoconf/ast_ext_lib.m4
parent635fe8ec872671592a4fa5ea1aa5535d2b8e1236 (diff)
autoconf: Use m4 conditionals where possible.
Change-Id: I530c0a72f965437acef6a9a4fbfe5c487f078b65
Diffstat (limited to 'autoconf/ast_ext_lib.m4')
-rw-r--r--autoconf/ast_ext_lib.m423
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