diff options
author | Adam Heath <doogie@debian.org> | 2002-05-19 10:57:48 +0000 |
---|---|---|
committer | Adam Heath <doogie@debian.org> | 2002-05-19 10:57:48 +0000 |
commit | c9491d1b1ce971185d9c53a61a49f88cc157219c (patch) | |
tree | 1b59f682a704a3e6be3e783f76dad4d15014307e | |
parent | 9e27dc9074904f4f70eeca8825cd4c89110d4f04 (diff) | |
download | dpkg-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | automake/dpkg.m4 | 16 |
2 files changed, 14 insertions, 10 deletions
@@ -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 |