+dnl Support the old --enable-universal_binary in case anyone was using it.
+#if test "$wxUSE_MAC" = 1; then
+ if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
+ dnl --enable-universal_binary uses a default SDK (currently 10.4u)
+ dnl --enable-universal_binary=SDK names a path to an SDK
+ if test "x$wxUSE_UNIVERSAL_BINARY" == xyes; then
+ # Implicitly turn on the new --with-macosx-sdk using the default
+ # SDK which provides the behavior this option has always had.
+ if test "x$wxUSE_MACOSX_SDK" = "x"; then
+ AC_MSG_WARN([Enabling default SDK due to --enable-universal_binary.])
+ AC_MSG_WARN([If you don't want this, specify --without-macosx-sdk])
+ wxUSE_MACOSX_SDK=yes
+ fi
+ else
+ # Complain to user if he specified an argument to --enable-universal_binary
+ # and also 1) specified --with-macosx-sdk using the default (yes) or
+ # 2) specified --with-macosx-sdk using a path or 3) specified
+ # --without-macosx-sdk (no).
+ if test "x$wxUSE_MACOSX_SDK" != "x" ; then
+ AC_MSG_FAILURE([Please specify the new --with-macosx-sdk=PATH and do not specify an arg to --enable-universal_binary])
+ else
+ # Put the SDK path into the wxUSE_MACOSX_SDK. We don't have to
+ # special-case the empty string because the below test simply
+ # converts "no" to the empty string anyway.
+ wxUSE_MACOSX_SDK="$wxUSE_UNIVERSAL_BINARY"
+ dnl Warn about deprecated usage.
+ AC_MSG_WARN([Please use --with-macosx-sdk=PATH and --enable-universal_binary without an argument])
+ fi
+ fi
+ dnl FIXME: I think it would be better to put this into CC, CXX, and LD rather than the flags.
+ OSX_UNIV_OPTS="-arch ppc -arch i386"
+ CXXFLAGS="$OSX_UNIV_OPTS $CXXFLAGS"
+ CFLAGS="$OSX_UNIV_OPTS $CFLAGS"
+ OBJCXXFLAGS="$OSX_UNIV_OPTS $OBJCXXFLAGS"
+ OBJCFLAGS="$OSX_UNIV_OPTS $OBJCFLAGS"
+ LDFLAGS="$OSX_UNIV_OPTS $LDFLAGS"
+ dnl NOTE: Only the compiler driver needs arch flags. The link editor
+ dnl is incapable of using them but the compiler driver (which we use
+ dnl as LD when building dynamic libraries) uses them to invoke the
+ dnl real ld multiple times. If we moved to libtool -dynamic we would
+ dnl need no arch flags because libtool automatically invokes ld for
+ dnl every architecture found in the fat input files.
+ dnl
+ dnl For static library builds, AR/RANLIB automatically create proper
+ dnl fat archives although AR is unable to update them once RANLIB has
+ dnl made them into proper fat archives. Fortunately, our link process
+ dnl simply removes the .a file before using ar to create a new one.
+ dnl If we did move to libtool -static we still wouldn't need arch flags
+ dnl because libtool automatically figures it out based on input.
+ retest_macosx_linking=yes
+
+ dnl HACK: PCH could be made to work by precompiling for each architecture into separate directories
+ dnl and including all architecture directories with each compiler invocation.
+ dnl That would require a major rework of Bakefile and at the same time it would be nice to have
+ dnl Objective-C++ precompiled headers.
+ AC_MSG_WARN([Disabling precompiled headers due to universal binary build.])
+ bk_use_pch=no
+ fi
+#fi