2 # This file is auto-generated by:
3 # enc2xs version $_Version_
8 use ExtUtils::MakeMaker;
10 # Please edit the following to the taste!
13 $_Name__t => [ $_TableFiles_ ],
16 #### DO NOT EDIT BEYOND THIS POINT!
18 my ($enc2xs, $encode_h) = ();
20 for my $d (split /:/, $ENV{PATH}){
21 for my $f (qw/enc2xs enc2xs5.7.3/){
22 my $path = File::Spec->catfile($d, $f);
23 -x $path and $enc2xs = $path and last PATHLOOP;
26 $enc2xs or die "enc2xs not found!";
27 print "enc2xs is $enc2xs\n";
30 my $dir = File::Spec->catfile($d, "Encode");
31 my $file = File::Spec->catfile($dir, "encode.h");
32 -f $file and $encode_h{$dir} = -M $file;
34 %encode_h or die "encode.h not found!";
36 ($encode_h) = sort {$encode_h{$b} <=> $encode_h{$a}} keys %encode_h;
37 print "encode.h is at $encode_h\n";
41 #### END_OF_HEADER -- DO NOT EDIT THIS LINE BY HAND! ####
42 NAME => 'Encode::'.$name,
43 VERSION_FROM => "$name.pm",
44 OBJECT => '$(O_FILES)',
46 COMPRESS => 'gzip -9f',
48 DIST_DEFAULT => 'all tardist',
54 # OS 390 winges about line numbers > 64K ???
55 XSOPT => '-nolinenumbers',
64 my $x = $self->{'OBJ_EXT'};
65 # Add the table O_FILES
66 foreach my $e (keys %tables)
71 $self->{'O_FILES'} = [sort keys %o];
72 my @files = ("$name.xs");
73 $self->{'C'} = ["$name.c"];
74 # $self->{'H'} = [$self->catfile($self->updir,'encode.h')];
76 foreach my $table (keys %tables) {
77 push (@{$self->{'C'}},"$table.c");
78 # Do NOT add $table.h etc. to H_FILES unless we own up as to how they
80 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) {
81 push (@files,$table.$ext);
84 $self->{'XS'} = { "$name.xs" => "$name.c" };
85 $self->{'clean'}{'FILES'} .= join(' ',@files);
86 open(XS,">$name.xs") || die "Cannot open $name.xs:$!";
94 foreach my $table (keys %tables) {
95 print XS qq[#include "${table}.h"\n];
100 Encode_XSEncoding(pTHX_ encode_t *enc)
103 HV *stash = gv_stashpv("Encode::XS", TRUE);
104 SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
110 const char *name = enc->name[i++];
111 XPUSHs(sv_2mortal(newSVpvn(name,strlen(name))));
114 call_pv("Encode::define_encoding",G_DISCARD);
118 MODULE = Encode::$name PACKAGE = Encode::$name
123 foreach my $table (keys %tables) {
124 print XS qq[#include "${table}.exh"\n];
128 return "# Built $name.xs\n\n";
134 my $dir = "."; # $self->catdir('Encode');
135 my $str = "# $name\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
136 $str .= "$name.c : $name.xs ";
137 foreach my $table (keys %tables)
142 $str .= "$name\$(OBJ_EXT) : $name.c\n\n";
144 foreach my $table (keys %tables)
147 my $lengthsofar = length($str);
148 my $continuator = '';
149 $str .= "$table.c : Makefile.PL";
150 foreach my $file (@{$tables{$table}})
152 $str .= $continuator.' '.$self->catfile($dir,$file);
153 if ( length($str)-$lengthsofar > 128*$numlines )
155 $continuator .= " \\\n\t";
161 my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
164 qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
165 open (FILELIST, ">$table.fnm")
166 || die "Could not open $table.fnm: $!";
167 foreach my $file (@{$tables{$table}})
169 print FILELIST $self->catfile($dir,$file) . "\n";