NOTES ON BUILDING LIBG++ AS A SHARED LIBRARY

A shared library version of libg++-2.6.2 can be built using a patched
version of gcc-2.6.1 on the following platforms:

Sparc running SunOS 4.x
Alpha running OSF/1
SGI running IRIX 5.x
All SVR4 targets (tested on Sparc Solaris and i486 UnixWare)

To build a shared version of libg++ on one of these platforms,
do the following:

(1) retrieve the shared library patch from
    ftp://ftp.cygnus.com/pub/gcc-2.6.1-shlib.gz and apply it to the gcc
    2.6.1 sources.  This patch may change periodically.
(2) rebuild gcc.
(3) reconfigure with the --enable-shared option.
(4) make clean all.

If you are using an SVR4 system other than the ones mentioned above, please
try running make check and let me (jason@cygnus.com) know whether or not it
works.

Discussion:
----------

Many shared library implementations have an idiosyncracy [bug ???] which
requires anything that is declared in a shared library to be defined even
if it isn't used.  CursesW.o declares functions that are defined in
libcurses (and libtermcap under SunOS).  If these libraries do not exist as
shared libraries (they do under OSF/1 and IRIX, they do not on the others)
and CursesW.o is incorporated into the ".so" file, these two libraries must
be added to the link statement even when the CursesWindow class is not
being used.  This situation can be alleviated by not including CursesW.o in
the .so file; just edit the 'list' file in the libg++ build directory,
remove CursesW.o, and run 'make' again.

Under SunOS, you can add CursesW.o to a libg++.sa.2.6 file so that it will
still be included by -lg++; on SVR4 platforms, you will have to put it in
a separate library in order to access it.

In addition, libg++.so contains a number of classes which use the math
library.  Consequently, if a shared libm does not exist (it does under
OSF/1, IRIX and Solaris, but not the others), either the math library must
to added to the link command or you must compile with a flag that tells the
linker to ignore unresolved references (-Wl,-assert,nodefinitions for
SunOS, -Wl,-z,nodefs for SVR4).


Jason Merrill (jason@cygnus.com)
Thanks to Dr. Joseph E. Sacco (jsacco@ssl.com) for the original version of
this note.
