make -Wno-long-double usage conditional to gcc supporting it
This commit is contained in:
12
configure.in
12
configure.in
@@ -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?
|
||||
|
@@ -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",
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user