davemessina.com

May 23, 2007

Updating perl 5.8.8 on OS X

Filed under: OS X, howto, perl, programming — Dave @ 6:09 pm

382039671_67a744fb4d_m.jpgDespite what I’ve read before, installing the current stable version under OS X is no longer a big deal. By default, everything is installed under /usr/local/ so it won’t clobber Apple’s perl 5.8.6, which can be found in /usr/. And it compiles cleanly, too.

The included instructions are pretty straightforward but long, so to cut to the chase:

1. Download perl 5.8.8. Unpack as usual and enter that directory.

	% tar zxf perl-5.8.8.tar.gz
	% cd perl-5.8.8

2. Run the included configuration script with a bunch of flags. Hint: swipe each line separately, building one long command line, rather than grabbing all 6 lines in one go.

	% ./Configure -Accflags="-nostdinc
	-B/Developer/SDKs/MacOSX10.4u.sdk/usr/include/gcc
	-B/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc
	-isystem/Developer/SDKs/MacOSX10.4u.sdk/usr/include
	-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks"
	-Aldflags="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" -de

3. Take a quick peek at the resulting settings to make sure everything’s kosher. I just scrolled up in my terminal window, but you can look in config.sh, too.

4. make, make test, make install as usual.

5. That’s it — you’re done! You can verify that your new installation is now your default perl.

	% which perl
	/usr/local/bin/perl
	% perl --version

	This is perl, v5.8.8 built for darwin-2level
	[...etc...]

If your results are different, make sure that /usr/local/bin is before /usr/bin in your path.

Photo by Laughing Squid

Technorati Tags:
, , ,

Powered by WordPress