Hey folks, just sharing a data point -- how I compiled my own Perl and
then my own wxWidgets and wxPerl on Snow Leopard, making them
backwards-compatible to Leopard (hopefully, haven't had a chance to
test that yet).

>From here:

http://wiki.wxwidgets.org/Development:_wxMac#Building_under_10.6_Snow_Leopard

I learned that wxWidgets on Snow Leopard doesn't work as a 64-bit
build, you have to build it as 32-bits only.  This is just as well
since I wanted a build that was portable to Leopard anyway.  I
followed their instructions and compiled it this way:

-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5

I also set the prefix to /opt/d3/wx.  That happens to be where I want
this stuff.

I modified my PATH to include /opt/d3/wx/bin so that I would pick up
that wx-config command.

I ran into a lot of trouble with my first build of Perl because it was
64-bit and wouldn't play nice with my newly built 32-bit wxWidgets
when I tried to install Wx, so I had to start over and make a 32-bit
perl (again, that's what I really wanted anyway cause I wanted this
usable on older Intel machines running Leopard).  I had a hard time
figuring out how to build a thoroughly 32-bit perl on snow leopard.
After a fair amount of trial and error and reading the README.macosx I
came up with this (note that I'm installing it to /opt/d3/perl):

export MACOSX_DEPLOYMENT_TARGET=10.5; export
SDK=/Developer/SDKs/MacOSX10.5.sdk/; ./Configure -Dld='env
MACOSX_DEPLOYMENT_TARGET=10.5 gcc' -Darch=i386 -Accflags="-arch i386
-nostdinc -B$SDK/usr/include/gcc -B$SDK/usr/lib/gcc
-isystem$SDK/usr/include -F$SDK/System/Library/Frameworks"
-Aldflags="-arch i386 -Wl,-syslibroot,$SDK" -Dprefix=/opt/d3/perl
-Alddlflags="-arch i386" -Dld="env MACOSX_DEPLOYMENT_TARGET=10.5 cc"
-de

once I installed it I updated my PATH, so now it starts with
/opt/d3/wx/bin and /opt/d3/wx/bin.

When building stuff using CPAN I occasionally ran into trouble with
architecture clashes.  I ended up writing a little script that
aggressively set all the env variables I could think of to guarantee
that we used my chosen SDK for everything, and sourcing it before
doing any cpan install work:

export MACOSX_DEPLOYMENT_TARGET=10.5
export SDK=/Developer/SDKs/MacOSX10.5.sdk/
export LD='env MACOSX_DEPLOYMENT_TARGET=10.5 gcc'
export CCFLAGS="-arch i386 -nostdinc -B$SDK/usr/include/gcc
-B$SDK/usr/lib/gcc -isystem$SDK/usr/include
-F$SDK/System/Library/Frameworks"
export LDFLAGS="-arch i386 -Wl,-syslibroot,$SDK"
export LDDLFLAGS="-arch i386"
export LD="env MACOSX_DEPLOYMENT_TARGET=10.5 cc"

With all that done, I was able to install Alien::wxWidgets from
source; it found /opt/d3/wx/bin/wx-config in my path, and I told it to
use that.

Then I was able to install Wx from source; I disabled stc because I
hadn't built it.

This recipe may or may not fill anyone else's needs but it seems to
have worked out neatly for me, and hopefully it'll save somebody else
some time.

Ed Heil
e...@donor.com

Reply via email to