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
index 24074af..6de7bd0 100644 (file)
@@ -1,6 +1,6 @@
 use ExtUtils::MakeMaker;
 
-$define = '-DSDBM -DDUFF';
+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
@@ -21,21 +21,47 @@ WriteMakefile(
     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
-       $(NOECHO) $(NOOP)
+       ' . $noecho . '$(NOOP)
 
 config ::
-       $(NOECHO) $(NOOP)
+       ' . $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;
 }