From 581f81695b87fec929b2829f4b13d7d31746608b Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Mon, 20 Jun 2011 12:10:18 +0000 Subject: - 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 --- usr.bin/pkg-config/pkg-config | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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 @@ -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). -- cgit v1.2.3