From: Adam Heath Date: Sun, 19 May 2002 10:57:48 +0000 (+0000) Subject: Gah, I hate gcc. AC_TRY_COMPILE() produces code of the form X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9491d1b1ce971185d9c53a61a49f88cc157219c;p=dpkg 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. --- diff --git a/ChangeLog b/ChangeLog index ad61b71f..2ee661e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sun May 19 05:57:24 CDT 2002 Adam Heath + + * 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 * debian/rules: Oops. The command to run is aclocal, not aclocal.m4. diff --git a/automake/dpkg.m4 b/automake/dpkg.m4 index 80460c56..ed5d04e1 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 -#include -],[ - 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