From f29149beabc84c3e56b51b0ac42b92fe122903a0 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 20 Aug 2009 08:45:20 +0000 Subject: [PATCH] check if the compiler accepts -fno-rtti -fno-exceptions SVN revision: 41882 --- configure.ac | 17 +++++++++++++++++ src/bin/Makefile.am | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cb7fed2..6fda04a 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,23 @@ case "$host_os" in esac AC_SUBST(WIN32_CFLAGS) +EXPEDITE_CXXFLAGS="" +AC_LANG_PUSH([C++]) +CXXFLAGS_save="${CXXFLAGS}" +CXXFLAGS="${CXXFLAGS} -fno-rtti -fno-exceptions" +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_cxx_flags="yes"], + [have_cxx_flags="no"]) +AC_MSG_CHECKING([whether the compiler supports -fno-rtti -fno-exceptions]) +AC_MSG_RESULT([${have_cxx_flags}]) +CXXFLAGS="${CXXFLAGS_save}" +if test "x${have_cxx_flags}" = "xyes" ; then + EXPEDITE_CXXFLAGS="-fno-rtti -fno-exceptions" +fi +AC_LANG_POP([C++]) +AC_SUBST(EXPEDITE_CXXFLAGS) + ### Checks for linker characteristics diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index e2d21bc..badd2d9 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -77,7 +77,7 @@ image_blend_occlude3_very_many.c \ poly_blend.c expedite_CFLAGS = @WIN32_CFLAGS@ -expedite_CXXFLAGS = -fno-rtti -fno-exceptions +expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ expedite_LDADD = @EVAS_LIBS@ @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @glew_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVIL_LIBS@ @quartz_libs@ -lm expedite_LDFLAGS = @lt_enable_auto_import@