compile: support libfoo.a naming when wrapping Microsoft tools
authorPeter Rosin <peda@lysator.liu.se>
Wed, 3 Oct 2012 22:08:26 +0000 (00:08 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 14 Oct 2012 10:53:57 +0000 (12:53 +0200)
commit3c5c9394e2cbe6f88e0117f34c33b1e03cdaa5bb
treebb82f1ebcd57580c5443b988d70673fd64c276a5
parentae74aa69705e967a19327c70a26c0004843e8e7b
compile: support libfoo.a naming when wrapping Microsoft tools

There is a future plan to provide some means to have Automake
create static libraries that are named differently depending
on the system [1].

The background is that everyone has always named static libraries
libfoo.a, except the Redmond crowd who names them foo.lib, and
you have to jump through hoops to have Automake create libraries
named foo.lib in the land of non-GNU Windows while still creating
libfoo.a everywhere else.

However, there is probably no sane way to accomplish that system
dependent naming discussed in [1] without user intervention,
which makes it necessary to support the classic libfoo.a naming
when using Microsoft tools in the best possible way, for the
benefit of all projects today and for future projects not
opting in to whatever scheme is selected for the problem at
hand.

[1] http://lists.gnu.org/archive/html/automake/2012-09/msg00028.html

* lib/compile (func_cl_dashl): As a last resort, match -lfoo with
libfoo.a, if that file exist on the library search path.
* t/compile4.sh: Remove obsolescent workaround for the above.
* t/compile6.sh: Extend to check that libbaz.a is indeed found
when baz.lib and baz.dll.lib does not exist and that bar.lib
and bar.dll.lib are preferred over libbar.a.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/compile
t/compile4.sh
t/compile6.sh