From: Robert Roebling Date: Wed, 29 Jun 2005 13:40:33 +0000 (+0000) Subject: Added test case speficically for GCC >= 4.0 and X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/87dd70d3c9cce306763914b8e3861f5801598333?hp=ddd14b1483bf8dbf45b0eadd28530b6d4e97e519 Added test case speficically for GCC >= 4.0 and define NO_GCC_PRAGMA then. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/configure b/configure index 5dd847bb27..722afc8a30 100755 --- a/configure +++ b/configure @@ -44235,9 +44235,65 @@ fi GCC_PRAGMA_FLAGS="" PCH_FLAGS="" + if test $GCC_PCH = 1 ; then - GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" PCH_FLAGS="-DWX_PRECOMP" +fi + +if test "$GCC" = yes; then + echo "$as_me:$LINENO: checking if this GCC version is >= 4.0 and needs -DNO_GCC_PRAGMA" >&5 +echo $ECHO_N "checking if this GCC version is >= 4.0 and needs -DNO_GCC_PRAGMA... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#if (__GNUC__ < 4) + #error "Not GCC 4.0 or greater" + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else case "${host}" in powerpc-*-darwin* ) @@ -44302,7 +44358,7 @@ fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi ;; - *-pc-os2_emx | *-pc-os2-emx ) + *-pc-os2_emx | *-pc-os2-emx ) if test "$wxUSE_STL" = "yes"; then echo "$as_me:$LINENO: checking if this gcc version needs -DNO_GCC_PRAGMA" >&5 echo $ECHO_N "checking if this gcc version needs -DNO_GCC_PRAGMA... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 5de14b6745..636e84e5ce 100644 --- a/configure.in +++ b/configure.in @@ -6697,10 +6697,23 @@ dnl According to Vaclav, if NO_GCC_PRAGMA is used for any reason it needs to dnl be in wx-config output. Not doing so could result in link problems. GCC_PRAGMA_FLAGS="" PCH_FLAGS="" -dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP: + +dnl Find out if we have to define WX_PRECOMP: if test $GCC_PCH = 1 ; then - GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" PCH_FLAGS="-DWX_PRECOMP" +fi + +dnl Find out if we have to define NO_GCC_PRAGMA +if test "$GCC" = yes; then + AC_MSG_CHECKING([if this GCC version is >= 4.0 and needs -DNO_GCC_PRAGMA]) + AC_TRY_COMPILE([], + [#if (__GNUC__ < 4) + #error "Not GCC 4.0 or greater" + #endif + ], + [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) else case "${host}" in powerpc-*-darwin* ) @@ -6729,7 +6742,7 @@ else [AC_MSG_RESULT([no])]) fi ;; - *-pc-os2_emx | *-pc-os2-emx ) + *-pc-os2_emx | *-pc-os2-emx ) dnl GCC versions ported to OS/2 have similar problems with dnl static member of classes in combination with STL and dnl pragma interface/implementation