X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FSDBM_File%2Fsdbm%2FMakefile.PL;h=4453dea1fda16170ed770ed35785a5250714d2f4;hb=e5a4bac510f9fafa6e02bed759aee3582bb87d6a;hp=b4bd6f9549ffa5029342456ee4245b755623b191;hpb=1adb159c9e6f4ac956dc944251da05cb1fe521ec;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/SDBM_File/sdbm/Makefile.PL b/ext/SDBM_File/sdbm/Makefile.PL index b4bd6f9..4453dea 100644 --- a/ext/SDBM_File/sdbm/Makefile.PL +++ b/ext/SDBM_File/sdbm/Makefile.PL @@ -1,29 +1,67 @@ use ExtUtils::MakeMaker; + +$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_File', - 'LINKTYPE' => 'static', - 'DEFINE' => '-DSDBM -DDUFF', - 'SKIP' => [qw(static static_lib dynamic dynamic_lib)], - '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)] + 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 + INST_ARCHLIB => '.', + SKIP => [qw(dynamic dynamic_lib dlsyms)], + 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)] ); +sub MY::constants { + package MY; + my $r = shift->SUPER::constants(); + if ($^O eq 'VMS') { + $r =~ s/^INST_STATIC =.*$/INST_STATIC = libsdbm\$(LIB_EXT)/m + } + return $r; +} + +sub MY::post_constants { + package MY; + if ($^O eq 'VMS') { + shift->SUPER::post_constants(); + } else { +' +INST_STATIC = libsdbm$(LIB_EXT) +' + } +} sub MY::top_targets { - ' + my $noecho = shift->{NOECHO}; + + my $r = ' all :: static - -static :: libsdbm$(LIB_EXT) + ' . $noecho . '$(NOOP) config :: - -libsdbm$(LIB_EXT): $(O_FILES) - $(AR) cr libsdbm$(LIB_EXT) $(O_FILES) - $(RANLIB) libsdbm$(LIB_EXT) + ' . $noecho . '$(NOOP) lint: lint -abchx $(LIBSRCS) + '; + $r .= ' +# 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) +' unless $^O eq 'VMS'; + + return $r; }