aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/ast_ext_lib.m4
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-27 16:14:57 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-27 16:14:57 +0000
commit78a9222af02d1f3a18a8bb856b0ead507e2edb2e (patch)
tree2a574626f4e1bfebcbffdc4cd0080b395275bb82 /autoconf/ast_ext_lib.m4
parent44f8e74bbddac2b2b9a644c0d6ba2ca449d7f8d0 (diff)
Merged revisions 214360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r214360 | tilghman | 2009-08-27 11:12:03 -0500 (Thu, 27 Aug 2009) | 10 lines Merged revisions 214357 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r214357 | tilghman | 2009-08-27 11:03:50 -0500 (Thu, 27 Aug 2009) | 3 lines Make autoheader descriptions render correctly in our autoconfig.h file. (Figured out while working with issue #14906) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@214361 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'autoconf/ast_ext_lib.m4')
-rw-r--r--autoconf/ast_ext_lib.m419
1 files changed, 15 insertions, 4 deletions
diff --git a/autoconf/ast_ext_lib.m4 b/autoconf/ast_ext_lib.m4
index 57d83a5d1..711690097 100644
--- a/autoconf/ast_ext_lib.m4
+++ b/autoconf/ast_ext_lib.m4
@@ -26,6 +26,7 @@ AC_DEFUN([AST_EXT_LIB_SETUP],
esac
])
PBX_$1=0
+ AH_TEMPLATE(m4_bpatsubst([[HAVE_$1]], [(.*)]), [Define to 1 if you have the $2 library.])
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([$1_DIR])
@@ -70,7 +71,7 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
else # check for the header
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
- AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
+ AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
CPPFLAGS="${saved_cppflags}"
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
@@ -81,9 +82,19 @@ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
$1_LIB=""
fi
PBX_$1=1
- # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
- AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define this to indicate the ${$1_DESCRIP} library])
- AC_DEFINE_UNQUOTED([HAVE_$1_VERSION], [$7], [Define to indicate the ${$1_DESCRIP} library version])
+ if test "x${$1_OPTION}" = "x"; then
+ dnl Ensure that we have an autoheader, when AST_EXT_LIB_SETUP was
+ dnl not called. Note that we cannot use shell substitution in the
+ dnl description, because the shell is never invoked when rendering
+ dnl the autoheader. Only m4 substitutions will expand correctly.
+ AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to 1 to indicate $1 functionality.])
+ AC_DEFINE_UNQUOTED([HAVE_$1_VERSION], [$7], [Define to indicate the $1 library version])
+ else
+ cat >>confdefs.h <<_ACEOF
+[@%:@define] HAVE_$1 1
+[@%:@define] HAVE_$1_VERSION $7
+_ACEOF
+ fi
fi
fi
fi