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
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

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.

Thanks!
Pauli Sundberg

Reply via email to