Commit d84757e3 authored by kili's avatar kili
Browse files

Use -W, not -Werror, for gcc older than 3.4

parent 0fc3078a
...@@ -558,6 +558,7 @@ fi ...@@ -558,6 +558,7 @@ fi
if test "$fp_have_gcc" = "NO" -a -d $srcdir/ghc; then if test "$fp_have_gcc" = "NO" -a -d $srcdir/ghc; then
AC_MSG_ERROR([gcc is required]) AC_MSG_ERROR([gcc is required])
fi fi
GccLT34=
AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
[if test "$fp_have_gcc" = "YES"; then [if test "$fp_have_gcc" = "YES"; then
fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/g'`" fp_cv_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9.]]*\).*/\1/g'`"
...@@ -566,12 +567,14 @@ AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version], ...@@ -566,12 +567,14 @@ AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
# See #2770: gcc 2.95 doesn't work any more, apparently. There probably # See #2770: gcc 2.95 doesn't work any more, apparently. There probably
# isn't a very good reason for that, but for now just make configure # isn't a very good reason for that, but for now just make configure
# fail. # fail.
FP_COMPARE_VERSIONS([$fp_cv_gcc_version], [-lt], [3.4], GccLT34=YES)
else else
fp_cv_gcc_version="not-installed" fp_cv_gcc_version="not-installed"
fi fi
]) ])
AC_SUBST([HaveGcc], [$fp_have_gcc]) AC_SUBST([HaveGcc], [$fp_have_gcc])
AC_SUBST([GccVersion], [$fp_cv_gcc_version]) AC_SUBST([GccVersion], [$fp_cv_gcc_version])
AC_SUBST(GccLT34)
])# FP_HAVE_GCC ])# FP_HAVE_GCC
AC_DEFUN([FP_MINGW_GCC], AC_DEFUN([FP_MINGW_GCC],
......
...@@ -537,6 +537,7 @@ HaveGcc = @HaveGcc@ ...@@ -537,6 +537,7 @@ HaveGcc = @HaveGcc@
UseGcc = YES UseGcc = YES
WhatGccIsCalled = @WhatGccIsCalled@ WhatGccIsCalled = @WhatGccIsCalled@
GccVersion = @GccVersion@ GccVersion = @GccVersion@
GccLT34 = @GccLT34@
ifeq "$(strip $(HaveGcc))" "YES" ifeq "$(strip $(HaveGcc))" "YES"
ifneq "$(strip $(UseGcc))" "YES" ifneq "$(strip $(UseGcc))" "YES"
CC = cc CC = cc
......
...@@ -131,7 +131,12 @@ $(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way)))) ...@@ -131,7 +131,12 @@ $(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way))))
# Flags for compiling every file # Flags for compiling every file
# We like plenty of warnings. # We like plenty of warnings.
WARNING_OPTS += -Wall -Wextra WARNING_OPTS += -Wall
ifeq "$(GccLT34)" "YES"
WARNING_OPTS += -W
else
WARNING_OPTS += -Wextra
endif
WARNING_OPTS += -Wstrict-prototypes WARNING_OPTS += -Wstrict-prototypes
WARNING_OPTS += -Wmissing-prototypes WARNING_OPTS += -Wmissing-prototypes
WARNING_OPTS += -Wmissing-declarations WARNING_OPTS += -Wmissing-declarations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment