make -Wno-long-double usage conditional to gcc supporting it

This commit is contained in:
Norbert Thiebaud
2011-07-26 21:58:08 -05:00
parent 82f0ba7e98
commit b5e6d0a679
4 changed files with 21 additions and 3 deletions

View File

@@ -3193,6 +3193,17 @@ if test "$GCC" = "yes"; then
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -Wno-long-double"
AC_TRY_LINK([], [ return 0; ], [ HAVE_GCC_NO_LONG_DOUBLE=TRUE ], [])
CFLAGS=$save_CFLAGS
if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([whether $CC supports -std=c++0x without Language Defect 757])
save_CXXFLAGS=$CFLAGS
CXXFLAGS="$CXXFLAGS -std=c++0x"
@@ -3234,6 +3245,7 @@ return !(i != 0 && j != 0);
fi
AC_SUBST(HAVE_CXX0X)
AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
# ===================================================================
# use ccache?

View File

@@ -1819,6 +1819,7 @@ ToFile( "ALIGNOF_SHORT", "@ALIGNOF_SHORT@", "e" );
ToFile( "ALIGNOF_INT", "@ALIGNOF_INT@", "e" );
ToFile( "ALIGNOF_LONG", "@ALIGNOF_LONG@", "e" );
ToFile( "ALIGNOF_DOUBLE", "@ALIGNOF_DOUBLE@", "e" );
ToFile( "HAVE_GCC_NO_LONG_DOUBLE", "@HAVE_GCC_NO_LONG_DOUBLE@", "e" );
ToFile( "HAVE_GCC_VISIBILITY_FEATURE",
"@HAVE_GCC_VISIBILITY_FEATURE@", "e" );
ToFile( "HAVE_GCC_VISIBILITY_BROKEN",

View File

@@ -92,7 +92,6 @@ gb_CXXFLAGS := \
-Wendif-labels \
-Wextra \
-Wno-ctor-dtor-privacy \
-Wno-long-double \
-Wno-non-virtual-dtor \
-fPIC \
-fmessage-length=0 \
@@ -105,6 +104,10 @@ gb_CXXFLAGS := \
#-fsigned-char \ might be removed?
#-malign-natural \ might be removed?
ifeq($(HAVE_GCC_NO_LONG_DOUBLE),TRUE)
gb_CXXFLAGS +:= -Wno-long-double
endif
# these are to get g++ to switch to Objective-C++ mode
# (see toolkit module for a case where it is necessary to do it this way)
gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions

View File

@@ -113,8 +113,10 @@ CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
CFLAGS_NO_EXCEPTIONS=-fno-exceptions
# Normal C++ compilation flags
CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS)
CFLAGSCXX+= -Wno-ctor-dtor-privacy
CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS) -Wno-ctor-dtor-privacy
.IF "$(HAVE_GCC_NO_LONG-DOUBLE)" == "TRUE"
CFLAGSCXX+= -Wno-long-double
.ENDIF
PICSWITCH:=-fPIC
# Other flags