1 use ExtUtils::MakeMaker;
3 # This code for XS-NOXS installer is shamelessly stolen
4 # after Gurusamy Sarathy's Data::Dumper. Thank you!
10 my $arg = $ARGV[0] || "";
12 if ($arg =~ /^no/i and -f "Normalize.xs") {
13 print STDERR "Disabling XS in sources...\n";
15 die "***** Failed, sources could be inconsistent! *****\n"
16 unless File::Copy::move('MANIFEST', 'MANIFEST.XS')
17 and File::Copy::move('MANIFEST.NXS', 'MANIFEST')
18 and File::Copy::move('Normalize.pm', 'Normalize.pm.XS')
19 and File::Copy::move('Normalize.xs', 'Normalize.xs.XS')
20 and File::Copy::move('Normalize.pm.NXS','Normalize.pm');
22 if ($arg =~ /^xs/i and -f "Normalize.xs.XS") {
23 print STDERR "Enabling XS in sources...\n";
25 die "***** Failed, sources could be inconsistent! *****\n"
26 unless File::Copy::move('MANIFEST', 'MANIFEST.NXS')
27 and File::Copy::move('MANIFEST.XS', 'MANIFEST')
28 and File::Copy::move('Normalize.pm', 'Normalize.pm.NXS')
29 and File::Copy::move('Normalize.xs.XS', 'Normalize.xs')
30 and File::Copy::move('Normalize.pm.XS', 'Normalize.pm');
35 if (-f "Normalize.xs") {
36 print STDERR "Making header files for XS...\n";
39 $clean = { FILES => 'unfcan.h unfcmb.h unfcmp.h unfcpt.h unfexc.h' };
43 'INSTALLDIRS' => $] > 5.007 ? 'perl' : 'site',
44 'NAME' => 'Unicode::Normalize',
45 'VERSION_FROM' => 'Normalize.pm', # finds $VERSION