Subject: Re: Shared Libs and executables: How?
To: None <hacksaw@user1.channel1.com>
From: Frank van der Linden <frank@fwi.uva.nl>
List: netbsd-help
Date: 10/27/1996 20:28:16
Quoting Hacksaw,

> Can someone point me to litereature on how to produce shared
> libraries, and executables that use shared libraries?

The other mail replying to this seemed like a Linux response to
me.. Anyway: what port of NetBSD? Some don't have shared libraries,
others are switching to ELF shared libs, most have a.out shared libs.

In all cases: read the ld(1) manpage, and another way to do it
is simply to watch what 'make' does when compiling a library
in /usr/src/lib (see /usr/share/mk/bsd.lib.mk).

For a.out shared libs, bsd.lib.mk does the following:

	1) compile the source files with -fpic
	2) bundle them in an archive called libXXX_pic.a
	3) ld -x -Bshareable -Bforcearchive -o libXXX.so.X.Y libXXX_pic.a

- Frank