151 | 151 |
|
152 | 152 |
sub Inline {
|
153 | 153 |
my (\$class, \$lang) = \@_;
|
154 | |
if (\$lang ne 'C') {
|
155 | |
warn "Warning: Inline hints not available for \$lang language\n";
|
156 | |
return;
|
157 | |
}
|
158 | 154 |
+{ map { (uc(\$_) => \$self->{\$_}) } qw(inc libs typemaps) };
|
159 | 155 |
}
|
160 | 156 |
EOT
|
|
228 | 224 |
|
229 | 225 |
sub load_deps {
|
230 | 226 |
my $self = shift;
|
231 | |
my @load = grep { not $self->{deps}{$_} } keys %{ $self->{deps} };
|
|
227 |
my @load = grep !$self->{deps}{$_}, keys %{ $self->{deps} };
|
|
228 |
my %in_load; @in_load{@load} = ();
|
232 | 229 |
foreach my $d (@load) {
|
233 | |
my $dep = load ($d);
|
234 | |
$self->{deps}{$d} = $dep;
|
235 | |
if ($dep->{deps}) {
|
236 | |
foreach my $childdep (@{ $dep->{deps} }) {
|
237 | |
push @load, $childdep
|
238 | |
unless
|
239 | |
$self->{deps}{$childdep}
|
240 | |
or
|
241 | |
grep {$_ eq $childdep} @load;
|
242 | |
}
|
243 | |
}
|
|
230 |
$self->{deps}{$d} = my $dep = load($d);
|
|
231 |
my @new_deps = grep !($self->{deps}{$_} || exists $in_load{$_}),
|
|
232 |
@{ $dep->{deps} || [] };
|
|
233 |
push @load, @new_deps;
|
|
234 |
@in_load{@new_deps} = ();
|
244 | 235 |
}
|
245 | 236 |
}
|
246 | 237 |
|
247 | 238 |
sub uniquify {
|
248 | 239 |
my %seen;
|
249 | |
# we use a seen hash, but also keep indices to preserve
|
250 | |
# first-seen order.
|
251 | |
my $i = 0;
|
252 | |
foreach (@_) {
|
253 | |
$seen{$_} = ++$i
|
254 | |
unless exists $seen{$_};
|
255 | |
}
|
256 | |
#warn "stripped ".(@_ - (keys %seen))." redundant elements\n";
|
257 | |
sort { $seen{$a} <=> $seen{$b} } keys %seen;
|
258 | |
}
|
259 | |
|
|
240 |
grep !$seen{$_}++, @_;
|
|
241 |
}
|
260 | 242 |
|
261 | 243 |
sub get_makefile_vars {
|
262 | 244 |
my $self = shift;
|
|
385 | 367 |
return @found_libs;
|
386 | 368 |
}
|
387 | 369 |
|
388 | |
# Hook into ExtUtils::MakeMaker to create an import library on MSWin32 when gcc
|
389 | |
# is used. FIXME: Ideally, this should be done in EU::MM itself.
|
390 | |
package # wrap to fool the CPAN indexer
|
391 | |
ExtUtils::MM;
|
392 | |
use Config;
|
393 | |
sub static_lib {
|
394 | |
my $base = shift->SUPER::static_lib(@_);
|
395 | |
|
396 | |
return $base unless $^O =~ /MSWin32/ && $Config{cc} =~ /\bgcc\b/i;
|
397 | |
|
398 | |
my $DLLTOOL = $Config{'dlltool'} || 'dlltool';
|
399 | |
|
400 | |
return <<"__EOM__"
|
401 | |
# This isn't actually a static lib, it just has the same name on Win32.
|
402 | |
\$(INST_DYNAMIC_LIB): \$(INST_DYNAMIC)
|
403 | |
$DLLTOOL --def \$(EXPORT_LIST) --output-lib \$\@ --dllname \$(DLBASE).\$(DLEXT) \$(INST_DYNAMIC)
|
404 | |
|
405 | |
dynamic:: \$(INST_DYNAMIC_LIB)
|
406 | |
__EOM__
|
407 | |
}
|
408 | |
|
409 | |
1;
|
410 | |
|
411 | 370 |
__END__
|
412 | 371 |
|
413 | 372 |
=head1 NAME
|