Subject: Re: buildlink2 problems with new libogg and libvorbis packages
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Greg A. Woods <>
List: tech-pkg
Date: 10/04/2002 23:39:52
[ On , October 5, 2002 at 13:09:04 (+1000), Rene Hexel wrote: ]
> Subject: Re: buildlink2 problems with new libogg and libvorbis packages
> On Sat, 2002-10-05 at 12:37, Greg A. Woods wrote:
> > The problem really is that -Wl,-R${PREFIX}/lib isn't passed in LDFLAGS
>   This sounds like something is wrong in your setup.  From
> .if ${_USE_RPATH} == "yes"
> LDFLAGS+=               -Wl,-R${LOCALBASE}/lib

Ah yes...  That was the hint I needed.  I had stared at that line for
many minutes, and I thought it should be having some effect, but I
didn't know for sure that's where buillink2 was supposed to get this
setting from.  Thank you very much for pointing it out directly!

It turns out that on the last merge with my local LDSTATIC changes an
extra ".else" had crept in and that section was never seen.

I should test this myself, but is it true our 'make' ignores unclosed
'.else' statements?  I thought I should have got a warning or error if
there was an unbalanced .else/.endif.

>   And _USE_RPATH is set to "yes" in  What does
>   make show-var VARNAME=LDFLAGS
>   produce in audio/libvorbis on your system?

It now correctly shows:

	$ make show-var VARNAME=LDFLAGS     
	-L/usr/pkg/lib   -Wl,-R/usr/pkg/lib

Note I got rid of the redundant identical '-L' with this hack:
(hand edited a bit, ignore the line numbers)

*** 408,418 ****
! .if !defined(USE_BUILDLINK_ONLY)
--- 496,517 ----
! .if !defined(USE_BUILDLINK_ONLY) && !defined(USE_BUILDLINK2)

The correct fix would be for the LDFLAGS munging in
buildlink2/ to check if a value is in the
variable before it adds it blindly again, something like this:

	.if empty(LDFLAGS:M*${NEW_VALUE}*)

but then there are lots of similar sins still spread throughout pkgsrc.  :-)

								Greg A. Woods

+1 416 218-0098;            <>;           <>
Planix, Inc. <>; VE3TCP; Secrets of the Weird <>