ext\ExtUtils\t\Embed.t fails test when upgrading a perl with different core headers.
[p5sagit/p5-mst-13.2.git] / ext / B / Makefile.PL
index ff3694d..d59e9d7 100644 (file)
@@ -1,5 +1,6 @@
 use ExtUtils::MakeMaker;
 use Config;
+use File::Spec;
 
 my $e = $Config{'exe_ext'};
 my $o = $Config{'obj_ext'};
@@ -14,41 +15,34 @@ if ($^O eq 'MSWin32') {
 }
 
 WriteMakefile(
-    NAME       => "B",
-    VERSION    => "a5",
-    MAN3PODS => {},
-    clean      => {
-       FILES           => "perl$e byteperl$e *$o B.c defsubs.h *~"
+    NAME           => "B",
+    VERSION_FROM    => "B.pm",
+    PL_FILES       => { 'defsubs_h.PL' => 'defsubs.h' },
+    MAN3PODS       => {},
+    clean          => {
+       FILES       => "perl$e *$o B.c defsubs.h *~"
     }
-);   
+);
 
 package MY;
 
 sub post_constants {
-    "\nLIBS = $Config{libs}\n"
-}    
+    "\nLIBS = $Config::Config{libs}\n"
+}
 
-sub postamble {
-'
-B$(OBJ_EXT) : defsubs.h 
-'
+sub upupfile {
+    File::Spec->catfile(File::Spec->updir,
+                       File::Spec->updir, $_[0]);
 }
 
-# Leave out doing byteperl for now. Probably should be built in the
-# core directory or somewhere else rather than here
-#sub top_targets {
-#    my $self = shift;
-#    my $targets = $self->MM::top_targets();
-#    $targets =~ s/^(all ::.*)$/$1 byteperl$e/m;
-#    return <<"EOT" . $targets;
+sub MY::postamble {
+    my $op_h   = upupfile('op.h');
+    my $cop_h  = upupfile('cop.h');
+    my $noecho = shift->{NOECHO};
+"
+B\$(OBJ_EXT) : defsubs.h
 
-#
-# byteperl is *not* a standard perl+XSUB executable. It's a special
-# program for running standalone bytecode executables. It isn't an XSUB
-# at the moment because a standlone Perl program needs to set up curpad
-# which is overwritten on exit from an XSUB.
-#
-#byteperl$e : byteperl$o B$o \$(PERL_SRC)/byterun$o
-#      \$(CC) ${exeout_flag}byteperl$e byteperl$o B$o byterun$o \$(LDFLAGS) \$(PERL_ARCHLIB)/CORE/$Config{libperl} \$(LIBS)
-#EOT
-#}
+defsubs.h :: $op_h $cop_h defsubs_h.PL
+       \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) defsubs_h.PL defsubs.h
+"
+}