Why -O and -g in universal variants?

Cédric Luthi cedric.luthi at gmail.com
Sun Feb 25 02:06:54 PST 2007


On 2/25/07, Ryan Schmidt <ryandesign at macports.org> wrote:
> http://trac.macports.org/projects/macports/changeset/22269
>
> Why are -O and -g being used in the universal variant?

Probably because the author copy-pasted the Technical Note TN2137
<http://developer.apple.com/technotes/tn2005/tn2137.html> example ;-)

By the way, this technical note also says:
"Note: On an Intel-based Macintosh system the libraries are already
universal, and support the Intel and PowerPC architectures, and you
may specify only the -arch i386 -arch ppc options for CFLAGS; on a
PowerPC-based Macintosh, you must use the MacOSX10.4u SDK"

If I remember correctly from the tests I did some time ago, "you may
specify only" should read "you must specify only". Specifying the
isysroot on Intel Macs would fail the compilation!

So this command:
env CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
ppc" LDFLAGS="-arch i386 -arch ppc" ./configure ...

would work on PPC Macs but would fail on Intel Macs.

As I'm not on an Intel Mac right now, I can't test. Can anyone confirm this ?



More information about the macports-dev mailing list