Subject: Re: dilema with use of LDFLAGS=-L${LOCALBASE}/lib vs. private application libraries
To: NetBSD Packages Technical Discussion List <tech-pkg@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: tech-pkg
Date: 10/22/1999 15:07:17
[ On Wednesday, October 20, 1999 at 20:19:17 (-0700), Greywolf wrote: ]
> Subject: Re: dilema with use of LDFLAGS=-L${LOCALBASE}/lib vs. private application libraries
>
> On Mon, 18 Oct 1999, Greg A. Woods wrote:
> 
> # I think in both cases I didn't need any libraries from any other package
> # and I was able to simply tromp on the value of LDFLAGS from bsd.pkg.mk
> # via the following hack:
> # 
> # +   .if !defined(NO_USE_LOCALBASE_LIBS)
> #     LDFLAGS+=		-Wl,-R${LOCALBASE}/lib -L${LOCALBASE}/lib
> # +   .endif
> # and then setting "NO_USE_LOCALBASE_LIBS" in the package Makefile.
> 
> Greg is inadvertantly bringing up a very good point here -- it's inadvertant
> in that it's probably not the one he was trying to illustrate:

Well you did hit the nail on the head, inadvertently!  ;-)  I was trying
to illustrate that point, but only in a rather obscure way.

> These "special cases" seem to me to be appearing more and more in the
> pkgsrc tree; this isn't the first time I've seen an exception fly by.
> There was XPKGWEDGE, and there was one other which I forget, and now
> there's this.

(the xpkgwedge package is a totally different kind of issue, I think)

Actually, as I mentioned in a recent reply to a bug report, it is
beginning to look as if the "exceptions" are actually only those few
packages which specifically need "-L${LOCALBASE}/lib", and in almost
every case that flag should always appear at or at least near the *end*
of the compile command, which is almost totally impossible to influence
from within pkgsrc/mk/bsd.pkg.mk -- it must be done by directly hacking
the package's Makefiles or whatever with a patch.

So, my new proposal is simply:

- LDFLAGS+=		-Wl,-R${LOCALBASE}/lib -L${LOCALBASE}/lib

and then fix up (with local patches) any packages which are dependent on
libraries which might have been installed by other packages.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>