Commit | Line | Data |
ac5ea531 |
1 | use ExtUtils::MakeMaker; |
2 | |
1efaba7f |
3 | # This code for XS-NOXS installer is shamelessly stolen |
4 | # after Gurusamy Sarathy's Data::Dumper. Thank you! |
ac5ea531 |
5 | |
1efaba7f |
6 | # a bit modified. |
ac5ea531 |
7 | |
1efaba7f |
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'); |
9fdbfc11 |
21 | } |
1efaba7f |
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'); |
9fdbfc11 |
31 | } |
1efaba7f |
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' }; |
9fdbfc11 |
40 | } |
41 | |
ac5ea531 |
42 | WriteMakefile( |
1efaba7f |
43 | 'INSTALLDIRS' => $] > 5.007 ? 'perl' : 'site', |
ac5ea531 |
44 | 'NAME' => 'Unicode::Normalize', |
45 | 'VERSION_FROM' => 'Normalize.pm', # finds $VERSION |
1efaba7f |
46 | 'clean' => $clean, |
ac5ea531 |
47 | ); |