automake
[Top][All Lists]
Advanced

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

Re: Makefile.am and xxx_LDFLAGS seems not working


From: Pauli Sundberg
Subject: Re: Makefile.am and xxx_LDFLAGS seems not working
Date: Mon, 31 Jan 2011 22:26:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Hello and thanks for the reply.

Yes indeed, \t was the problem. Replacing that with whitspaces did the trick. I was about to whine why not 'make a warning out from it' but it seems like manual has already mention about it.

Further note that variable assignments should not be indented with <TAB> characters, use spaces if necessary. On the other hand, rule commands should be indented with a leading <TAB> character.

I guess i will in future just drop the indentations..

Cheers,
Pauli.


On 01/31/2011 06:59 PM, Stefano Lattarini wrote:
On Monday 31 January 2011, Pauli Sundberg wrote:
Hello!

I am trying to add -all-static flag for binaries compiled with autotools.

What i am doing wrong since to me it seems like _LDFLAGS is not working
when i have _LDFLAGS defined in Automake.am:

bin_PROGRAMS = linearize

linearize_SOURCES = \
         Linearize/linearize_main.c Linearize/linearizeParameters.c \
         Linearize/linearizeParameters.h

if COND_STATIC_BIN
     linearize_LDFLAGS = -all-static
Did you use a literal tab at the beginning of the line?  If yes, then
automake won't consider this line as a variable assignement, but will
be confused into thinking that it's a make recipe (and will it output
unchanged).

My advice: never use leading whitespace before a variable assignement
or a target declaration.  The annoying downside is that you can't use
nice indentation with conditionals, the upside is that you won't be
bitten by mistakes like this.

endif
If i look at the generated Makefile i can find:

         linearize_LDFLAGS = -all-static

but the link command:
linearize$(EXEEXT): $(linearize_OBJECTS) $(linearize_DEPENDENCIES)
          @rm -f linearize$(EXEEXT)
          $(LINK) $(linearize_OBJECTS) $(linearize_LDADD) $(LIBS)

Where link is:
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
          --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
          $(LDFLAGS) -o $@

seems to ignore these linearize_LDFLAGS.

Full Automake.am can be found from:
http://susundberg.pastebin.com/LuhKbU1K

Generated automake.in:
http://susundberg.pastebin.com/7HTrC737

And generated Makefile:
http://susundberg.pastebin.com/rQHUXZc1

Thanks for posting these links, they seem to confirm the diagnosis
I've made above.

Any tips how to start figure out whats wrong? The project has lots of
Autoconf files and i would rather not post them all here.

Removing that leading tab should be enough to solve your problem.

Thanks!
Pauli Sundberg


HTH,
   Stefano




reply via email to

[Prev in Thread] Current Thread [Next in Thread]