On Mon, Mar 05, 2007 at 10:29:39AM -0600, Eric Boutilier wrote:

> I am not sure which list this questions best belongs to, so I try here 
> first. Has anyone tried to build with library configuration returned by 
> `/usr/sfw/bin/net-snmp-config -libs`?

No.  On Solaris, this is generally neither necessary nor correct,
anyway, because we link our libraries with -zdefs (and you should
too!).  This means that each shared object already has encoded all of
the other objects on which it depends and the runtime loader will load
them automatically as needed.  When linking against libraries included
in Solaris, you should only link against libraries called into from
*your* code.

It does appear that OpenSolaris SMA libraries are built this way
(i.e., correctly), so there should be no need to use the output of
something intended to give you additional libraries to link against.
You should normally use -z ignore when linking to eliminate
unnecessary dependencies.

> On my snv57, it gives "-R../lib -L/usr/sfw/lib -lnetsnmp -lgen -lpkcs11 
> -lkstat -lelf -lm -ldl -lnsl -lsocket -ladm" Now, I am not sure if 
> /usr/ccs/bin/ld takes a relative library run path, but libtool certainly 

ld is fine with this, but the effect is almost certainly not what you
want; the search path will depend on the directory from which the
executable is eventually run.  This is a bug in SMA; I would argue
that we should simply not ship this useless script at all, but if
we're going to it should output the following, and only the following,
when given --libs:

-L/usr/sfw/lib -R/usr/sfw/lib -lnetsnmp

The other arguments one can give this thing produce similarly broken
output as well.  The same is true of net-snmp-config-64.  I would
strongly suggest we simply remove these programs if their stability
level permits it.

> Is this a libtool bug or somehow things went wrong with netsnmp in /usr/sfw?

Both.  libtool is defective in so many ways it's impossible and
pointless to describe them all; rejecting perfectly valid linker
arguments is but one of its lesser offenses.  You should never use it
for any purpose.  And it's also a bug in SMA.  Please file one at
bugs.opensolaris.org.

-- 
Keith M Wesolowski              "Sir, we're surrounded!" 
FishWorks                       "Excellent; we can attack in any direction!" 
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to