[Top][All Lists]

[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 and libfoo.a in each directory specified
with -L. GNU make first searches for in each directory specified
with vpath/VPATH and then does the same for libfoo.a.

In my case I have 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/

There doesn't seem to be a way to resolve this short of removing
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%.a)

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

Anyone sees any problems with this?


Boris Kolpackov, Code Synthesis
Open-source XML data binding for C++
XML data binding for embedded systems
Command line interface to C++ compiler

reply via email to

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