Cleaner.
[p5sagit/p5-mst-13.2.git] / ext / I18N / Langinfo / Makefile.PL
CommitLineData
4bbcc6e8 1use ExtUtils::MakeMaker;
2# See lib/ExtUtils/MakeMaker.pm for details of how to influence
3# the contents of the Makefile that is written.
4WriteMakefile(
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
9a7df4f2 16 # Without this the constants xs files are spotted, and cause rules to be
17 # added to delete the similarly named C files, which isn't what we want.
18 XS => {'Langinfo.xs' => 'Langinfo.c'},
19 realclean => {FILES=> 'constants.c constants.xs'},
4bbcc6e8 20 # Un-comment this if you add C files to link with later:
21 # 'OBJECT' => '$(O_FILES)', # link all the C files too
22);
9a7df4f2 23if (eval {require ExtUtils::Constant; 1}) {
4c1bac79 24 # Some older versions of glibc use only enums, no defines, hence all this
25 # hassle (so old glibc that the define is GNU_LIBRARY, not GLIBC):
26 my @names = 'CODESET'; # CODESET isn't an enum in old glibc's langinfo.h
27 push @names, # This lot are always enums in old langinfo.h:
28 {name=>$_, type=>"IV",
29 macro=>["#if defined($_) || (defined(__GNU_LIBRARY__) && defined(_NL_ITEM))\n",
30 "#endif\n"]}
31 foreach qw (ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7
9a7df4f2 32 ABMON_1 ABMON_10 ABMON_11 ABMON_12 ABMON_2 ABMON_3 ABMON_4
33 ABMON_5 ABMON_6 ABMON_7 ABMON_8 ABMON_9 ALT_DIGITS AM_STR
4c1bac79 34 DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7 D_FMT D_T_FMT ERA
35 ERA_D_FMT ERA_D_T_FMT ERA_T_FMT MON_1 MON_10 MON_11 MON_12
36 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 NOEXPR NOSTR
37 PM_STR T_FMT T_FMT_AMPM YESEXPR YESSTR);
38 push @names, # This lot are only enums for __SVR4_I386_ABI_L1__:
39 {name=>$_, type=>"IV",
40 macro=>["#if defined($_) || (defined(__GNU_LIBRARY__) && defined(_NL_ITEM) && defined(__SVR4_I386_ABI_L1__))\n",
41 "#endif\n"]}
42 foreach qw (CRNCYSTR THOUSEP RADIXCHAR);
9a7df4f2 43 ExtUtils::Constant::WriteConstants(
44 NAME => 'I18N::Langinfo',
45 NAMES => \@names,
46 );
47} else {
48 use File::Copy;
49 copy ('fallback.c', 'constants.c')
50 or die "Can't copy fallback.c to constants.c: $!";
51 copy ('fallback.xs', 'constants.xs')
52 or die "Can't copy fallback.xs to constants.xs: $!";
53}