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

Problems compiling perl 5.004.04 - ld: cannot open -lnsl



I am trying to compile perl 5.004.04 and am having problems.  My
compiler is unable to locate -lnsl (for some reason).  But I'm sure that
the reqd library is in /lib -

$ cd /lib
$ ls -l *nsl*
-rwxr-xr-x   1 root     root        17448 Jun  5  1997 libnsl-2.0.4.so*
lrwxrwxrwx   1 root     root           15 Aug  5 19:43 libnsl.so.1 ->
libnsl-2.0.4.so*


Also, 

$ ldconfig -p | grep nsl
        95 - ELF libnsl.so.1 => /lib/libnsl.so.1
        96 - ELF libnsl.so.1 => /lib/libnsl.so.1

And -

$ more /etc/ld.so.conf
/usr/X11R6/lib/Xaw3d
/usr/local/lib
/usr/lib/i486-linuxaout
/usr/X11R6/lib
/usr/X11R5/lib
/usr/X11R6/lib/i486-linuxaout
/lib
/usr/local/pgsql/lib


I have attached the typescript of my session trying to run perl's
configure script.  Any help would be appreciated.  I know.  I know.  I
could just upgrade to hamm.  I just don't want to loose the stability of
my current system in the middle of the week.


Thaths

-- 
"To vacillate or not to vacillate, that is the question ... or is it?"
Sudhakar C13n                                       (650) 937-2354 (O)
International Websites Engineer                     (650) 940-1896 (H)
                 http://people.netscape.com/thaths/
Script started on Thu Dec  4 10:53:25 1997
beetle ~/tmp/perl5.004_04# ]0; beetle ~/tmp/perl5.004_04sh Configure
 
 
Beginning of configuration questions for perl5.
 
Checking echo to see how to suppress newlines...
...using -n.
The star should be here-->*
 
First let's make sure your kit is complete.  Checking...
Looks good...
 
This installation shell script will examine your system and ask you questions
to determine how the perl5 package should be installed. If you get
stuck on a question, you may use a ! shell escape to start a subshell or
execute a command.  Many of the questions will have default answers in square
brackets; typing carriage return will give you the default.

On some of the questions which ask for file or directory names you are allowed
to use the ~name construct to specify the login directory belonging to "name",
even if you don't have a shell which knows about that.  Questions where this is
allowed will be marked "(~name ok)".

[Type carriage return to continue] 

The prompter used in this script allows you to use shell variables and
backticks in your answers.  You may use $1, $2, etc...  to refer to the words
in the default answer, as if the default line was a set of arguments given to a
script shell.  This means you may also use $* to repeat the whole default line,
so you do not have to re-type everything to add something to the default.

Everytime there is a substitution, you will have to confirm.  If there is an
error (e.g. an unmatched backtick), the default answer will remain unchanged
and you will be prompted again.

If you are in a hurry, you may run 'Configure -d'.  This will bypass nearly all
the questions and use the computed defaults (or the previous answers if there
was already a config.sh file). Type 'Configure -h' for a list of options.
You may also start interactively and then answer '& -d' at any prompt to turn
on the non-interactive behavior for the remainder of the execution.

[Type carriage return to continue] 

Much effort has been expended to ensure that this shell script will run on any
Unix system.  If despite that it blows up on yours, your best bet is to edit
Configure and run it again.  If you can't run Configure for some reason,
you'll have to generate a config.sh file by hand.  Whatever problems you
have, let me (chip@perl.com) know how I blew it.

This installation script affects things in two ways:

1) it may do direct variable substitutions on some of the files included
   in this kit.
2) it builds a config.h file for inclusion in C programs.  You may edit
   any of these files as the need arises after running this script.

If you make a mistake on a question, there is no easy way to back up to it
currently.  The easiest thing to do is to edit config.sh and rerun all the SH
files.  Configure will offer to let you do this before it runs the SH files.

[Type carriage return to continue] 
 
Locating common programs...
awk is in /usr/bin/awk.
cat is in /bin/cat.
comm is in /usr/bin/comm.
cp is in /bin/cp.
echo is in /bin/echo.
expr is in /usr/bin/expr.
find is in /usr/bin/find.
grep is in /usr/bin/grep.
ls is in /bin/ls.
mkdir is in /bin/mkdir.
rm is in /bin/rm.
sed is in /bin/sed.
sort is in /usr/bin/sort.
touch is in /usr/bin/touch.
tr is in /usr/bin/tr.
uniq is in /usr/bin/uniq.
 
Don't worry if any of the following aren't found...
I don't see Mcc out there, offhand.
I don't see byacc out there, either.
cpp is in /usr/bin/cpp.
csh is in /bin/csh.
date is in /bin/date.
egrep is in /usr/bin/egrep.
gzip is in /bin/gzip.
less is in /usr/bin/less.
I don't see line out there, either.
ln is in /bin/ln.
more is in /bin/more.
nroff is in /usr/bin/nroff.
perl is in /usr/bin/perl.
I don't see pg out there, either.
sendmail is in /usr/sbin/sendmail.
test is in /usr/bin/test.
uname is in /bin/uname.
zip is in /usr/bin/zip.
Using the test built into your sh.
 
Checking compatibility between /bin/echo and builtin echo (if any)...
They are compatible.  In fact, they may be identical.
 
Symbolic links are supported.
 
Good, your tr supports [:lower:] and [:upper:] to convert case.

First time through, eh?  I have some defaults handy for the following systems:

3b1   		dynixptx   	isc   		next_4   	sunos_4_0   
aix   		epix   		isc_2   	opus   		sunos_4_1   
altos486   	esix4   	linux   	os2   		svr4   
amigaos   	fps   		lynxos   	os390   	ti1500   
apollo   	freebsd   	machten   	powerux   	titanos   
aux_3   	genix   	machten_2   	qnx   		ultrix_4   
bsdos   	greenhills   	mips   		sco   		umips   
convexos   	hpux   		mpc   		sco_2_3_0   	unicos   
cxux   		i386   		mpeix   	sco_2_3_1   	unicosmk   
cygwin32   	irix_4   	ncr_tower   	sco_2_3_2   	unisysdynix   
dcosx   	irix_5   	netbsd   	sco_2_3_3   	utekv   
dec_osf   	irix_6   	newsos4   	sco_2_3_4   	uts   
dgux   		irix_6_0   	next_3   	solaris_2   
dynix   	irix_6_1   	next_3_0   	stellar   

You may give one or more space-separated answers, or "none" if appropriate.
If your OS version has no hints, DO NOT give a wrong version -- say "none".

Which of these apply, if any? [linux] 

You appear to have ELF support.  I'll try to use it for dynamic loading.
If dynamic loading doesn't work, read hints/linux.sh for further information.

You appear to have a working bash.  Good.
Your csh is really tcsh.  Good.

Configure uses the operating system name and version to set some defaults.
The default value is probably right if the name rings a bell. Otherwise,
since spelling matters for me, either accept the default or answer "none"
to leave it blank.

Operating system name? [linux] 
 
Operating system version? [2.0.31] 
 
What is your architecture name [i686-linux] 
 
AFS does not seem to be running...

By default, perl5 will be installed in /usr/bin, manual
pages under /usr/man, etc..., i.e. with /usr as prefix for
all installation directories. Typically set to /usr/local, but you
may choose /usr if you wish to install perl5 among your system
binaries. If you wish to have binaries under /bin but manual pages
under /usr/local/man, that's ok: you will be prompted separately
for each of the installation directories, the prefix being only used
to set the defaults.

Installation prefix to use? (~name ok) [/usr] 

There are some auxiliary files for perl5 that need to be put into a
private library directory that is accessible by everyone.

Pathname where the private library files will reside? (~name ok)
[/usr/lib/perl5] 
 
Getting the current patchlevel...
(You have perl5 5.0 patchlevel 4 subversion 4.)

Perl5 contains architecture-dependent library files.  If you are
sharing libraries in a heterogeneous environment, you might store
these files in a separate location.  Otherwise, you can just include
them with the rest of the public library files.

Where do you want to put the public architecture-dependent libraries? (~name ok)
[/usr/lib/perl5/i686-linux/5.00404] 

Perl 5.004 can be compiled for binary compatibility with 5.003.
If you decide to do so, you will be able to continue using any
extensions that were compiled for Perl 5.003.  However, binary
compatibility forces Perl to expose some of its internal symbols
in the same way that 5.003 did.  So you may have symbol conflicts
if you embed a binary-compatible Perl in other programs.

Binary compatibility with Perl 5.003? [y] 
 
Hmm...  Looks kind of like a Version 7 system, but we'll see...
 
Congratulations.  You aren't running Eunice.
 
It's not Xenix...
 
Nor is it Venix...

Some kernels have a bug that prevents setuid #! scripts from being
secure.  Some sites have disabled setuid #! scripts because of this.

First let's decide if your kernel supports secure setuid #! scripts.
(If setuid #! scripts would be secure but have been disabled anyway,
don't say that they are secure if asked.)

If you are not sure if they are secure, I can check but I'll need a
username and password different from the one you are using right now.
If you don't have such a username or don't want me to test, simply
enter 'none'.

Other username to test security of setuid scripts with? [none] 
Well, the recommended value is *not* secure.
Does your kernel have *secure* setuid scripts? [n] 
 
Some systems have disabled setuid scripts, especially systems where
setuid scripts cannot be secure.  On systems where setuid scripts have
been disabled, the setuid/setgid bits on scripts are currently
useless.  It is possible for perl5 to detect those bits and emulate
setuid/setgid in a secure fashion.  This emulation will only work if
setuid scripts have been disabled in your kernel.

Do you want to do setuid/setgid emulation? [n] 

The installation process will also create a directory for
site-specific extensions and modules.  Some users find it convenient
to place all local files in this directory rather than in the main
distribution directory.

Pathname for the site-specific library files? (~name ok)
[/usr/lib/perl5/site_perl] 

The installation process will also create a directory for
architecture-dependent site-specific extensions and modules.

Pathname for the site-specific architecture-dependent library files? (~name ok)
[/usr/lib/perl5/site_perl/i686-linux] 

In 5.001, Perl stored architecture-dependent library files in a directory
with a name such as /usr/lib/perl5/i686-linux, 
and this directory contained files from the standard extensions and 
files from any additional extensions you might have added.  Starting 
with version 5.002, all the architecture-dependent standard extensions 
will go into a version-specific directory such as
/usr/lib/perl5/i686-linux/5.00404, 
while locally-added extensions will go into
/usr/lib/perl5/site_perl/i686-linux.

If you wish Perl to continue to search the old architecture-dependent
library for your local extensions, give the path to that directory.
If you do not wish to use your old architecture-dependent library
files, answer 'none'.

Directory for your old 5.001 architecture-dependent libraries? (~name ok)
[none] 
 
Pathname where the public executables will reside? (~name ok) [/usr/bin] 
 
System manual is in /usr/man/man1.
 
Some systems have different model sizes.  On most systems they are called
small, medium, large, and huge.  On the PDP11 they are called unsplit and
split.  If your system doesn't support different memory models, say "none".
If you wish to force everything to one memory model, say "none" here and
put the appropriate flags later when it asks you for other cc and ld flags.
Venix systems may wish to put "none" and let the compiler figure things out.
(In the following question multiple model names should be space separated.)

Which memory models are supported? [none] 
 
Use which C compiler? [cc] 
 
Checking for GNU cc in disguise and/or its version number...
You are using GNU cc 2.7.2.1.
 
Hmm...  Doesn't look like a MIPS system.
 

Some systems have incompatible or broken versions of libraries.  Among
the directories listed in the question below, please remove any you
know not to be holding relevant libraries, and add any that are needed.
Say "none" for none.

Directories to use for library searches? [/usr/local/lib /lib /usr/lib] 

On some systems, shared libraries may be available.  Answer 'none' if
you want to suppress searching of shared libraries for the remaining
of this configuration.

What is the file extension used for shared libraries? [so] 
 
Checking for optional libraries...
No -lsfio.
No -lnet.
No -lsocket.
No -linet.
Found -lnsl (shared).
No -lnm.
Found -lndbm (shared).
Found -lgdbm (shared).
Found -ldbm (shared).
Found -ldb (shared).
No -lmalloc.
Found -ldl (shared).
No -ldld.
No -lld.
No -lsun.
Found -lm (shared).
Found -lc (shared).
No -lcposix.
No -lposix.
No -lndir.
No -ldir.
Found -lcrypt (shared).
No -lucb.
No -lBSD.
No -lPW.
No -lx.
 
Some versions of Unix support shared libraries, which make executables smaller
but make load time slightly longer.

On some systems, mostly System V Release 3's, the shared library is included
by putting the option "-lc_s" as the last thing on the cc command line when
linking.  Other systems use shared libraries by default.  There may be other
libraries needed to compile perl5 on your machine as well.  If your system
needs the "-lc_s" option, include it here.  Include any other special libraries
here as well.  Say "none" for none.
 
Any additional libraries?
[-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt] 
 
Now, how can we feed standard input to your C preprocessor...
Maybe "cc -E" will work...
Nope...maybe "cc -E -" will work...
Yup, it does.

Some C compilers have problems with their optimizers.  By default, perl5
compiles with the -O flag to use the optimizer.  Alternately, you might want
to use the symbolic debugger, which uses the -g flag (on traditional Unix
systems).  Either flag can be specified here.  To use neither flag, specify
the word "none".

What optimizer/debugger flag should be used? [-O2] 

Your C compiler may want other flags.  For this question you should include
-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
but you should NOT include libraries or ld flags like -lwhatever.  If you
want perl5 to honor its debug switch, you should include -DDEBUGGING here.
Your C compiler might also need additional flags, such as -D_POSIX_SOURCE,
-DHIDEMYMALLOC or -DCRIPPLED_CC.

To use no flags, specify the word "none".

Any additional cc flags? [-Dbool=char -DHAS_BOOL -I/usr/local/include] 
 
Let me guess what the preprocessor flags are...
They appear to be: -Dbool=char -DHAS_BOOL -I/usr/local/include

Your C linker may need flags.  For this question you should
include -L/whatever and any other flags used by the C linker, but you
should NOT include libraries like -lwhatever.

Make sure you include the appropriate -L/path flags if your C linker
does not normally search all of the directories you specified above,
namely
	/usr/local/lib /lib /usr/lib
To use no flags, specify the word "none".

Any additional ld flags (NOT including libraries)? [ -L/usr/local/lib] 
 
Checking your choice of C compiler, libs, and flags for coherency...
I've tried to compile and run a simple program with:

	cc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include -L/usr/local/lib -o try try.c -lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt
	./try

and I got the following output:

ld: cannot open -lnsl: No such file or directory
I can't compile the test program.
(The supplied flags might be incorrect with this C compiler.)
 
You have a BIG problem.  Shall I abort Configure (and explain the problem)
[y] y
Ok.  Stopping Configure.
beetle ~/tmp/perl5.004_04# ]0; beetle ~/tmp/perl5.004_04exit

Script done on Thu Dec  4 10:54:49 1997

Reply to: