diff options
| author | Dan Winship <danw@gnome.org> | 2009-04-19 10:46:40 -0400 |
|---|---|---|
| committer | Dan Winship <danw@gnome.org> | 2009-05-15 09:48:37 -0400 |
| commit | 7376039d95add4ebcc9bb319d48abfeb49f5471f (patch) | |
| tree | a766bd5d219e2782baee64fc6359ece719d5809a | |
| parent | 230c0f38e2bcd4a6109e8e5c93da8d236d290647 (diff) | |
| download | libsoup-7376039d95add4ebcc9bb319d48abfeb49f5471f.tar.gz | |
Fix cflags to work with older versions of gcc
Check that gcc supports -Wmissing-include-dirs and -Wundef rather than
using them unconditionally.
http://bugzilla.gnome.org/show_bug.cgi?id=578851
| -rw-r--r-- | configure.in | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 3ed1a4b1..1c9b34ed 100644 --- a/configure.in +++ b/configure.in @@ -241,8 +241,20 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then -Wall -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ -Wdeclaration-after-statement -Wformat=2 -Winit-self \ - -Wmissing-include-dirs -Wundef -Waggregate-return \ - -Wmissing-format-attribute" + -Waggregate-return -Wmissing-format-attribute" + + for option in -Wmissing-include-dirs -Wundef; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $option" + AC_MSG_CHECKING([whether gcc understands $option]) + AC_TRY_COMPILE([], [], + has_option=yes, + has_option=no,) + AC_MSG_RESULT($has_option) + if test $has_option = no; then + CFLAGS="$SAVE_CFLAGS" + fi + done fi if test "$os_win32" != yes; then |
