Building Perl for UNIX
Bill Hess - bhess@techrg.com
Software Versions used in this Example
- Perl Version = 5.005_03
- OS Version = Solaris 2.6
- Compiler = gcc 2.8.1
Space Requirements
- Source Code for Building ~ 19.6 MB
- Installed after Build ~ 29.2 MB
- Total Space Required for Build and Install ~ 40 MB
Download the latest stable source of Perl from CPAN - www.perl.com
Put the source into a temporary directory, for example:
Reference the /tmp/perl5.003_03/README file for detailed information on compiling
Configure your environment for building
- Type 'sh Configure -Dcc=gcc -Dprefix=/usr/local/perl' while in the
'/tmp/perl5.003_03' directory
- The 'cc' variable points to the compiler to use
- The 'prefix' variable points to the install directory. For this
example '/usr/local/perl' will be used
- You will be asked if you want a link created from /usr/bin/perl to
where you actually install it - accept this since most scripts refer
to #!/usr/bin/perl in the first line
- While the Configure script runs, it will ask many questions -
typicallyaccept the default which is done with a carriage return.
Sometimes it will alert you that a directory does not exist for
installation - in this case just answer 'Y' and continue on...
- If you want to accept all defaults you can type '& -d' at any
prompt and the configuration script will run on its own
Compile the Perl source using the supplied makefile.
- Type 'make' while in the '/tmp/perl5.003_03' directory
Test the build
- Type 'make test' while in the '/tmp/perl5.003_03' directory
- Watch the tests run by and all should get an 'ok' except skipped
tests
- When finished you should get an 'All tests successful' message
Install Perl
- Type 'make install' while in the '/tmp/perl5.003_03' directory
- This will copy all of the necessary files to the install directory
determined from the 'prefix' variable
- This will also generate all of the online Perl documentation
Add the following Perl directories to your PATH environment variable:
You are done - Perl is built and ready to use!!!