Subject: Re: COFF shared libraries
To: Todd Vierling <tv@wasabisystems.com>
From: Vadim Vygonets <vadik-sh3@vygo.net>
List: port-sh3
Date: 01/26/2001 01:24:35
Quoth Todd Vierling on Thu, Jan 25, 2001:
> On Fri, 26 Jan 2001, Vadim Vygonets wrote:
> BTW, the preferred method for this detection is to pass __ELF__ through the
> preprocessor and see if it is still __ELF__ (meaning *non*-ELF system).

The one I used (advised by Andrew Doran) was to use a makefile
which includes <bsd.own.mk> and prints out OBJECT_FMT.

> The proper flag to ensure that the compile will work on all platforms and
> versions of the compiler is:
> 
>   cc ... -Wl,-R/usr/X11R6/lib/ -L/usr/X11R6/lib -lXwhatever
> 
> The -Wl,-R... option will add -R to the ld command line--note the trailing
> slash.

Interesting...  It worked for me without the trailing slash, as
in:
	gcc -o eximon.bin em_version.o -L/usr/X11R6/lib \
	-R/usr/X11R6/lib <other object files> -lXaw  -lXmu -lXt \
	-lXext -lX11 pcre/libpcre.a  -lcrypt -lc

(don't ask me why em_version.o is before the other object files
 or why -lc is included, I didn't write it.)

> There are dozens of other combinations, but this one is guaranteed
> to work on all NetBSD systems and versions with shared library support.

Which is good to know, but I still want to make a difference
between a.out and ELF, so people who have, say, NetBSD/sparc 1.4
and 1.5 will be able to have two different builds in the same
source directory (that's how Exim build process works).  Actually
that's why we asked to differ between BSDI3 and BSDI4.

> (It will probably work, and be ignored, on static binary systems too.)

Can somebody please check this?  Pleeeze?

Arigato name mashita,
Vadik.

-- 
Rex is to Regina as Vax is to...