[Pythonmac-SIG] building universal binaries

bear bear42 at code-bear.com
Fri Jan 27 04:22:57 CET 2006

Ronald Oussoren wrote:
> That part is easy enough. If you want a framework build you'll have to 
> patch Makefile.pre.in because it contains a hardcoded '-arch ppc' in 
> the section that builds that actual framework. Otherwise it should 
> just build (assuming you have an intel mac of course, cross-building 
> from PPC to Intel will be hard because the build process assumes 
> you'll do a native build).
ok, I found the relevant part in configure (and cofigure.in) that was 
putting -arch_only ppc into the Makefile and I've re-run configure and 
it seems happy - heck, even the compiling ran error free.

But when it got to the link part - I get the following error:

ranlib libpython2.4.a
/usr/bin/install -c -d -m 755 Python.framework/Versions/2.4
libtool -o Python.framework/Versions/2.4/Python -dynamic  libpython2.4.a \
         -lSystem -lSystemStubs -install_name
-compatibility_version 2.4 -current_version 2.4
ld64 failed: in libpython2.4.a(__.SYMDEF), not a valid ppc64 mach-o file
libtool: internal link edit command failed
make: *** [Python.framework/Versions/2.4/Python] Error 1

I must be missing something very basic.  The following is a small script 
I've been using to test with:

export SDK=/Developer/SDKs/MacOSX10.4u.sdk
export TARGET_ARCH="" #" -arch i386 -arch ppc"
export LDFLAGS="-L${PREFIX}/lib -isysroot ${SDK} ${TARGET_ARCH}"
export PREFIX=/Users/bear/projects/release

cd /Users/bear/projects/Python-2.4.2/build_release

    CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}" \
    ../configure --prefix=${PREFIX} \
                 --enable-framework=${PREFIX}/Library/Frameworks \
                 --with-readline=${PREFIX}/lib \
                 --disable-ipv6 \

MACOSX_DEPLOYMENT_TARGET=10.4 make frameworkinstallframework

any clues or thoughts appreciated

-- bear

More information about the Pythonmac-SIG mailing list