This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The non-MakeMaker.pm parts of
[perl5.git] / ext / SDBM_File / sdbm / Makefile.PL
CommitLineData
42793c05 1use ExtUtils::MakeMaker;
137443ea 2
85c35b1b 3my $define = '-DSDBM -DDUFF';
9c293c15 4$define .= ' -DWIN32 -DPERL_STATIC_SYMS' if ($^O eq 'MSWin32');
137443ea 5
17f28c40
CB
6if ($^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 11WriteMakefile(
ba14e5f0 12 NAME => 'sdbm', # (doesn't matter what the name is here) oh yes it does
bf99883d 13# LINKTYPE => 'static',
137443ea 14 DEFINE => $define,
4dcba783 15 INC => '-I$(PERL_INC)', # force PERL_INC dir ahead of system -I's
17f28c40
CB
16 INST_ARCHLIB => '.',
17 SKIP => [qw(dynamic dynamic_lib dlsyms)],
18 OBJECT => '$(O_FILES)',
74767600
PP
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)]
42793c05
TB
22);
23
b2b3adea
HM
24sub MY::constants {
25 package MY;
26 my $r = shift->SUPER::constants();
27 if ($^O eq 'VMS') {
28 $r =~ s/^INST_STATIC =.*$/INST_STATIC = libsdbm\$(LIB_EXT)/m
29 }
30 return $r;
31}
32
137443ea 33sub MY::post_constants {
b2b3adea
HM
34 package MY;
35 if ($^O eq 'VMS') {
36 shift->SUPER::post_constants();
37 } else {
137443ea
PP
38'
39INST_STATIC = libsdbm$(LIB_EXT)
40'
b2b3adea 41 }
137443ea 42}
42793c05
TB
43
44sub MY::top_targets {
2c08089c
GS
45 my $noecho = shift->{NOECHO};
46
ffea5178 47 my $r = '
42793c05 48all :: static
2c08089c 49 ' . $noecho . '$(NOOP)
42793c05 50
42793c05 51config ::
2c08089c 52 ' . $noecho . '$(NOOP)
42793c05
TB
53
54lint:
55 lint -abchx $(LIBSRCS)
02c45c47 56
ffea5178
DS
57';
58 $r .= '
02c45c47
GS
59# This is a workaround, the problem is that our old GNU make exports
60# variables into the environment so $(MYEXTLIB) is set in here to this
61# value which can not be built.
62sdbm/libsdbm.a:
2c08089c 63 ' . $noecho . '$(NOOP)
ffea5178
DS
64' unless $^O eq 'VMS';
65
66 return $r;
42793c05 67}