summaryrefslogtreecommitdiff
path: root/automake
diff options
context:
space:
mode:
authorAdam Heath <doogie@debian.org>2000-12-24 01:34:55 +0000
committerAdam Heath <doogie@debian.org>2000-12-24 01:34:55 +0000
commit559e443fd0920cf624208950e13a5fdf6e3b510e (patch)
treee829ee46ea93a0bd1e216afb8e9cf63c313670d4 /automake
parent709f432b6ba5d3bc25a950f2deb321deb6ef2292 (diff)
downloaddpkg-559e443fd0920cf624208950e13a5fdf6e3b510e.tar.gz
Modified DPKG_C_GCC_TRY_WARNS() to call AC_SUBST, so that we can use the
result of the test during build time.
Diffstat (limited to 'automake')
-rw-r--r--automake/dpkg.m412
1 files changed, 8 insertions, 4 deletions
diff --git a/automake/dpkg.m4 b/automake/dpkg.m4
index f5146449d..8b2d68d7d 100644
--- a/automake/dpkg.m4
+++ b/automake/dpkg.m4
@@ -16,12 +16,12 @@ AC_DEFUN(DPKG_CACHED_TRY_COMPILE,[
fi
])
-dnl DPKG_C_GCC_TRY_WARNS(<warnings>,<cachevar>)
+dnl DPKG_C_GCC_TRY_WARNS(<warnings>,<substvar>,<cachevar>)
AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[
AC_MSG_CHECKING([GCC warning flag(s) $1])
if test "${GCC-no}" = yes
then
- AC_CACHE_VAL($2,[
+ AC_CACHE_VAL($3,[
oldcflags="${CFLAGS-}"
CFLAGS="${CFLAGS-} ${CWARNS} $1 -Werror"
AC_TRY_COMPILE([
@@ -29,16 +29,20 @@ AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[
#include <stdio.h>
],[
strcmp("a","b"); fprintf(stdout,"test ok\n");
-], [$2=yes], [$2=no])
+], [$3=yes], [$3=no])
CFLAGS="${oldcflags}"])
- if test "x$$2" = xyes; then
+ if test "x$$3" = xyes; then
+ $2='$1'
CWARNS="${CWARNS} $1"
AC_MSG_RESULT(ok)
else
+ $3=''
$2=''
AC_MSG_RESULT(no)
fi
else
+ $2=''
AC_MSG_RESULT(no, not using GCC)
fi
+ AC_SUBST($2)
])