*BSD News Article 31290


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!hookup!swrinde!ihnp4.ucsd.edu!usc!nic-nac.CSU.net!charnel.ecst.csuchico.edu!olivea!decwrl!pa.dec.com!usenet.pa.dec.com!jkh
From: jkh@morse.ilo.dec.com (Jordan Hubbard)
Newsgroups: comp.os.386bsd.questions
Subject: Re: InterViews & shared libraries
Date: 26 May 1994 01:58:14 GMT
Organization: Digital Equipment Corporation, Galway Ireland
Lines: 26
Message-ID: <JKH.94May26025814@morse.ilo.dec.com>
References: <UWP.94May25142200@titanic.cs.tu-berlin.de>
NNTP-Posting-Host: 16.183.192.132
In-reply-to: uwp@cs.tu-berlin.de's message of 25 May 1994 12:21:59 GMT

In article <UWP.94May25142200@titanic.cs.tu-berlin.de> uwp@cs.tu-berlin.de (Udo Wolter) writes:

   I tried to compile InterViews (I think it's version 3.1 ?) on my machine
   (FreeBSD 1.1) and all went fine. But I have one question:
   How can i convert the normal lib*.a libraries to shared libs ?

For most things, simply compiling all the objects with -fpic and linking
the library with -Bshareable works fine, e.g.:

	cc -c -fpic foo.c bar.c baz.c
	ld -Bshareable -o myshlib.so.1.0 foo.o bar.o baz.o

NOW, if you want to do this with InterViews or any other C++ library, you
will need to do one more thing:

	ld -Bshareable -o myshlib.so.1.0 /usr/lib/c++rt0.o foo.o bar.o baz.o

The c++rt0.o is necessary for including the code that calls your dtors/ctors.
I'm about to add some stuff into FreeBSD 1.1.5 that makes this happen all
automagically if you say `CPLUSPLUSLIB=yes' in your Makefile.

If you do get the Interviews port to work shared, can I ask you to please
please please save the original copy somewhere so that you can generate
a nice set of recursive diffs for us to add it back into FreeBSD? :-)

					Jordan