3 use ExtUtils::MakeMaker;
7 8859 => ['ascii.ucm', 'koi8-r.ucm', 'viscii.ucm',
8 'ibm-1250.ucm', 'ibm-1251.ucm',
9 'ibm-1253.ucm', 'ibm-1254.ucm',
10 'ibm-1255.ucm', 'ibm-1256.ucm',
11 'ibm-1257.ucm', 'ibm-1258.ucm',
13 qw(macCentEuro.enc macCroatian.enc
14 macCyrillic.enc macDingbats.enc
15 macGreek.enc macIceland.enc
16 macRoman.enc macRumanian.enc
17 macSami.enc macThai.enc
18 macTurkish.enc macUkraine.enc),
20 EBCDIC => ['cp1047.ucm','cp37.ucm','posix-bc.ucm'],
21 Symbols => ['symbol.ucm','dingbats.ucm'],
24 opendir(ENC,'Encode');
25 while (defined(my $file = readdir(ENC)))
27 if ($file =~ /8859.*\.ucm/)
29 push(@{$tables{8859}},$file);
37 VERSION_FROM => 'Encode.pm',
38 OBJECT => '$(O_FILES)',
40 COMPRESS => 'gzip -9f',
42 DIST_DEFAULT => 'all tardist',
54 # Find existing O_FILES
55 foreach my $f (@{$self->{'O_FILES'}})
59 my $x = $self->{'OBJ_EXT'};
60 # Add the table O_FILES
61 foreach my $e (keys %tables)
65 # Trick case-blind filesystems.
66 delete $o{'encode'.$x};
69 $self->{'O_FILES'} = [sort keys %o];
71 foreach my $table (keys %tables)
73 foreach my $ext (qw($(OBJ_EXT) .c .h _def.h .fnm))
75 push (@files,$table.$ext);
78 $self->{'clean'}{'FILES'} .= join(' ',@files);
85 my $dir = $self->catdir($self->curdir,'Encode');
86 my $str = "# Encode\$(OBJ_EXT) depends on .h and _def.h files not .c files - but all written by compile\n";
87 $str .= 'Encode$(OBJ_EXT) :';
88 foreach my $table (keys %tables)
93 foreach my $table (keys %tables)
96 my $lengthsofar = length($str);
98 $str .= "$table.c : compile Makefile.PL";
99 foreach my $file (@{$tables{$table}})
101 $str .= $continuator.' '.$self->catfile($dir,$file);
102 if ( length($str)-$lengthsofar > 128*$numlines )
104 $continuator .= " \\\n\t";
110 $str .= $^O eq 'VMS' # In VMS quote to preserve case
111 ? qq{\n\t\$(PERL) compile -"Q" -"O" -o \$\@ -f $table.fnm\n\n}
112 : qq{\n\t\$(PERL) compile -Q -O -o \$\@ -f $table.fnm\n\n};
113 open (FILELIST, ">$table.fnm")
114 || die "Could not open $table.fnm: $!";
115 foreach my $file (@{$tables{$table}})
117 print FILELIST $self->catfile($dir,$file) . "\n";