version 1.67, 2011/06/20 12:10:17 |
version 1.68, 2011/06/20 12:11:27 |
|
|
# without having to go back and reload the files from disk. |
# without having to go back and reload the files from disk. |
|
|
Getopt::Long::Configure('no_ignore_case'); |
Getopt::Long::Configure('no_ignore_case'); |
GetOptions( 'debug' => \$mode{debug}, |
GetOptions( 'debug' => \$mode{debug}, |
'help' => \&help, #does not return |
'help' => \&help, #does not return |
'usage' => \&help, #does not return |
'usage' => \&help, #does not return |
'list-all' => \$mode{list}, |
'list-all' => \$mode{list}, |
'version' => sub { print "$version\n" ; exit(0);} , |
'version' => sub { print "$version\n" ; exit(0);} , |
'errors-to-stdout' => sub { $mode{estdout} = 1}, |
'errors-to-stdout' => sub { $mode{estdout} = 1}, |
'print-errors' => sub { $mode{printerr} = 1}, |
'print-errors' => sub { $mode{printerr} = 1}, |
'silence-errors' => sub { $mode{printerr} = 0}, |
'silence-errors' => sub { $mode{printerr} = 0}, |
'short-errors' => sub { $mode{printerr} = 0}, |
'short-errors' => sub { $mode{printerr} = 0}, |
'atleast-pkgconfig-version=s' => \$mode{myminvers}, |
'atleast-pkgconfig-version=s' => \$mode{myminvers}, |
'print-provides' => \$mode{printprovides}, |
'print-provides' => \$mode{printprovides}, |
'print-requires' => \$mode{printrequires}, |
'print-requires' => \$mode{printrequires}, |
'print-requires-private' => \$mode{printrequiresprivate}, |
'print-requires-private' => \$mode{printrequiresprivate}, |
|
|
'cflags' => sub { $mode{cflags} = 3}, |
'cflags' => sub { $mode{cflags} = 3}, |
'cflags-only-I' => sub { $mode{cflags} |= 1}, |
'cflags-only-I' => sub { $mode{cflags} |= 1}, |
'cflags-only-other' => sub { $mode{cflags} |= 2}, |
'cflags-only-other' => sub { $mode{cflags} |= 2}, |
'libs' => sub { $mode{libs} = 7}, |
'libs' => sub { $mode{libs} = 7}, |
'libs-only-l' => sub { $mode{libs} |= 1}, |
'libs-only-l' => sub { $mode{libs} |= 1}, |
'libs-only-L' => sub { $mode{libs} |= 2}, |
'libs-only-L' => sub { $mode{libs} |= 2}, |
'libs-only-other' => sub { $mode{libs} |= 4}, |
'libs-only-other' => sub { $mode{libs} |= 4}, |
'exists' => sub { $mode{exists} = 1} , |
'exists' => sub { $mode{exists} = 1} , |
'static' => sub { $mode{static} = 1}, |
'static' => sub { $mode{static} = 1}, |
'uninstalled' => sub { $mode{uninstalled} = 1}, |
'uninstalled' => sub { $mode{uninstalled} = 1}, |
'atleast-version=s' => \$mode{minversion}, |
'atleast-version=s' => \$mode{minversion}, |
'exact-version=s' => \$mode{exactversion}, |
'exact-version=s' => \$mode{exactversion}, |
'max-version=s' => \$mode{maxversion}, |
'max-version=s' => \$mode{maxversion}, |
'modversion' => \$mode{modversion}, |
'modversion' => \$mode{modversion}, |
'variable=s' => \$mode{variable}, |
'variable=s' => \$mode{variable}, |
'define-variable=s' => $variables, |
'define-variable=s' => $variables, |
); |
); |
|
|
# Initial value of printerr depends on the options... |
# Initial value of printerr depends on the options... |
|
|
|
|
my $libs = []; |
my $libs = []; |
|
|
# In static mode, we have to make sure we print the libs in dependency |
# In static mode, we have to make sure we discover the libs in dependency |
# order, not in search order. Ordering matters for static linking. |
# order, not in search order. Ordering matters for static linking: |
|
# Start with Libs (first our own, then dependencies), and append |
|
# Libs.private (same order as for Libs). |
foreach my $pkg (@$list) { |
foreach my $pkg (@$list) { |
my $l = $configs{$pkg}->get_property('Libs', $variables); |
my $l = $configs{$pkg}->get_property('Libs', $variables); |
push(@$libs, @$l) if defined $l; |
push(@$libs, @$l) if defined $l; |
|
|
} |
} |
} |
} |
|
|
# Get the linker path directives (-L). |
# Get the linker path directives (-L) and store it in $a. |
|
# $b will be the actual libraries. |
my $a = OpenBSD::PkgConfig->compress($libs, |
my $a = OpenBSD::PkgConfig->compress($libs, |
sub { |
sub { |
local $_ = shift; |
local $_ = shift; |