summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-06-20 12:10:18 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2011-06-20 12:10:18 +0000
commit581f81695b87fec929b2829f4b13d7d31746608b (patch)
tree9abdf31715cb4d6270259fc95c8f8edddb2920af
parent52c3b20ea26478ed0449917e418cf3672823597e (diff)
- implement --static, and preserve dependency order,
instead of search order when printing the libraries required for linking. this now passes our --static regress tests and matches fd.o
-rw-r--r--usr.bin/pkg-config/pkg-config8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/pkg-config/pkg-config b/usr.bin/pkg-config/pkg-config
index ba674af599a..70c9cf2820d 100644
--- a/usr.bin/pkg-config/pkg-config
+++ b/usr.bin/pkg-config/pkg-config
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: pkg-config,v 1.66 2011/06/16 08:38:30 jasper Exp $
+# $OpenBSD: pkg-config,v 1.67 2011/06/20 12:10:17 jasper Exp $
# $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $
# Copyright (c) 2006 Chris Kuethe <ckuethe@openbsd.org>
@@ -456,9 +456,15 @@ sub do_libs
my $libs = [];
+ # In static mode, we have to make sure we print the libs in dependency
+ # order, not in search order. Ordering matters for static linking.
foreach my $pkg (@$list) {
my $l = $configs{$pkg}->get_property('Libs', $variables);
push(@$libs, @$l) if defined $l;
+ if ($mode{static}) {
+ my $lp = $configs{$pkg}->get_property('Libs.private', $variables);
+ push(@$libs, @$lp) if defined $lp;
+ }
}
# Get the linker path directives (-L).