summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Heath <doogie@debian.org>2002-05-19 10:57:48 +0000
committerAdam Heath <doogie@debian.org>2002-05-19 10:57:48 +0000
commitc9491d1b1ce971185d9c53a61a49f88cc157219c (patch)
tree1b59f682a704a3e6be3e783f76dad4d15014307e
parent9e27dc9074904f4f70eeca8825cd4c89110d4f04 (diff)
downloaddpkg-c9491d1b1ce971185d9c53a61a49f88cc157219c.tar.gz
Gah, I hate gcc. AC_TRY_COMPILE() produces code of the form
'int main() { ... }'. When -Werror -Wstrict-prototypes is given to gcc, it thinks the above code snippet is an error, and aborts. This was making DPKG_C_GCC_TRY_WARNS disable some -W options. So, I no longer use AC_TRY_COMPILE.
-rw-r--r--ChangeLog8
-rw-r--r--automake/dpkg.m416
2 files changed, 14 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ad61b71f8..2ee661e2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun May 19 05:57:24 CDT 2002 Adam Heath <doogie@debian.org>
+
+ * automake/dpkg.m4. Gah, I hate gcc. AC_TRY_COMPILE() produces code
+ of the form 'int main() { ... }'. When -Werror -Wstrict-prototypes is
+ given to gcc, it thinks the above code snippet is an error, and aborts.
+ This was making DPKG_C_GCC_TRY_WARNS disable some -W options. So, I
+ no longer use AC_TRY_COMPILE.
+
Sun May 19 04:56:51 CDT 2002 Adam Heath <doogie@debian.org>
* debian/rules: Oops. The command to run is aclocal, not aclocal.m4.
diff --git a/automake/dpkg.m4 b/automake/dpkg.m4
index 80460c567..ed5d04e1a 100644
--- a/automake/dpkg.m4
+++ b/automake/dpkg.m4
@@ -19,20 +19,16 @@ AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[
if test "${GCC-no}" = yes
then
AC_CACHE_VAL($2,[
- oldcflags="${CFLAGS-}"
- CFLAGS="${CFLAGS-} ${CWARNS} $1 -Werror"
- AC_TRY_COMPILE([
-#include <string.h>
-#include <stdio.h>
-],[
- strcmp("a","b"); fprintf(stdout,"test ok\n");
-], [$2=yes], [$2=no])
- CFLAGS="${oldcflags}"])
+ if $CC $1 -c /dev/null 2>/dev/null; then
+ $2=yes
+ else
+ $2=
+ fi
+ ])
if test "x$$2" = xyes; then
CWARNS="${CWARNS} $1"
AC_MSG_RESULT(ok)
else
- $2=''
AC_MSG_RESULT(no)
fi
else