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