Re: Compiling Perl from Source
On Fri, 29 Nov 1996, Robyn Renwick wrote:
> 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.
Perl ought to compile just fine on Debian, since I use Debian to test the
perl distribution before I release it. (Of course since no two Debian
systems need be exactly the same, there are always possibilities of
problems, but in practice I just generally track 'unstable' and haven't
had any problems.)
Be careful about the default installation locations, however, since they
are rather generic Unix defaults and not necessarily consistent with
Debian standards. You're best off doing something like
sh Configure -Dprefix=/usr/local -Dlocincpth=/usr/include/db
to keep it all in the /usr/local hierarchy. (The /usr/include/db thing is
needed to pick up <db/db.h>. Someday I'll fix that.)
Alternatively, you can use the Debian installation as a base and do
/usr/bin/perl -e 'use Config; print &Config::config_sh;' > config.sh
to get the standard config.sh parameters, and then hand-edit the
various installation directories.
> 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).
You don't need to add these since the compiler already searches them.
> 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
When compiling from source, these libraries are not required. Configure
automatically figures out what you have and adjusts things accordingly.
> 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.
Dynamic loading ought to work just fine with all the defaults. If it
doesn't, you probably have a problem with your set-up. Send me the
details and I'll try to help you sort it out.
Summary: Perl ought to work nicely on Debian, and you can report it as a
bug to me if it doesn't. If you *do* have problems, many of them are
discussed in the INSTALL file included with the perl distribution.
Note, however, that Debian's perl is quite up-to-date, so there's rarely a
need for you to compile it yourself. You're of course welcome to do so,
Andy Dougherty email@example.com
Dept. of Physics
Lafayette College, Easton PA 18042
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