[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Compiling Perl from Source



Hi everyone!

I am a second year computer science student working on a debian system. I
recently completed a project where I compiled Perl from the source code.  I
was asked to post my findings here as it may be helpful.  I did quite a long
write-up, which I won't post here, but anyone who has further questions can
email me if they like.

I started with Perl5.003 and used gcc as the compiler.  For the most part,
the default answers were fine as there was support for linux and the
configure used it.  

The first problem I had was not knowing which directories I wanted to use
for library searches..the default was "usr/local/lib" and I had to add
"/lib" and "usr/lib" when prompted to add additional ld flags.  I also had
to add an additional cc flag for the compiler, which was
-I/usr/local/include(the default was -Dbool=char - DHAS_BOOL). 

The biggest problem that I encountered in compiling Perl was with the
libraries. In the Perl that comes with debian, two libraries are required to
be installed on the system, the libdb1 and libgdbm1 packages. To find out if
they are installed, you type 'dpkg -l libdb1 ligdbm1'. If no packages are
found which match, you just install the libdbl library and everything is
fine.  When compiling from source, these libraries are required along with
several others. The libraries which must be present are:

        -libndbm -libgdbm -libdbm -libdb -libdl -libdld -libm -libc

The other decision I had to make was whether to use dynamic loading or
static.  Dynamic loading usually seemed to fail. Static loading can give you
a fall-back position if dynamic loading isn't working, however it doesn't
give you the optimum version of Perl.  However, once the libraries were in
place, I was able to load dynamically.  The loader I used was dl_dlopen.xs.

The last problem was extensions.  Extensions are optional modules which you
can add to Perl.  You can choose which extensions you want and whether you
want all or only some loaded dynamically vs statically.  At first, when I
was having problems I chose "none".  Once I had dynamic loading working, I
chose all extensions to be loaded dynamically.

Once you have gone through the 'configure' section, you are asked if you
want to run 'make depend', the default is 'y'.  If that is successful, you
run 'make test'. If all tests are successful, you can run 'make install',
but you have to be the root to install correctly.  If some of the tests
fail, you can run individual tests from the test directory.  

Lastly, you are given the option to have the documentation in the pod
directory in html format if you like.  I thought that this might be handy
and it is quite simple to do.  From the pod directory, you just type 'make
html' and it is done for you. 

Having done one install from source and learning all the pitfalls, I think
it would be quite a simple matter to install Perl on another Debian system.
When I did the actual install (I experimented first in my home directory),
it took about 15-20 minutes.

take care, 
robynr    


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: