GNU bug report logs - #11089
LINK determination

Previous Next

Package: automake;

Reported by: Jason DeVinney <jasondevinney <at> gmail.com>

Date: Sun, 25 Mar 2012 15:52:02 UTC

Severity: minor

Full log


View this message in rfc822 format

From: Peter Breitenlohner <peb <at> mppmu.mpg.de>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: 11089 <at> debbugs.gnu.org, automake-patches <at> gnu.org, automake <at> gnu.org
Subject: bug#11089: LINK determination
Date: Wed, 28 Mar 2012 13:30:52 +0200 (CEST)
On Tue, 27 Mar 2012, Stefano Lattarini wrote:

> [Adding automake-patches]
>
> Reference: <http://debbugs.gnu.org/11089>
>
>> On Sun, Mar 25, 2012 at 11:20 AM, Stefano Lattarini wrote:
>>
>> I'd describe this as an automake limitation; not sure if it's worth
>> fixing (since yours is not a common use case, and the issue you're
>> facing has a simple-enough workaround, as you've already found out);
>> but it would be worth documenting IMHO.

this situation is actually more common than one might think.  E.g., the
Makefile.am for gnuplot-4.6.0/src/ contains
	gnuplot_SOURCES = alloc.c ETC.
	if BUILD_WXWIDGETS
	gnuplot_SOURCES += wxterminal/wxt_gui.cpp
	endif
but that actually ought to be
	gnuplot_SOURCES = alloc.c ETC.
	if BUILD_WXWIDGETS
	gnuplot_SOURCES += wxterminal/wxt_gui.cpp
	gnuplot_LINK = $(CXXLINK)
	else
        gnuplot_LINK = $(LINK)
	endif

> On a second thought, I've been unable to find a way to document Jason's
> workaround that doesn't sound cumbersome and clumsy; so maybe it's better
> to just drop this documentation change.
>
> Still, having a test case verifying that such a workaround actually works
> is still worthwhile and easy to do.  This is what the attached patch does.
> I will push it this evening or tomorrow if there is no objection.

the workaround described earlier in this thread and used in the test case:
	if HAVE_CXX
	foo_LINK = $(CXXLINK)
	else
	foo_LINK = $(LINK)
	endif
works nicely and is simple enough when not using libtool libraries.  When
linking foo with (installed or uninstalled) libtool libraries, the default
definition of foo_LINK generated by Automake would be something like
	foo_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
	        --mode=link $(CXXLD) $(foo_CXXFLAGS) $(CXXFLAGS) \
	        $(foo_LDFLAGS) $(LDFLAGS) -o $@
and a more elaborate workaround is needed.

What is the best way to handle this situation?  An additional test case?

Regards
Peter Breitenlohner <peb <at> mppmu.mpg.de>




This bug report was last modified 13 years and 83 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.