*BSD News Article 94799


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.ececs.uc.edu!news.kei.com!news.mathworks.com!fu-berlin.de!news-ber1.dfn.de!news-fra1.dfn.de!news-ge.switch.ch!in2p3.fr!oleane!jussieu.fr!fdn.fr!r2d2.fdn.org!sphynx.fdn.fr!causse
From: causse@sphynx.fdn.fr (Philippe Causse)
Subject: Re: Help: Shared Libs
X-Newsreader: TIN [version 1.2 PL2]
Organization: individual - paris - france
Message-ID: <E9Fz2E.HA@sphynx.fdn.fr>
References: <5k5s03$f38$1@nnrp.cs.ubc.ca>
Date: Wed, 30 Apr 1997 08:18:14 GMT
Lines: 33
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:39993

Henry Avatar Chan (q8e192@ugrad.cs.ubc.ca) wrote:
: Hi,

: Suppose I have a whole bunch of .o (object) files.
: How do I make a .so (shared dynamic lib) out of them?
: Do these .o files have to be compiled with -fPIC?
: Any full examples of creating shared libs are appreciated.

Use the /usr/share/mk/bsd.lib.mk include file !

Write a small Makfile containing these lines:

SRCS = foo.c bar.c   # all your source files
LIB = foo            # to get libfoo.a and libfoo.so.1.0
SHLIB_MAJOR = 1      # major number
SHLIB_MINOR = 0      # minor number (for subsequent rels.)
NOPROFILE = yes      # to avoid building libfoo_p.a
.include <bsd.lib.mk>
----------------------------------------------------------
Notes: * when performing bug-fixes on your lib, increment the minor version.
       * when adding mor functionalities or changing the interface, increment
         the major number.

: thx,
: Henry
: q8e192@ugrad.cs.ubc.ca

Regards,
Philippe.
-- 
-------------------------------------------------------------------
P. Causse			http://www.fdn.fr/~pcausse
4.4BSD/X11R6/Motif-2.0/C++	mailto:causse@sphynx.fdn.fr (UUCP)