bug-make
[Top][All Lists]
Advanced

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

Re: Make version 3.79.1 Linux Redhat 8.0


From: Paul D. Smith
Subject: Re: Make version 3.79.1 Linux Redhat 8.0
Date: Wed, 30 Apr 2003 10:50:05 -0400

%% "Jeff Burke" <address@hidden> writes:

  jb>         When setting the .LIBPATTERNS variable in my makefile.
  jb> .LIBPATTERNS :=lib%.so.0.0 lib%.so lib.a

  jb> Here is where the problem begins.  Any library I try to link in
  jb> with the -L${LIB_DIR} -l{libWHATEVER.so.0.0} it will find all the
  jb> lib%.so and lib%.a fine but any lib%so.0.0 in the {LIB_DIR} path
  jb> it will not find at all. I also tried adding a vpath for
  jb> %.so.0.0 to the ${LIB_DIR} but that still doesn$,1ry(Bt work.

I think you are misunderstanding what .LIBPATTERNS does.  .LIBPATTERNS
has absolutely no impact on how the linker that make invokes behaves.
Make doesn't even know that any given command it runs is a "linker"; it
can in no way influence this.  Whatever arguments you have on your link
line are what the linker uses.

.LIBPATTERNS is _only_ used when a -lLIB appears on a prerequisite list,
like this:

  foo: foo.o -lbar

In this case make has to look for the library to see if it's updated
before it knows whether to rebuild "foo".  _That_ lookup is when
.LIBPATTERNS comes into play, not during the actual link.


I don't believe it's legal to add "-llibfoo.so.0.0" to the link line;
that is not how the linker works.  The -l option is supposed to take the
base library name ("foo") only, and it uses internal algorithms to find
the "best" one.

If you want to fully specify a library then you need to write out the
full pathname to the library, as you've done.

See the manual for your linker to determine if you have other options:
this is not really a make question.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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