From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Steven J Long <slong@rathaus.eclipse.co.uk>
Subject: Re: [gentoo-dev] .LIBPATTERNS harmful?
Date: Sun, 22 Apr 2012 11:17:38 -0400 [thread overview]
Message-ID: <201204221117.39554.vapier@gentoo.org> (raw)
In-Reply-To: <jn023c$dfl$1@dough.gmane.org>
[-- Attachment #1: Type: Text/Plain, Size: 1441 bytes --]
On Sunday 22 April 2012 00:44:11 Steven J Long wrote:
> I can find nothing overriding it in portage, which makes sense, since in
> general one cannot know if the package in question uses gmake .LIBPATTERNS
> to link to locally-built libs. However I can't help thinking of it as
> harmful for a package manager, since a command like ld would be given a
> parameter of say, /usr/lib/libfoo.so, not -lfoo, meaning LDFLAGS would be
> irrelevant for its lookup.
.LIBPATTERNS only matters if you specify the -lfoo in the dependency, and then
link in via an automatic make variable.
e.g. this:
$ cat Makefile
all: test
test: -lm
$ echo 'main(){}' > test.c
$ make
cc test.c /usr/lib/libm.so -o test
so the easy answer is: don't add -lfoo flags as dependencies to make targets.
if you want to have something link in a library, do:
$ cat Makefile
all: test
test: LDLIBS += -lm
$ make
cc test.c -lm -o test
> I'd hope upstream would accept them, since it makes cross-development
> easier. (One definitely does not want make expanding -lname to a library in
> /lib or /usr/lib in that case, and it's better to error out if the library
> can't be found than link to host libs.)
i've seen this usage in only one or two packages before. and when i notified
the respective upstream, they weren't really doing it on purpose, so a simple
patch (like i showed above) they were fine with merging.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-22 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-22 4:44 [gentoo-dev] .LIBPATTERNS harmful? Steven J Long
2012-04-22 15:17 ` Mike Frysinger [this message]
2012-04-22 22:13 ` [gentoo-dev] " Steven J Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201204221117.39554.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=slong@rathaus.eclipse.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox