make-alpha
[Top][All Lists]
Advanced

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

Pattern grouping in .LIBPATTERNS


From: Boris Kolpackov
Subject: Pattern grouping in .LIBPATTERNS
Date: Mon, 2 Nov 2009 14:53:12 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Paul, all,

Today I ran into an annoying discrepancy in behavior between make and 
ld when it comes to searching for libraries specified as -lfoo. The
linker searches for libfoo.so and libfoo.a in each directory specified
with -L. GNU make first searches for libfoo.so in each directory specified
with vpath/VPATH and then does the same for libfoo.a.

In my case I have libfoo.so in /usr/lib and libfoo.a in /tmp/lib. I want
to link to the static version and specified /tmp/lib in vpath. But no
matter what I do, make picks /usr/lib/libfoo.so.

There doesn't seem to be a way to resolve this short of removing lib%.so
from .LIBPATTERNS which is too pervasive. I don't know if anyone relies
on the current behavior but I think it would be too risky to change it
(thought it would be "the right thing to do", IMO).

So I would like to implement the pattern grouping feature for .LIBPATTERNS.
For example:

.LIBPATTERNS := (lib%.so lib%.a)

This would result in the ld-compatible behavior. That is, patterns
specified in parenthesis are searched at once as each directory is
considered.

Anyone sees any problems with this?

Boris

-- 
Boris Kolpackov, Code Synthesis        http://codesynthesis.com/~boris/blog
Open-source XML data binding for C++   http://codesynthesis.com/products/xsd
XML data binding for embedded systems  http://codesynthesis.com/products/xsde
Command line interface to C++ compiler http://codesynthesis.com/projects/cli




reply via email to

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