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!
17 my $enc2xs = '$_Enc2xs_';
20 #### END_OF_HEADER -- DO NOT EDIT THIS LINE BY HAND! ####
21 NAME => 'Encode::'.$name,
22 VERSION_FROM => "$name.pm",
23 OBJECT => '$(O_FILES)',
25 COMPRESS => 'gzip -9f',
27 DIST_DEFAULT => 'all tardist',
30 # OS 390 winges about line numbers > 64K ???
31 XSOPT => '-nolinenumbers',
40 my $x = $self->{'OBJ_EXT'};
41 # Add the table O_FILES
42 foreach my $e (keys %tables)
47 $self->{'O_FILES'} = [sort keys %o];
48 my @files = ("$name.xs");
49 $self->{'C'} = ["$name.c"];
50 # $self->{'H'} = [$self->catfile($self->updir,'encode.h')];
52 foreach my $table (keys %tables) {
53 push (@{$self->{'C'}},"$table.c");
54 # Do NOT add $table.h etc. to H_FILES unless we own up as to how they
56 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm)) {
57 push (@files,$table.$ext);
60 $self->{'XS'} = { "$name.xs" => "$name.c" };
61 $self->{'clean'}{'FILES'} .= join(' ',@files);
62 open(XS,">$name.xs") || die "Cannot open $name.xs:$!";
70 foreach my $table (keys %tables) {
71 print XS qq[#include "${table}.h"\n];
76 Encode_XSEncoding(pTHX_ encode_t *enc)
79 HV *stash = gv_stashpv("Encode::XS", TRUE);
80 SV *sv = sv_bless(newRV_noinc(newSViv(PTR2IV(enc))),stash);
86 const char *name = enc->name[i++];
87 XPUSHs(sv_2mortal(newSVpvn(name,strlen(name))));
90 call_pv("Encode::define_encoding",G_DISCARD);
94 MODULE = Encode::$name PACKAGE = Encode::$name
99 foreach my $table (keys %tables) {
100 print XS qq[#include "${table}.exh"\n];
104 return "# Built $name.xs\n\n";
110 my $dir = "."; # $self->catdir('Encode');
111 my $str = "# $name\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
112 $str .= "$name.c : $name.xs ";
113 foreach my $table (keys %tables)
118 $str .= "$name\$(OBJ_EXT) : $name.c\n\n";
120 foreach my $table (keys %tables)
123 my $lengthsofar = length($str);
124 my $continuator = '';
125 $str .= "$table.c : Makefile.PL";
126 foreach my $file (@{$tables{$table}})
128 $str .= $continuator.' '.$self->catfile($dir,$file);
129 if ( length($str)-$lengthsofar > 128*$numlines )
131 $continuator .= " \\\n\t";
137 my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
140 qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
141 open (FILELIST, ">$table.fnm")
142 || die "Could not open $table.fnm: $!";
143 foreach my $file (@{$tables{$table}})
145 print FILELIST $self->catfile($dir,$file) . "\n";