diff options
author | David Wragg <david@rabbitmq.com> | 2010-10-21 17:49:04 +0100 |
---|---|---|
committer | David Wragg <david@rabbitmq.com> | 2010-10-21 17:49:04 +0100 |
commit | b4e92fd12d58e3baf3bc091114fcc57b88400544 (patch) | |
tree | a50d4047f6f192e4006764b7e43fe1410b59d961 /configure.ac | |
parent | e8ddb5e6758dcb888d1f6aef754a33fd7ba7a2cb (diff) | |
download | rabbitmq-c-b4e92fd12d58e3baf3bc091114fcc57b88400544.tar.gz |
Pass "-ansi -pedantic" to gcc, so it tells us when we stray from C90
And fix up the resulting warnings
We don't use "-ansi -pedantic" in the tools dir, because that code
relies on libpopt, and so is unlikely ever to work with the Microsoft
compiler anyway.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index a7100a7..c7672a8 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ AM_PROG_LIBTOOL dnl Header-file checks AC_HEADER_STDC -dnl Only use -Wall if we have gcc if test "x$GCC" = "xyes"; then - if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then + dnl Only use -Wall if we have gcc + if ! echo "$CFLAGS" | grep "\-Wall" 2> /dev/null ; then CFLAGS="$CFLAGS -Wall" fi fi @@ -35,7 +35,15 @@ AS_IF([test "x$windows" = xyes], [AC_DEFINE([WINDOWS], [1], [Define to 1 if on Windows.])] ) +AM_CONDITIONAL(GCC, test "x$GCC" = xyes) + +# Detect how to declare inline functions. Because we will sometimes +# use "-ansi -pedantic" with gcc, we need to make sure the result will +# work in that context. +orig_cflags="$CFLAGS" +AS_IF([test "x$GCC" = "xyes"], [CFLAGS="$CFLAGS -ansi -pedantic"]) AC_C_INLINE +CFLAGS="$orig_cflags" dnl Decide which API abstraction layer to use PLATFORM_DIR=unix |