[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Automake 1.5 linker selection
From: |
Christian Cornelssen |
Subject: |
Re: Automake 1.5 linker selection |
Date: |
Tue, 27 Nov 2001 19:21:26 +0100 (CET) |
Dear Automake maintainers,
on 26 Nov 2001, Alexandre Duret-Lutz wrote:
> The linker is selected on a per-target basis. Finding
> AC_LANG(C++) in configure.ac does not mean all the targets in
> your package use C++.
>
> You'd rather override the linker in this particuliar case.
> Grep the documentation for `maude_LINK'.
Thanks. I have provided a specific linker definition now.
Before submitting my problem report, I have taken a closer look at the
generated `Makefile.in', in order to find tweakable variable
definitions. Thereby, I encountered another point about the linker
definitions which I want to mention here: Automake 1.5 uses (with
libtool support)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
However, $(CFLAGS) and $(CXXFLAGS) make sense only for $(CC) and
$(CXX), respectively. If the setting CCLD = $(CC) is meant to allow
easy overriding (with CCLD=$(CXX) or even CCLD=ld, for example), then
the $(...CFLAGS) stuff can make the $(LINK) command unusable. I
suggest changing the partition of the link command definitions to the
following:
CCLD = $(CC) $(AM_CFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CCLD) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXLD = $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
Similar considerations might apply to other compiler/linker
definitions (without libtool, or with fortran, etc.)
Sincerely,
Christian Cornelssen