check if the compiler accepts -fno-rtti -fno-exceptions
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 20 Aug 2009 08:45:20 +0000 (08:45 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 20 Aug 2009 08:45:20 +0000 (08:45 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/expedite@41882 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/bin/Makefile.am

index cb7fed2..6fda04a 100644 (file)
@@ -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
 
index e2d21bc..badd2d9 100644 (file)
@@ -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@