Subject: libslang need to be linked with -ldl for Linux?
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 12/23/2003 09:42:36
After I got rid of the check in libslang for Debian and ltermcap[1],
devel/libslang appeared to build and install fine.

But when building jed or xjed, I get:

cc -g -I/usr/include -fno-strength-reduce  -I/usr/include  -I/usr/include
-Dunix -DJED   -L/usr/lib -Wl,-R/usr/lib
/scratch/pkgsrc/editors/jed/work.puget/jed-0.99-16/src/chkslang.c -o
-L/usr/lib -Wl,-R/usr/lib  -lslang    -lutil  -lm
undefined reference to `dlerror'
undefined reference to `dlclose'
undefined reference to `dlopen'

-ldl is used for building ELF objects, but
/scratch/pkgsrc/devel/libslang/work.puget/slang-1.4.9/src/elfobjs was
never created.

At end of configure, it says: "On ELF systems, type 'make elf' to create
ELF shared library." So I did this. (And it was linked to -ldl.) And end
of make says: "Use make install-elf to install it." And I did that too.

(Now jed failed to build because it assumed -ltermcap. So I removed that
reference for xjed and jed in work.puget/jed-0.99-16/src/Makefile.)

They both built -- I could only install one at a time. xjed was linked
with xjed appeared to work[2].

What needs to be done is using libtool for the make elf and make

Anyways, since libslang appears to work for NetBSD and maybe others, when
should "elf" or -ldl be used?

   Jeremy C. Reed

[1] I am seeing more and more packages that assume libtermcap is
available. We should have some option or preference to define or choose

[2] You may find interesting that xjed works with and as installed from the xlibs project.