diff -urN a/Modules/parsermodule.c b/Modules/parsermodule.c --- a/Modules/parsermodule.c 2014-01-22 20:57:29.025591078 +0000 +++ b/Modules/parsermodule.c 2014-01-22 20:57:29.492264948 +0000 @@ -39,7 +39,7 @@ #include "ast.h" #include "pyarena.h" -extern grammar _PyParser_Grammar; /* From graminit.c */ +PyAPI_DATA(grammar) _PyParser_Grammar; /* From graminit.c */ #ifdef lint #include diff -urN a/configure.ac b/configure.ac --- a/configure.ac 2014-01-22 20:57:28.995590616 +0000 +++ b/configure.ac 2014-01-22 20:57:29.488931575 +0000 @@ -313,6 +313,10 @@ # `define_xopen_source' in the case statement below. For the # current supported cross builds, this macro is not adjusted. case "$host" in + *-*-darwin*) + ac_sys_system=Darwin + ac_sys_version=11 + ;; *-*-linux*) ac_sys_system=Linux ;; @@ -369,6 +373,9 @@ *-*-cygwin*|*-*-mingw*) _host_cpu= ;; + *-*-darwin*) + _host_cpu= + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -1172,6 +1179,16 @@ UNIVERSAL_ARCH_FLAGS= AC_SUBST(UNIVERSAL_ARCH_FLAGS) +if test "x$cross_compiling" = xyes; then + function arch + { + echo i386 + } + OSX_ARCH_PROG=arch +else + OSX_ARCH_PROG=/usr/bin/arch +fi + # tweak BASECFLAGS based on compiler and platform case $GCC in yes) @@ -1228,7 +1245,7 @@ # Calculate the right deployment target for this build. # cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'` - if test ${cur_target} '>' 10.2; then + if test ${cur_target} > 10.2; then cur_target=10.3 if test ${enable_universalsdk}; then if test "${UNIVERSAL_ARCHS}" = "all"; then @@ -1248,7 +1265,7 @@ cur_target='10.5' fi else - if test `/usr/bin/arch` = "i386"; then + if test "$($OSX_ARCH_PROG)" = "i386"; then # On Intel macs default to a deployment # target of 10.4, that's the first OSX # release with Intel support. @@ -1912,7 +1929,7 @@ if test "${enable_universalsdk}"; then : else - LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`" + LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only $($OSX_ARCH_PROG)" fi LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; @@ -1937,7 +1954,7 @@ ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes]) if test "${ac_osx_32bit}" = "yes"; then - case `/usr/bin/arch` in + case $($OSX_ARCH_PROG) in i386) MACOSX_DEFAULT_ARCH="i386" ;; @@ -1949,7 +1966,7 @@ ;; esac else - case `/usr/bin/arch` in + case $($OSX_ARCH_PROG) in i386) MACOSX_DEFAULT_ARCH="x86_64" ;; @@ -1988,8 +2005,8 @@ fi AC_MSG_CHECKING(for dyld) -case $ac_sys_system/$ac_sys_release in - Darwin/*) +case $host in + *darwin*) AC_DEFINE(WITH_DYLD, 1, [Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic linker (dyld) instead of the old-style (NextStep) dynamic @@ -2113,7 +2130,7 @@ # Use -undefined dynamic_lookup whenever possible (10.3 and later). # This allows an extension to be used in any Python - if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2 + if test ${MACOSX_DEPLOYMENT_TARGET} > 10.2 then if test "${enable_universalsdk}"; then LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"