2 use ExtUtils::MakeMaker;
5 unless($ENV{PERL_CORE}) {
6 $ENV{PERL_CORE} = 1 if ($^X =~ m{\bminiperl[^/\\\]>:]*$}o);
11 def_t => ['ascii.ucm',
16 my @exe_files = qw(bin/enc2xs
19 my @more_exe_files = qw(
22 my @pmlibdirs = qw(lib Encode);
24 if ($arg eq "MORE_SCRIPTS"){
25 push @exe_files, @more_exe_files;
27 if ($arg eq "INSTALL_UCM"){
28 push @pmlibdirs, "ucm";
34 EXE_FILES => \@exe_files,
35 VERSION_FROM => 'Encode.pm',
36 OBJECT => '$(O_FILES)',
38 COMPRESS => 'gzip -9f',
40 DIST_DEFAULT => 'all tardist',
44 PMLIBDIRS => \@pmlibdirs,
45 INSTALLDIRS => 'perl',
55 # Find existing O_FILES
56 foreach my $f (@{$self->{'O_FILES'}})
60 my $x = $self->{'OBJ_EXT'};
61 # Add the table O_FILES
62 foreach my $e (keys %tables)
66 # Trick case-blind filesystems.
67 delete $o{'encode'.$x};
70 $self->{'O_FILES'} = [sort keys %o];
72 foreach my $table (keys %tables)
74 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm))
76 push (@files,$table.$ext);
79 $self->{'clean'}{'FILES'} .= join(' ',@files);
86 my $dir = $self->catdir($self->curdir,'ucm');
87 my $str = "# Encode\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
88 $str .= 'Encode$(OBJ_EXT) :';
89 foreach my $table (keys %tables)
94 foreach my $table (keys %tables)
97 my $lengthsofar = length($str);
99 my $enc2xs = $self->catfile('bin', 'enc2xs');
100 $str .= "$table.c : $enc2xs Makefile.PL";
101 foreach my $file (@{$tables{$table}})
103 $str .= $continuator.' '.$self->catfile($dir,$file);
104 if ( length($str)-$lengthsofar > 128*$numlines )
106 $continuator .= " \\\n\t";
112 my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
113 $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform;
114 my $ucopts = '-"Q" -"O"';
116 qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
117 open (FILELIST, ">$table.fnm")
118 || die "Could not open $table.fnm: $!";
119 foreach my $file (@{$tables{$table}})
121 print FILELIST $self->catfile($dir,$file) . "\n";