How-to: Compile Perl 5.6.1

scope

Registered
First of all, you need to have the Apple Developers Tools 10.1 installed. Okay, here we go. Remember, whenever I have something in quotes, it means that's what you type, no quotes included. Make sure you look through the whole How-to before you actually do it, otherwise you may accidentally mess something up.

1.) Download the latest stable release of Perl, which is currently 5.6.1. You can get it from http://www.perl.com/CPAN-local/src/stable.tar.gz

2.) Open a new terminal window (/Applications/Utilities/Terminal), and go to your Desktop. (Usually just "cd Desktop")

3.) After that type:
Code:
tar zxvf stable.tar.gz
This will expand the archive for you.

4.) Now, type
Code:
cd perl-5.6.1

5.) First, we must set a few variables to get the thing to configure and install right. Type the following lines, one at a time:
Code:
setenv LC_ALL C
setenv LANG "en_US
perl -i.bak -p -e 's|Local/Library|Library|g' hints/darwin.sh

6.) Now that we have that done, it's time to configure.
Code:
sh Configure -des -Dfirstmakefile=GNUmakefile -Dldflags="-flat_namespace"

7.) After that:
Code:
make
and the optional
Code:
make test

8.) Now, before going through with the install, we have to move a file:
Code:
mv INSTALL INSTALL.txt
we do this so that when you type "make install," it won't attempt to make INSTALL

9.) And now
Code:
sudo make install

That should do it. If you decide to do the make test, a few of them will fail. Don't worry about this. Some of them just plain won't work on Darwin. That should do it. If you want to see which version of Perl you have, just type:
Code:
perl -v
into the Terminal.
 
You can skip over setting the environment variables by using:

perl -i.bak -p -e 's|Local/Library|Library|g' hints/darwin.sh
echo d_setlocale = undef >>hints/darwin.sh

Just replace undef with a locale you want to use or leave it, if you don't want to use locales.
 
Back
Top