'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 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.
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