diff --git a/configure b/configure index 284ae5b9d8..f2978cb345 100755 --- a/configure +++ b/configure @@ -42122,7 +42122,7 @@ fi if test "$GCC" = "yes" ; then if test "$wxUSE_NO_RTTI" = "yes" ; then - WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti" + WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti" fi if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions" @@ -47507,7 +47507,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { diff --git a/configure.in b/configure.in index e6bf454aef..70aa4f4e09 100644 --- a/configure.in +++ b/configure.in @@ -5408,7 +5408,10 @@ fi if test "$GCC" = "yes" ; then if test "$wxUSE_NO_RTTI" = "yes" ; then - WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti" + dnl Define wxNO_RTTI on the command line because only g++ 4.3 and later + dnl define __GXX_RTTI which allows us to detect the use of -fno-rtti + dnl switch but we need to do it manually for the older versions. + WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -DwxNO_RTTI -fno-rtti" fi if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions" diff --git a/include/wx/platform.h b/include/wx/platform.h index dd343949e5..713925585f 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -837,7 +837,11 @@ g++) or by editing project files with MSVC so test for it here too. */ #ifndef wxNO_RTTI -# ifdef __GNUG__ + /* + Only 4.3 defines __GXX_RTTI by default so its absence is not an + indication of disabled RTTI with the previous versions. + */ +# if wxCHECK_GCC_VERSION(4, 3) # ifndef __GXX_RTTI # define wxNO_RTTI # endif