This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix bug [perl #24641] : when POSIX::set[ug]id() are called,
[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
05106a66 13 LINKTYPE => 'static',
137443ea 14 DEFINE => $define,
4dcba783 15 INC => '-I$(PERL_INC)', # force PERL_INC dir ahead of system -I's
17f28c40 16 OBJECT => '$(O_FILES)',
74767600 17 clean => {'FILES' => 'dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag'},
18 H => [qw(tune.h sdbm.h pair.h $(PERL_INC)/config.h)],
19 C => [qw(sdbm.c pair.c hash.c)]
42793c05
TB
20);
21
5ea525d0
MS
22
23package MY;
24sub constants {
3a91618c
MS
25 my $self = shift;
26
27 $self->{INST_STATIC} = 'libsdbm$(LIB_EXT)';
b2b3adea 28
3a91618c 29 return $self->SUPER::constants();
137443ea 30}
42793c05 31
5ea525d0
MS
32sub top_targets {
33 my $self = shift;
47598e24 34 return $self->SUPER::top_targets if $^O eq 'VMS';
ffea5178 35 my $r = '
42793c05 36all :: static
3a91618c 37 $(NOECHO) $(NOOP)
42793c05 38
42793c05
TB
39lint:
40 lint -abchx $(LIBSRCS)
02c45c47
GS
41
42# This is a workaround, the problem is that our old GNU make exports
43# variables into the environment so $(MYEXTLIB) is set in here to this
44# value which can not be built.
45sdbm/libsdbm.a:
3a91618c 46 $(NOECHO) $(NOOP)
47598e24 47';
ffea5178 48
5ea525d0 49 return $r . $self->SUPER::top_targets;
42793c05 50}