Subject: libslang need to be linked with -ldl for Linux?
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
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
/scratch/pkgsrc/editors/jed/work.puget/jed-0.99-16/src/objs/chkslang
-L/usr/lib -Wl,-R/usr/lib  -lslang    -lutil  -lm
/scratch/pkgsrc/editors/jed/work.puget/.buildlink/lib/libslang.so:
undefined reference to `dlerror'
/scratch/pkgsrc/editors/jed/work.puget/.buildlink/lib/libslang.so:
undefined reference to `dlclose'
/scratch/pkgsrc/editors/jed/work.puget/.buildlink/lib/libslang.so:
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 libdl.so.2. xjed appeared to work[2].

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

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

   Jeremy C. Reed
   http://bsd.reedmedia.net/

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

[2] You may find interesting that xjed works with libX11.so.6 and
libXau.so.0 as installed from the freedesktop.org xlibs project.