[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debhelper: LDFLAGS



* Michael Biebl <biebl@debian.org>, 2010-12-19, 23:18:
When you say that setting the custom LDFLAGS doesn't work, have you
actually exported them? :)  If you just do LDFLAGS=... or LDFLAGS
!= ... or LDFLAGS := ..., make(1) will only use the new value
*within the Makefile itself*, it won't be passed to child
processes such as the configure script.

This is all true, but I don't think this is the culprit here.
dpkg-buildpackage puts LDFLAGS into environment, so it would be
exported even if you didn't use the "export" keyword.

Erm, yes, but dpkg-buildpackage doesn't see the LDFLAGS modified
in the rules file either, does it?  If you put into the rules file
a line saying "LDFLAGS=-Wl,--as-needed" without the export keyword,
it would still not work - that was the point of my explanation,
just as you say below :)

Nah, it would work just fine:

$ printf 'LDFLAGS=foo\nall:\n\t@echo LDFLAGS=\\"$$LDFLAGS\\"' > Makefile

You missed the point here: the env vars are *not* passed to sub shells. As configure is a shell script your example will not work. Try substituting echo with a shell script and run the echo from within the shell script, if you want.

This echo *is* a subshell. You'll get the very same results when you substitute it with a shell script.

Here's the relevent piece of documentation:
http://www.gnu.org/software/autoconf/manual/make/Variables_002fRecursion.html

--
Jakub Wilk

Attachment: signature.asc
Description: Digital signature


Reply to: