Add flag to enable specifying an architecture to build on Mac. Also add x86_64 architecture to universal build when buildng wxOSX-Cocoa

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-09-23 20:54:54 +00:00
parent da7ae3570a
commit 80367c29a9
2 changed files with 79 additions and 30 deletions

View File

@@ -398,6 +398,7 @@ DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
dnl Mac/Cocoa users need to enable building universal binaries explicitly
DEFAULT_wxUSE_UNIVERSAL_BINARY=no
DEFAULT_wxUSE_MAC_ARCH=no
DEFAULT_wxUSE_OFFICIAL_BUILD=no
@@ -717,7 +718,9 @@ WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++
WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
WX_ARG_DISABLE(vararg_macros,[ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS)
WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary create Mac PowerPC and Intel Universal binary]], wxUSE_UNIVERSAL_BINARY)
WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary create universal binary with Mac PPC and i386 (and x86_64 if using Cocoa) architectures ]], wxUSE_UNIVERSAL_BINARY)
WX_ARG_ENABLE_PARAM(macosx_arch, [[ --enable-macosx_arch=ARCH build for just the specified architecture]], wxUSE_MAC_ARCH)
WX_ARG_ENABLE(compat26, [ --enable-compat26 enable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6)
WX_ARG_DISABLE(compat28, [ --disable-compat28 disable wxWidgets 2.8 compatibility], WXWIN_COMPATIBILITY_2_8)
@@ -1116,6 +1119,11 @@ if test "$wxUSE_MAC" = 1; then
retest_macosx_linking=no
OSX_ARCH_OPTS=""
if test "x$wxUSE_MAC_ARCH" != xno; then
OSX_ARCH_OPTS="-arch $wxUSE_MAC_ARCH"
fi
dnl Support the old --enable-universal_binary in case anyone was using it.
if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then
dnl --enable-universal_binary uses a default SDK (currently 10.4u)
@@ -1145,12 +1153,13 @@ dnl Support the old --enable-universal_binary in case anyone was using it.
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"
OSX_ARCH_OPTS="-arch ppc -arch i386"
if test "$wxUSE_OSX_COCOA" = 1; then
OSX_ARCH_OPTS="$OSX_ARCH_OPTS -arch x86_64"
fi
AC_MSG_CHECKING([for universal binary architectures])
AC_MSG_RESULT([$OSX_ARCH_OPTS])
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
@@ -1174,6 +1183,12 @@ dnl Support the old --enable-universal_binary in case anyone was using it.
bk_use_pch=no
fi
CXXFLAGS="$OSX_ARCH_OPTS $CXXFLAGS"
CFLAGS="$OSX_ARCH_OPTS $CFLAGS"
OBJCXXFLAGS="$OSX_ARCH_OPTS $OBJCXXFLAGS"
OBJCFLAGS="$OSX_ARCH_OPTS $OBJCFLAGS"
LDFLAGS="$OSX_ARCH_OPTS $LDFLAGS"
dnl Set up the Mac OS X SDK. We do this early so configure tests will occur
dnl with the SDK in place.
dnl NOTE: We clobber wxUSE_MACOSX_SDK with the SDK path