define NO_GCC_PRAGMA if

- PCH
    - GCC >= 4.0
    - certain cases like Apple GCC, Mingw32 with certain other option


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2005-06-29 19:02:19 +00:00
parent 87dd70d3c9
commit 87ae5038ef
2 changed files with 93 additions and 90 deletions

69
configure vendored
View File

@ -44238,12 +44238,12 @@ PCH_FLAGS=""
if test $GCC_PCH = 1 ; then
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
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
else
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
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@ -44254,8 +44254,8 @@ int
main ()
{
#if (__GNUC__ < 4)
#error "Not GCC 4.0 or greater"
#endif
#error "Not GCC 4.0 or greater"
#endif
;
return 0;
@ -44284,7 +44284,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
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 "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
@ -44292,20 +44292,17 @@ 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* )
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
;;
*-*-mingw32* )
if test "$wxUSE_STL" = "yes" -o \
case "${host}" in
powerpc-*-darwin* )
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
;;
*-*-mingw32* )
if test "$wxUSE_STL" = "yes" -o \
"$wxUSE_NO_EXCEPTIONS" != "yes" -o \
"$wxUSE_NO_RTTI" != "yes"; then
echo "$as_me:$LINENO: checking if this MinGW version needs -DNO_GCC_PRAGMA" >&5
echo "$as_me:$LINENO: checking if this MinGW version needs -DNO_GCC_PRAGMA" >&5
echo $ECHO_N "checking if this MinGW version needs -DNO_GCC_PRAGMA... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@ -44316,8 +44313,8 @@ int
main ()
{
#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
#error "Not GCC 3.2 or greater"
#endif
;
return 0;
@ -44346,7 +44343,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
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 "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
@ -44356,13 +44353,13 @@ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
;;
*-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
fi
;;
*-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
cat >conftest.$ac_ext <<_ACEOF
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@ -44373,8 +44370,8 @@ int
main ()
{
#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
#error "Not GCC 3.2 or greater"
#endif
;
return 0;
@ -44403,7 +44400,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
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 "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
echo "$as_me: failed program was:" >&5
@ -44413,9 +44410,13 @@ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
;;
esac
fi
;;
esac
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
CPPFLAGS="$PCH_FLAGS $GCC_PRAGMA_FLAGS $CPPFLAGS"

View File

@ -6698,67 +6698,69 @@ 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 WX_PRECOMP:
dnl Find out if we have to define WX_PRECOMP (and thus NO_GCC_PRAGMA)
if test $GCC_PCH = 1 ; then
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])])
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
else
case "${host}" in
powerpc-*-darwin* )
dnl Some Apple's GCC version are broken and can't handle the
dnl pragmas:
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
;;
*-*-mingw32* )
dnl MinGW GCC versions > 3.2 have problems with
dnl static member of classes derived from templates
dnl in combination with #pragma interface/implementation
dnl (the test case uses 4 files)
dnl ... and with exceptions handling (undefined symbols needed
dnl to correctly calls dtors when unwinding) as well
if test "$wxUSE_STL" = "yes" -o \
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])
case "${host}" in
powerpc-*-darwin* )
dnl Some Apple's GCC version are broken and can't handle the
dnl pragmas:
GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
;;
*-*-mingw32* )
dnl MinGW GCC versions > 3.2 have problems with
dnl static member of classes derived from templates
dnl in combination with #pragma interface/implementation
dnl (the test case uses 4 files)
dnl ... and with exceptions handling (undefined symbols needed
dnl to correctly calls dtors when unwinding) as well
if test "$wxUSE_STL" = "yes" -o \
"$wxUSE_NO_EXCEPTIONS" != "yes" -o \
"$wxUSE_NO_RTTI" != "yes"; then
AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
fi
;;
*-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
if test "$wxUSE_STL" = "yes"; then
AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
fi
;;
esac
AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
fi
;;
*-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
if test "$wxUSE_STL" = "yes"; then
AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA])
AC_TRY_COMPILE([],
[#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
#error "Not GCC 3.2 or greater"
#endif
],
[GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
fi
;;
esac
dnl closing bracket of if GCC < 4.0
] )
fi
fi
CPPFLAGS="$PCH_FLAGS $GCC_PRAGMA_FLAGS $CPPFLAGS"