#!./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 or F file that is a plain C file containing all the bootstrap code to make the modules associated with the libraries available from within perl. If the first argument to C is a reference to a scalar it is used as the filename to open for output. Any other reference is used as the filehandle to write to. Otherwise output defaults to C. The typical usage is from within perl's own Makefile (to build F) or from F (to build miniperlmain.c). So under normal circumstances you won't have to deal with this module directly. =head1 SEE ALSO L<:makemaker> =cut # ex: set ts=8 sts=4 sw=4 et: