2 use ExtUtils::MakeMaker;
5 unless($ENV{PERL_CORE}) {
6 $ENV{PERL_CORE} = 1 if ($^X =~ m{\bminiperl[^/\\\]>:]*$}o);
11 def_t => ['ascii.ucm',
18 my @exe_files = qw(bin/enc2xs
21 my @more_exe_files = qw(
24 my @pmlibdirs = qw(lib Encode);
26 if ($arg eq "MORE_SCRIPTS"){
27 push @exe_files, @more_exe_files;
29 if ($arg eq "INSTALL_UCM"){
30 push @pmlibdirs, "ucm";
36 EXE_FILES => \@exe_files,
37 VERSION_FROM => 'Encode.pm',
38 OBJECT => '$(O_FILES)',
40 COMPRESS => 'gzip -9f',
42 DIST_DEFAULT => 'all tardist',
46 PMLIBDIRS => \@pmlibdirs,
47 INSTALLDIRS => 'perl',
57 # Find existing O_FILES
58 foreach my $f (@{$self->{'O_FILES'}})
62 my $x = $self->{'OBJ_EXT'};
63 # Add the table O_FILES
64 foreach my $e (keys %tables)
68 # Trick case-blind filesystems.
69 delete $o{'encode'.$x};
72 $self->{'O_FILES'} = [sort keys %o];
74 foreach my $table (keys %tables)
76 foreach my $ext (qw($(OBJ_EXT) .c .h .exh .fnm))
78 push (@files,$table.$ext);
80 $self->{SOURCE} .= " $table.c"
81 if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$table\.c\b/;
83 $self->{'clean'}{'FILES'} .= join(' ',@files);
90 my $dir = $self->catdir($self->curdir,'ucm');
91 my $str = "# Encode\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n";
92 $str .= $^O eq 'MacOS' ? 'Encode.c.{$(MACPERL_BUILD_EXT_STATIC)}.o :' : 'Encode$(OBJ_EXT) :';
93 foreach my $table (keys %tables)
98 foreach my $table (keys %tables)
101 my $lengthsofar = length($str);
102 my $continuator = '';
103 my $enc2xs = $self->catfile('bin', 'enc2xs');
104 $str .= "$table.c : $enc2xs Makefile.PL";
105 foreach my $file (@{$tables{$table}})
107 $str .= $continuator.' '.$self->catfile($dir,$file);
108 if ( length($str)-$lengthsofar > 128*$numlines )
110 $continuator .= " \\\n\t";
116 my $plib = $self->{PERL_CORE} ? '"-I$(PERL_LIB)"' : '';
117 $plib .= " -MCross=$::Cross::platform" if defined $::Cross::platform;
118 my $ucopts = '-"Q" -"O"';
120 qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n};
121 open (FILELIST, ">$table.fnm")
122 || die "Could not open $table.fnm: $!";
123 foreach my $file (@{$tables{$table}})
125 print FILELIST $self->catfile($dir,$file) . "\n";