Update to Encode 2.32
[p5sagit/p5-mst-13.2.git] / ext / Hash-Util / Makefile.PL
1 use ExtUtils::MakeMaker;
2
3 # this file was templated from ext/List/Util/Makefile.PL
4 # thanks to Graham Barr who wrote that module.
5
6 WriteMakefile(
7     VERSION_FROM    => "lib/Hash/Util.pm",
8     MAN3PODS        => {},  # Pods will be built by installman.
9     NAME            => "Hash::Util",
10     DEFINE          => "-DPERL_EXT",
11     NORECURS        => 1, # Hash::Util::FieldHash is treated as distinct.
12 );
13
14 package MY;
15
16 # We go through the HashUtil.c trickery to foil platforms
17 # that have the feature combination of
18 # (1) static builds
19 # (2) allowing only one object by the same name in the static library
20 # (3) the object name matching being case-blind
21 # This means that we can't have the top-level util.o
22 # and the extension-level Util.o in the same build.
23 # One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
24
25 BEGIN {
26     use Config;
27     unless (defined $Config{usedl}) {
28         eval <<'__EOMM__';
29 sub xs_c {
30     my($self) = shift;
31     return '' unless $self->needs_linking();
32 '
33 HashUtil.c:     Util.xs
34         $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) Util.xs > HashUtil.xsc && $(MV) HashUtil.xsc HashUtil.c
35 ';
36 }
37
38 sub xs_o {
39     my($self) = shift;
40     return '' unless $self->needs_linking();
41 '
42
43 Util$(OBJ_EXT): HashUtil.c
44         $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) HashUtil.c
45         $(MV) HashUtil$(OBJ_EXT) Util$(OBJ_EXT)
46 ';
47 }
48
49 __EOMM__
50     }
51 }