MM hackery and whitespace changes
[p5sagit/p5-mst-13.2.git] / ext / SDBM_File / sdbm / Makefile.PL
1 use ExtUtils::MakeMaker;
2
3 my $define = '-DSDBM -DDUFF';
4 $define .= ' -DWIN32 -DPERL_STATIC_SYMS' if ($^O eq 'MSWin32');
5
6 if ($^O eq 'VMS') {  # Old VAXC compiler can't handle Duff's device
7     require Config;
8     $define =~ s/\s+-DDUFF// if $Config::Config{'vms_cc_type'} eq 'vaxc';
9 }
10
11 WriteMakefile(
12     NAME      => 'sdbm', # (doesn't matter what the name is here) oh yes it does
13 #    LINKTYPE  => 'static',
14     DEFINE    => $define,
15     INC       => '-I$(PERL_INC)', # force PERL_INC dir ahead of system -I's
16     INST_ARCHLIB => '.',
17     SKIP      => [qw(dynamic dynamic_lib dlsyms)],
18     OBJECT    => '$(O_FILES)',
19     clean     => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'},
20     H         => [qw(tune.h sdbm.h pair.h $(PERL_INC)/config.h)],
21     C         => [qw(sdbm.c pair.c hash.c)]
22 );
23
24 sub MY::constants {
25     package MY;
26     my $self = shift;
27
28     $self->{INST_STATIC} = 'libsdbm$(LIB_EXT)';
29
30     return $self->SUPER::constants();
31 }
32
33 sub MY::top_targets {
34     my $r = '
35 all :: static
36         $(NOECHO) $(NOOP)
37
38 config ::
39         $(NOECHO) $(NOOP)
40
41 lint:
42         lint -abchx $(LIBSRCS)
43
44 ';
45     $r .= '
46 # This is a workaround, the problem is that our old GNU make exports
47 # variables into the environment so $(MYEXTLIB) is set in here to this
48 # value which can not be built.
49 sdbm/libsdbm.a:
50         $(NOECHO) $(NOOP)
51 ' unless $^O eq 'VMS';
52
53     return $r;
54 }