Re: Universal build of cranky open source lib with a configure script
Re: Universal build of cranky open source lib with a configure script
- Subject: Re: Universal build of cranky open source lib with a configure script
- From: Bill Northcott <email@hidden>
- Date: Fri, 26 Jan 2007 11:05:48 +1100
On 25/01/2007, at 8:28 PM, Peter wrote:
On Jan 25, 2007, at 5:01 AM, Shamyl Zakariya wrote:
I'm trying to build a ppc lib from my intel mac, so I can lipo it
together with the intel lib. I've read a few docs off ADC which
gave me the general idea to build it twice, once native, the other
for ppc. The instructions given may work in some places, but they
don't seem to be working for me to build a universal library of ODE
( Open Dynamics Engine )
I've tried the approach from Technote 2137, where I set the CFLAGS
and LDFLAGS to result in a universal build, but that doesn't work
-- the compile fails arguing that the cpu types don't add up right.
Don't set --host or --build etc.
./configure .... CFLAGS='-Os -arch ppc -arch i386 -isysroot /
Developer/SDks/MacOSX10.4u.sdk' CXXFLAGS='-Os -arch ppc -arch i386 -
isysroot /Developer/SDks/MacOSX10.4u.sdk' LDFLAGS='-arch ppc -arch
i386 -isysroot /Developer/SDks/MacOSX10.4u.sdk'; make
should just work. If not, please send me the relevant chunk of build
log.
First a trivial observation. I don't think you need the -isysroot
stuff if building on an Intel Mac unless you want to build ppc64
code. Installed libraries on Intel Mac's are i386/ppc fat to support
ppc code under Rosetta. It is of course needed on a ppc Mac.
This approach does not always work for me. The problem is with GNU
libtool stripping the arch options out of the link command to the
compiler driver. I have found in at least one such case I could
build by defining the compilers rather than the flags:
CC='gcc -arch ppc i386'
CXX='gxx -arch ppc i386' etc.
If you want an example try the cvs code for JAGS from
cvs -d:pserver:email@hidden:/cvsroot/mcmc-
jags login
cvs -z3 -d:pserver:email@hidden:/cvsroot/
mcmc-jags co -P JAGS
If you set the xxFLAGS as above (you will need the fortran compiler
from the R binary and define F77) then do a standard ./configure/
make, you will fail because the libraries will be built i386 only and
will not link the fat object files. Add the arch options to the
compiler envars and it works.
If you check the build output you will see that the arch options are
in the link mode invocation of libtool but are missing from the
resulting gxx compiler driver command. Libtool does not attempt to
change the defined driver command.
Bill Northcott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden