# This file is auto-generated by:
# enc2xs version $_Version_
# Please edit the following to the taste!
$_Name__t => [ $_TableFiles_ ],
#### DO NOT EDIT BEYOND THIS POINT!
my ($enc2xs, $encode_h) = ();
for my $d (@Config{qw/bin sitebin vendorbin/},
(split /$Config{path_sep}/o, $ENV{PATH})){
for my $f (qw/enc2xs enc2xs5.7.3/){
my $path = File::Spec->catfile($d, $f);
-r $path and $enc2xs = $path and last PATHLOOP;
$enc2xs or die "enc2xs not found!";
print "enc2xs is $enc2xs\n";
my $dir = File::Spec->catfile($d, "Encode");
my $file = File::Spec->catfile($dir, "encode.h");
-f $file and $encode_h{$dir} = -M $file;
%encode_h or die "encode.h not found!";
($encode_h) = sort {$encode_h{$b} <=> $encode_h{$a}} keys %encode_h;
print "encode.h is at $encode_h\n";
#### END_OF_HEADER -- DO NOT EDIT THIS LINE BY HAND! ####
NAME => 'Encode::'.$name,
VERSION_FROM => "$name.pm",
DIST_DEFAULT => 'all tardist',
# OS 390 winges about line numbers > 64K ???
XSOPT => '-nolinenumbers',
my $x = $self->{'OBJ_EXT'};
foreach my $e (keys %tables)
$self->{'O_FILES'} = [sort keys %o];
my @files = ("$name.xs");
$self->{'C'} = ["$name.c"];
# The next two lines to make MacPerl Happy -- dankogai via pudge
$self->{SOURCE} .= " $name.c"
if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/;
# $self->{'H'} = [$self->catfile($self->updir,'encode.h')];
foreach my $table (keys %tables) {
push (@{$self->{'C'}},"$table.c");
# Do NOT add $table.h etc. to H_FILES unless we own up as to how they
foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) {
push (@files,$table.$ext);
$self->{'XS'} = { "$name.xs" => "$name.c" };
$self->{'clean'}{'FILES'} .= join(' ',@files);
open(XS,">$name.xs") || die "Cannot open $name.xs:$!";
foreach my $table (keys %tables) {
print XS qq[#include "${table}.h"\n];
Encode_XSEncoding(pTHX_ encode_t *enc)
HV *stash = gv_stashpv("Encode::XS", TRUE);
SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
const char *name = enc->name[i++];
XPUSHs(sv_2mortal(newSVpvn(name,strlen(name))));
call_pv("Encode::define_encoding",G_DISCARD);
MODULE = Encode::$name PACKAGE = Encode::$name
foreach my $table (keys %tables) {
print XS qq[#include "${table}.exh"\n];
return "# Built $name.xs\n\n";
my $dir = "."; # $self->catdir('Encode');
my $str = "# $name\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
$str .= "$name.c : $name.xs ";
foreach my $table (keys %tables)
$str .= "$name\$(OBJ_EXT) : $name.c\n\n";
foreach my $table (keys %tables)
my $lengthsofar = length($str);
$str .= "$table.c : Makefile.PL";
foreach my $file (@{$tables{$table}})
$str .= $continuator.' '.$self->catfile($dir,$file);
if ( length($str)-$lengthsofar > 128*$numlines )
$continuator .= " \\\n\t";
my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
open (FILELIST, ">$table.fnm")
|| die "Could not open $table.fnm: $!";
foreach my $file (@{$tables{$table}})
print FILELIST $self->catfile($dir,$file) . "\n";