perl compile error in chapter 5 of lfs 5.1-pre2

JP capn_shoe at
Fri May 14 17:02:08 PDT 2004

When I try to compile perl in chapter 5 of lfs 5.1-pre2 i get the 
following error:

cannot find -lgdbm
collect2: ld returned 1 exit status
I can't compile the test program.
You have a BIG problem.  Shall I abort Configure [y]
Ok.  Stopping Configure.

It seems perl is trying to link against the, which is on the 
host system, but not the lfs system.  I have tried to compile it several 
times, unpacking and patching the source fresh each time.

What's going on? Is this some mess up with the toolchain, or something 
freaky with perl?  Oh, yeah, I am running the uname hack on a vmware 
redhat 9 install so this will run on an old pentium classic as a router.

the entire output of configure.gnu is below:

lfs:/mnt/lfs/src/perl-5.8.4$ patch -Np1 -i ../perl-5.8.4-libc-1.patch
patching file hints/
Hunk #1 succeeded at 51 with fuzz 1.
Hunk #2 succeeded at 314 (offset 32 lines).
lfs:/mnt/lfs/src/perl-5.8.4$ arch
lfs:/mnt/lfs/src/perl-5.8.4$ ./configure.gnu --prefix=/tools 
-Dstatic_ext='IO Fcntl POSIX'
sh Configure -ds -e -Dprefix=/tools -Dstatic_ext=IO Fcntl POSIX
First let's make sure your kit is complete.  Checking...
Locating common programs...
Checking compatibility between /tools/bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
Your builtin 'test -h' may be broken.
Trying external '/tools/bin/test -h'.
You can test for symbolic links with '/tools/bin/test -h'.
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
3b1          dos_djgpp      isc_2         os2           svr4
aix          dynix          linux         os390         svr5
aix_3        dynixptx       lynxos        os400         ti1500
aix_4        epix           machten       posix-bc      titanos
altos486     esix4          machten_2     powerux       ultrix_4
amigaos      fps            mint          qnx           umips
apollo       freebsd        mips          rhapsody      unicos
atheos       genix          mpc           sco           unicosmk
aux_3        gnu            mpeix         sco_2_3_0     unisysdynix
beos         greenhills     ncr_tower     sco_2_3_1     utekv
bsdos        hpux           netbsd        sco_2_3_2     uts
convexos     i386           newsos4       sco_2_3_3     uwin
cxux         irix_4         next_3        sco_2_3_4     vmesa
cygwin       irix_5         next_3_0      solaris_2     vos
darwin       irix_6         next_4        stellar
dcosx        irix_6_0       nonstopux     sunos_4_0
dec_osf      irix_6_1       openbsd       sunos_4_1
dgux         isc            opus          super-ux
Which of these apply, if any? [redhat9-virtual]
hint to use instead? [redhat9-virtual]
Operating system name? [redhat9-virtual]
Operating system version? [none]
Build Perl for SOCKS? [n]
Use the PerlIO abstraction layer? [y]
Build a threading Perl? [n]
Build Perl for multiplicity? [n]
Use which C compiler? [cc]
Checking for GNU cc in disguise and/or its version number...
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches? [/usr/local/lib /lib /usr/lib]
What is the file extension used for shared libraries? [so]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to use? [-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lbsd]
What optimizer/debugger flag should be used? [-O]
Any additional cc flags? [-fno-strict-aliasing -I/usr/local/include]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:

#include <stdio.h>
int main() { printf("Ok\n"); return(0); }

I used the command:

         cc -o try -O -fno-strict-aliasing -I/usr/local/include 
try.c -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lbsd

and I got the following output:

cannot find -lgdbm
collect2: ld returned 1 exit status
I can't compile the test program.
You have a BIG problem.  Shall I abort Configure [y]
Ok.  Stopping Configure.

More information about the lfs-support mailing list