LDFLAGS mystery

2012-01-21 Thread Stephen Montgomery-Smith
If I build a port that uses USE_FORTRAN, then the variable ${LDFLAGS} 
has an extra space in it.  For example


%cd /usr/ports/math/lapack
%make -V LDFLAGS
 -Wl,-rpath=/usr/local/lib/gcc46

%make -V MAKE_ENV
 LDFLAGS= -Wl,-rpath=/usr/local/lib/gcc46 ...

I am trying to create a port in which this creates problems.

Where does the extra space at the beginning come from, and how do I get 
rid of it?


___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: LDFLAGS mystery

2012-01-21 Thread Stephen Montgomery-Smith

On 01/21/2012 03:02 PM, Stephen Montgomery-Smith wrote:

If I build a port that uses USE_FORTRAN, then the variable ${LDFLAGS}
has an extra space in it. For example

%cd /usr/ports/math/lapack
%make -V LDFLAGS
-Wl,-rpath=/usr/local/lib/gcc46

%make -V MAKE_ENV
 LDFLAGS= -Wl,-rpath=/usr/local/lib/gcc46 ...

I am trying to create a port in which this creates problems.

Where does the extra space at the beginning come from, and how do I get
rid of it?


I solved the mystery.  Inside /usr/share/mk/sys.mk is the line:

LDFLAGS ?=

I think that it is a bug in make that

XXX=
XXX+=xxx

results in XXX having the value  xxx.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org