- AC_CHECK_PROGS(OSX_SW_VERS, sw_vers)
- if test "$OSX_SW_VERS" != ""; then
- OSX_VERSION=`sw_vers -productVersion | grep 10.[[0-9]]`
- else
- dnl can't determine it (happens e.g. when cross-compiling) so use a
- dnl conservative default
- AC_MSG_WARN([Assuming OS X 10.4, use --with-macosx-version-min to override.])
- OSX_VERSION="10.4"
- fi
-
- case "$OSX_VERSION" in
- 10.4* )
- wxUSE_MACOSX_VERSION_MIN=10.4
- ;;
-
- * )
- if test "$wxUSE_OSX_CARBON" = 1; then
- # otherwise configure stops on leopard for universal_binary
- wxUSE_MACOSX_VERSION_MIN=10.4
- else
- # for Cocoa, use 10.5 to be able to compile it in 64 bits too
- wxUSE_MACOSX_VERSION_MIN=10.5
- fi
- ;;
- esac
-fi
-
-NEEDS_GCC40="no"
-if test "x$wxUSE_MACOSX_VERSION_MIN" == "x10.4"; then
- NEEDS_GCC40="yes"
-fi
-
-if test "$wxUSE_OSX_CARBON" = 1; then
- NEEDS_GCC40="yes"
-fi
-
-if test "x$NEEDS_GCC40" == "xyes"; then
- # gcc 4.2 cannot compile 10.4 compatible code, so if the user is using it
- # and wants 10.4 compatible code, then 'downgrade' to 4.0
- # This is also the simplest way to get 32-bit binaries on Snow Leopard.
- if test "x$CC" = "xgcc"; then
- CCVERSION=`$CC --version | grep 4.[[2-9]].`
- if test "x$CCVERSION" != "x"; then
- echo "$as_me:$LINENO: WARNING: gcc >= 4.2 cannot compile 10.4 compatible code. Using gcc 4.0 instead."
- CC="gcc-4.0"
- fi
- fi
-
- if test "x$CXX" = "xg++"; then
- CCVERSION=`$CXX --version | grep 4.[[2-9]].`
- if test "x$CCVERSION" != "x"; then
- CXX="g++-4.0"
- fi
- fi