#!./perl -w
package ExtUtils::Miniperl;
use strict;
use Exporter 'import';
use ExtUtils::Embed 1.31, qw(xsi_header xsi_protos xsi_body);
our @EXPORT = qw(writemain);
our $VERSION = '1.14';
# blead will run this with miniperl, hence we can't use autodie or File::Temp
my $temp;
END {
return if !defined $temp || !-e $temp;
unlink $temp or warn "Can't unlink '$temp': $!";
}
sub writemain{
my ($fh, $real);
if (ref $_[0] eq 'SCALAR') {
$real = ${+shift};
$temp = $real;
$temp =~ s/(?:.c)?\z/.new/;
open $fh, '>', $temp
or die "Can't open '$temp' for writing: $!";
} elsif (ref $_[0]) {
$fh = shift;
} else {
$fh = \*STDOUT;
}
my(@exts) = @_;
printf $fh takes an argument list of zero or more directories
containing archive
libraries that relate to perl modules and should be linked into a new
perl binary. It writes a corresponding F