version 1.29, 2011/03/10 19:06:30 |
version 1.30, 2011/03/10 19:13:14 |
|
|
'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-requires' => \$mode{printrequires}, |
|
'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}, |
|
|
exit $rc; |
exit $rc; |
} |
} |
|
|
if ($mode{modversion}) { |
if ($mode{modversion} || $mode{printprovides}) { |
for my $pkg (@$top_config) { |
for my $pkg (@$top_config) { |
do_modversion($pkg); |
do_modversion($pkg); |
} |
} |
} |
} |
|
|
|
if ($mode{printrequires} || $mode{printrequiresprivate}) { |
|
for my $pkg (@$top_config) { |
|
print_requires($pkg); |
|
} |
|
} |
|
|
if ($mode{minversion}) { |
if ($mode{minversion}) { |
my $v = $mode{minversion}; |
my $v = $mode{minversion}; |
for my $pkg (@$top_config) { |
for my $pkg (@$top_config) { |
|
|
$rc = 1; |
$rc = 1; |
} |
} |
|
|
#if the modversion option is set, pull out the compiler flags |
#if the modversion or print-provides options are set, |
|
#pull out the compiler flags |
sub do_modversion |
sub do_modversion |
{ |
{ |
my ($p) = @_; |
my ($p) = @_; |
|
|
if (defined $cfg) { |
if (defined $cfg) { |
my $value = $cfg->get_property('Version', $variables); |
my $value = $cfg->get_property('Version', $variables); |
if (defined $value) { |
if (defined $value) { |
print stringize($value), "\n"; |
if (!defined($mode{printprovides})){ |
return undef; |
print stringize($value), "\n"; |
|
return undef; |
|
} else { |
|
print "$p = " . stringize($value) . "\n"; |
|
return undef; |
|
} |
} |
} |
} |
} |
$rc = 1; |
$rc = 1; |
|
|
} |
} |
} |
} |
return $result; |
return $result; |
|
} |
|
|
|
# retrieve and print Requires(.private) |
|
sub print_requires |
|
{ |
|
my ($p) = @_; |
|
|
|
my $cfg = cache_find_config($p); |
|
|
|
if (defined($cfg)) { |
|
my $value; |
|
|
|
if (defined($mode{printrequires})) { |
|
$value = $cfg->get_property('Requires', $variables); |
|
} elsif (defined($mode{printrequiresprivate})) { |
|
$value = $cfg->get_property('Requires.private', $variables); |
|
} else { |
|
print STDERR "Unknown mode for print_requires.\n" if $D; |
|
return 1; |
|
} |
|
|
|
if (defined($value)) { |
|
print "$_\n" foreach (@$value); |
|
return undef; |
|
} |
|
} |
|
|
|
$rc = 1; |
} |
} |