This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add a "hash quality score" to Hash::Util::bucket_stats()
[perl5.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     NAME            => "Hash::Util",
9     DEFINE          => "-DPERL_EXT",
10 );
11
12 package MY;
13
14 # We go through the HashUtil.c trickery to foil platforms
15 # that have the feature combination of
16 # (1) static builds
17 # (2) allowing only one object by the same name in the static library
18 # (3) the object name matching being case-blind
19 # This means that we can't have the top-level util.o
20 # and the extension-level Util.o in the same build.
21 # One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
22
23 BEGIN {
24     use Config;
25     unless (defined $Config{usedl}) {
26         eval <<'__EOMM__';
27 sub xs_c {
28     my($self) = shift;
29     return '' unless $self->needs_linking();
30 '
31 HashUtil.c:     Util.xs
32         $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) Util.xs > HashUtil.xsc && $(MV) HashUtil.xsc HashUtil.c
33 ';
34 }
35
36 sub xs_o {
37     my($self) = shift;
38     return '' unless $self->needs_linking();
39 '
40
41 Util$(OBJ_EXT): HashUtil.c
42         $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) HashUtil.c
43         $(MV) HashUtil$(OBJ_EXT) Util$(OBJ_EXT)
44 ';
45 }
46
47 __EOMM__
48     }
49 }