X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FB%2FMakefile.PL;h=d59e9d77205b8b93f8284b7abcb11736edea25ab;hb=427d62a407a31445bc7585263d1b781552e27ce5;hp=bc42a34d33c636e8151777fd22c11bd3954e17e0;hpb=2a321948466e7bb48bfd30dd6612a9a479df612a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/B/Makefile.PL b/ext/B/Makefile.PL index bc42a34..d59e9d7 100644 --- a/ext/B/Makefile.PL +++ b/ext/B/Makefile.PL @@ -1,10 +1,10 @@ use ExtUtils::MakeMaker; use Config; +use File::Spec; my $e = $Config{'exe_ext'}; my $o = $Config{'obj_ext'}; my $exeout_flag = '-o '; -my @extras = (); if ($^O eq 'MSWin32') { if ($Config{'cc'} =~ /^cl/i) { $exeout_flag = '-Fe'; @@ -12,43 +12,37 @@ if ($^O eq 'MSWin32') { elsif ($Config{'cc'} =~ /^bcc/i) { $exeout_flag = '-e'; } - # XXX this probably applies to everyone else - @extras = ( - OBJECT => "B$o byterun$o", - depend => { - "B$o" => "B.c ../../bytecode.h ../../byterun.h", - "byterun$o" => "../../byterun.c ../../bytecode.h ../../byterun.h", - }); } WriteMakefile( - NAME => "B", - VERSION => "a5", - @extras, - clean => { - FILES => "perl byteperl$e *$o B.c *~" + NAME => "B", + VERSION_FROM => "B.pm", + PL_FILES => { 'defsubs_h.PL' => 'defsubs.h' }, + MAN3PODS => {}, + clean => { + FILES => "perl$e *$o B.c defsubs.h *~" } ); -sub MY::post_constants { - "\nLIBS = $Config{libs}\n" +package MY; + +sub post_constants { + "\nLIBS = $Config::Config{libs}\n" +} + +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 MY::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 +" +}