text stringlengths 0 834k |
|---|
my $evalstr = sprintf('$%s = PkgConfig::_quote_cvt(%s)', |
$self->_get_pc_varname($field), $value); |
log_debug(""EVAL"", $evalstr); |
do { |
no warnings 'uninitialized'; |
eval $evalstr; |
}; |
if($@) { |
log_err($@); |
} |
} |
sub prepare_vars { |
my $self = shift; |
my $varclass = $self->varclass; |
no strict 'refs'; |
%{$varclass . ""::""} = (); |
while (my ($name,$glob) = each %{$self->udefclass.""::""}) { |
my $ref = *$glob{SCALAR}; |
next unless defined $ref; |
${""$varclass\::$name""} = $$ref; |
} |
} |
################################################################################ |
################################################################################ |
### Initializer ### |
################################################################################ |
################################################################################ |
sub find { |
my ($cls,$library,%options) = @_; |
my @uspecs = ( |
['search_path', \@DEFAULT_SEARCH_PATH], |
['exclude_ldflags', \@DEFAULT_EXCLUDE_LFLAGS], |
['exclude_cflags', \@DEFAULT_EXCLUDE_CFLAGS] |
); |
my %original = %options; |
foreach (@uspecs) { |
my ($basekey,$default) = @$_; |
my $list = [ @{$options{$basekey} ||= [] } ]; |
if($options{$basekey . ""_override""}) { |
@$list = @{ delete $options{$basekey.""_override""} }; |
} else { |
push @$list, @$default; |
} |
$options{$basekey} = $list; |
#print ""$basekey: "" . Dumper($list); |
} |
$VarClassSerial++; |
$options{varclass} = sprintf(""PkgConfig::Vars::SERIAL_%d"", $VarClassSerial); |
$options{udefclass} = sprintf(""PkgConfig::UDefs::SERIAL_%d"", $VarClassSerial); |
$options{original} = \%original; |
my $udefs = delete $options{VARS} || {}; |
while (my ($k,$v) = each %$udefs) { |
no strict 'refs'; |
my $vname = join('::', $options{udefclass}, $k); |
${$vname} = $v; |
} |
my $o = $cls->new(%options); |
my @libraries; |
if(ref $library eq 'ARRAY') { |
@libraries = @$library; |
} else { |
@libraries = ($library); |
} |
if($options{file_path}) { |
if(-r $options{file_path}) { |
$o->recursion(1); |
$o->parse_pcfile($options{file_path}); |
$o->recursion(0); |
} else { |
$o->errmsg(""No such file $options{file_path}\n""); |
} |
} else { |
foreach my $lib (@libraries) { |
$o->recursion(0); |
my($op,$ver); |
($lib,$op,$ver) = ($1,$2,PkgConfig::Version->new($3)) |
if $lib =~ /^(.*)\s+(!=|=|>=|<=|>|<)\s+(.*)$/; |
$o->find_pcfile($lib); |
if(!$o->errmsg && defined $op) { |
$op = '==' if $op eq '='; |
unless(eval qq{ PkgConfig::Version->new(\$o->pkg_version) $op \$ver }) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.