Commit | Line | Data |
4bbcc6e8 |
1 | use ExtUtils::MakeMaker; |
2 | # See lib/ExtUtils/MakeMaker.pm for details of how to influence |
3 | # the contents of the Makefile that is written. |
4 | WriteMakefile( |
5 | 'NAME' => 'I18N::Langinfo', |
6 | 'VERSION_FROM' => 'Langinfo.pm', # finds $VERSION |
7 | 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 |
8 | ($] >= 5.005 ? ## Add these new keywords supported since 5.005 |
9 | (ABSTRACT_FROM => 'Langinfo.pm', # retrieve abstract from module |
10 | AUTHOR => 'Jarkko Hietaniemi <jhi@hut.fi>') : ()), |
11 | 'LIBS' => [''], # e.g., '-lm' |
12 | 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' |
13 | # Insert -I. if you add *.h files later: |
14 | 'INC' => '', # e.g., '-I/usr/include/other' |
0665918f |
15 | 'MAN3PODS' => {}, # Pods will be built by installman |
ece2ffd9 |
16 | realclean => {FILES=> 'const-c.inc const-xs.inc'}, |
4bbcc6e8 |
17 | # Un-comment this if you add C files to link with later: |
18 | # 'OBJECT' => '$(O_FILES)', # link all the C files too |
19 | ); |
9a7df4f2 |
20 | if (eval {require ExtUtils::Constant; 1}) { |
4c1bac79 |
21 | # Some older versions of glibc use only enums, no defines, hence all this |
22 | # hassle (so old glibc that the define is GNU_LIBRARY, not GLIBC): |
23 | my @names = 'CODESET'; # CODESET isn't an enum in old glibc's langinfo.h |
24 | push @names, # This lot are always enums in old langinfo.h: |
25 | {name=>$_, type=>"IV", |
26 | macro=>["#if defined($_) || (defined(__GNU_LIBRARY__) && defined(_NL_ITEM))\n", |
27 | "#endif\n"]} |
28 | foreach qw (ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7 |
9a7df4f2 |
29 | ABMON_1 ABMON_10 ABMON_11 ABMON_12 ABMON_2 ABMON_3 ABMON_4 |
30 | ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ALT_DIGITS AM_STR |
4c1bac79 |
31 | DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 D_FMT D_T_FMT ERA |
32 | ERA_D_FMT ERA_D_T_FMT ERA_T_FMT MON_1 MON_10 MON_11 MON_12 |
33 | MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 NOEXPR NOSTR |
34 | PM_STR T_FMT T_FMT_AMPM YESEXPR YESSTR); |
35 | push @names, # This lot are only enums for __SVR4_I386_ABI_L1__: |
36 | {name=>$_, type=>"IV", |
37 | macro=>["#if defined($_) || (defined(__GNU_LIBRARY__) && defined(_NL_ITEM) && defined(__SVR4_I386_ABI_L1__))\n", |
38 | "#endif\n"]} |
39 | foreach qw (CRNCYSTR THOUSEP RADIXCHAR); |
9a7df4f2 |
40 | ExtUtils::Constant::WriteConstants( |
41 | NAME => 'I18N::Langinfo', |
42 | NAMES => \@names, |
43 | ); |
44 | } else { |
45 | use File::Copy; |
1cb0fb50 |
46 | use File::Spec; |
47 | foreach my $file ('const-c.inc', 'const-xs.inc') { |
48 | my $fallback = File::Spec->catfile('fallback', $file); |
49 | copy ($fallback, $file) or die "Can't copy $fallback to $file: $!"; |
50 | } |
9a7df4f2 |
51 | } |