Upgrade to Unicode::Normalize 0.22.
[p5sagit/p5-mst-13.2.git] / ext / Unicode / Normalize / Makefile.PL
1 use ExtUtils::MakeMaker;
2
3 # This code for XS-NOXS installer is shamelessly stolen
4 # after Gurusamy Sarathy's Data::Dumper. Thank you!
5
6 # a bit modified.
7
8 use File::Copy qw();
9
10 my $arg = $ARGV[0] || "";
11
12 if ($arg =~ /^no/i and -f "Normalize.xs") {
13     print STDERR "Disabling XS in sources...\n";
14
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');
21 }
22 if ($arg =~ /^xs/i and -f "Normalize.xs.XS") {
23     print STDERR "Enabling XS in sources...\n";
24
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');
31 }
32
33 my $clean = {};
34
35 if (-f "Normalize.xs") {
36     print STDERR "Making header files for XS...\n";
37
38     do "mkheader";
39     $clean = { FILES => 'unfcan.h unfcmb.h unfcmp.h unfcpt.h unfexc.h' };
40 }
41
42 WriteMakefile(
43     'INSTALLDIRS'       => $] > 5.007 ? 'perl' : 'site',
44     'NAME'              => 'Unicode::Normalize',
45     'VERSION_FROM'      => 'Normalize.pm', # finds $VERSION
46     'clean'             => $clean,
47 );