diff options
author | Hib Eris <hib@hiberis.nl> | 2010-06-30 15:06:44 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2010-07-12 23:18:39 +0100 |
commit | 58c8430ac584f3ba5e97aceb148e6287bfc45f95 (patch) | |
tree | 9c9c1a0f70e0295e9473bfd974a29d78de87e52a /configure.ac | |
parent | e3663a855a9c86f0a3988a7a50fa40d37d0ea069 (diff) |
Set -ansi compiler flag early in configure.ac
The -ansi compiler flag does not enable warnings, but turns of certain
features of GCC. To force feature tests to use this flag, it should be
set early in configure.ac
This is important for the mingw compiler where header files refrain
from declaring certain function (e.g. gettimeofday()) when the -ansi
flag is set.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index b34f1c93..49f5cd33 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,9 @@ AC_PROG_CC_STDC # CXX="gcc" #fi AC_PROG_CXX +if test "x$GXX" = "xyes"; then + CXXFLAGS="$CXXFLAGS -ansi" +fi AC_PROG_INSTALL AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system])) AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system])) @@ -601,8 +604,8 @@ if test "x$GCC" != xyes; then fi case "$enable_compile_warnings" in no) ;; - yes) CXXFLAGS="-Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -ansi $CXXFLAGS" ;; - kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi \ + yes) CXXFLAGS="-Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor $CXXFLAGS" ;; + kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \ -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \ -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith \ -Wwrite-strings -O2 -Wformat-security \ |