Commit | Line | Data |
---|---|---|
42793c05 | 1 | use ExtUtils::MakeMaker; |
137443ea | 2 | |
85c35b1b | 3 | my $define = '-DSDBM -DDUFF'; |
9c293c15 | 4 | $define .= ' -DWIN32 -DPERL_STATIC_SYMS' if ($^O eq 'MSWin32'); |
137443ea | 5 | |
17f28c40 | 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 | ||
42793c05 | 11 | WriteMakefile( |
ba14e5f0 | 12 | NAME => 'sdbm', # (doesn't matter what the name is here) oh yes it does |
3e9d3e5b | 13 | # LINKTYPE => 'static', |
137443ea | 14 | DEFINE => $define, |
4dcba783 | 15 | INC => '-I$(PERL_INC)', # force PERL_INC dir ahead of system -I's |
3e9d3e5b | 16 | SKIP => [qw(dynamic dynamic_lib dlsyms)], |
17f28c40 | 17 | OBJECT => '$(O_FILES)', |
74767600 | 18 | clean => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'}, |
19 | H => [qw(tune.h sdbm.h pair.h $(PERL_INC)/config.h)], | |
20 | C => [qw(sdbm.c pair.c hash.c)] | |
42793c05 | 21 | ); |
22 | ||
3e9d3e5b | 23 | sub MY::constants { |
24 | package MY; | |
3a91618c | 25 | my $self = shift; |
26 | ||
27 | $self->{INST_STATIC} = 'libsdbm$(LIB_EXT)'; | |
b2b3adea | 28 | |
3a91618c | 29 | return $self->SUPER::constants(); |
137443ea | 30 | } |
42793c05 | 31 | |
3e9d3e5b | 32 | sub MY::top_targets { |
ffea5178 | 33 | my $r = ' |
42793c05 | 34 | all :: static |
3a91618c | 35 | $(NOECHO) $(NOOP) |
42793c05 | 36 | |
3e9d3e5b | 37 | config :: |
38 | $(NOECHO) $(NOOP) | |
39 | ||
42793c05 | 40 | lint: |
41 | lint -abchx $(LIBSRCS) | |
02c45c47 | 42 | |
3e9d3e5b | 43 | '; |
44 | $r .= ' | |
02c45c47 | 45 | # This is a workaround, the problem is that our old GNU make exports |
46 | # variables into the environment so $(MYEXTLIB) is set in here to this | |
47 | # value which can not be built. | |
48 | sdbm/libsdbm.a: | |
3a91618c | 49 | $(NOECHO) $(NOOP) |
3e9d3e5b | 50 | ' unless $^O eq 'VMS'; |
ffea5178 | 51 | |
3e9d3e5b | 52 | return $r; |
42793c05 | 53 | } |