aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-09 02:14:04 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-09 02:14:04 +0000
commit79d0cd4b17065438433ed8e95c4b70401482d0e8 (patch)
tree053a57eed4fb47a80a181651e177cb0992974680 /autoconf
parentc5c5d512610a1d6290e3248d8f5b6a9684e9158c (diff)
Cleanup a bit more by getting rid of useless version defines. Also make library detection use passed CFLAGS.
(closes issue #17309) Reported by: stuarth git-svn-id: http://svn.digium.com/svn/asterisk/trunk@262102 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/ast_c_compile_check.m42
-rw-r--r--autoconf/ast_c_define_check.m42
-rw-r--r--autoconf/ast_ext_lib.m415
3 files changed, 13 insertions, 6 deletions
diff --git a/autoconf/ast_c_compile_check.m4 b/autoconf/ast_c_compile_check.m4
index 0d49ec3ca..ed1563017 100644
--- a/autoconf/ast_c_compile_check.m4
+++ b/autoconf/ast_c_compile_check.m4
@@ -22,7 +22,7 @@ AC_DEFUN([AST_C_COMPILE_CHECK],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
- AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+ m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
],
[ AC_MSG_RESULT(no) ]
)
diff --git a/autoconf/ast_c_define_check.m4 b/autoconf/ast_c_define_check.m4
index adf31223e..52b979110 100644
--- a/autoconf/ast_c_define_check.m4
+++ b/autoconf/ast_c_define_check.m4
@@ -23,7 +23,7 @@ AC_DEFUN([AST_C_DEFINE_CHECK],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
- AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
+ m4_ifval([$4], [AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])])
],
[ AC_MSG_RESULT(no) ]
)
diff --git a/autoconf/ast_ext_lib.m4 b/autoconf/ast_ext_lib.m4
index 3d9d039dd..4038bfb12 100644
--- a/autoconf/ast_ext_lib.m4
+++ b/autoconf/ast_ext_lib.m4
@@ -30,7 +30,6 @@ AC_DEFUN([AST_EXT_LIB_SETUP],
esac
])
AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if you have the $2 library.])
- AH_TEMPLATE(m4_bpatsubst([[HAVE_$1_VERSION]], [(.*)]), [Define to the version of the $2 library.])
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([$1_DIR])
@@ -81,7 +80,10 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
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)
+ 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])
+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
fi
# now check for the header.
@@ -95,10 +97,10 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
if test "x$4" = "x" ; then # no header, assume found
$1_HEADER_FOUND="1"
else # check for the header
- saved_cppflags="${CPPFLAGS}"
+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
- CPPFLAGS="${saved_cppflags}"
+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
$1_LIB=""
@@ -110,9 +112,14 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
PBX_$1=1
cat >>confdefs.h <<_ACEOF
[@%:@define] HAVE_$1 1
+_ACEOF
+ m4_ifval([$7], [
+ cat >>confdefs.h <<_ACEOF
[@%:@define] HAVE_$1_VERSION $7
_ACEOF
+ ])
fi
fi
fi
+m4_ifval([$7], [AH_TEMPLATE(m4_bpatsubst([[HAVE_$1_VERSION]], [(.*)]), [Define to the version of the $2 library.])])
])