In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/ee39f343efffd64e53e2d8282afa1cb99a1b7dcd?hp=a0a3f71856bf44d3386282fd8254477a750d1006>
- Log ----------------------------------------------------------------- commit ee39f343efffd64e53e2d8282afa1cb99a1b7dcd Merge: a0a3f71 e069772 Author: Nicholas Clark <[email protected]> Date: Tue Jun 5 20:59:50 2012 +0200 Merge improvements to make_ext.pl commit e06977207755fde18af09bfe45017ee7b03cc8da Author: Nicholas Clark <[email protected]> Date: Sun Jun 3 22:05:58 2012 +0200 In make_ext.pl, inline _macroify_passthrough() into its only caller. M make_ext.pl commit 43f197b58b234b5f912893ab0eb369af9d2f09c0 Author: Nicholas Clark <[email protected]> Date: Sat Jun 2 12:17:29 2012 +0200 In make_ext.pl, only fudge the Makefile.PL timestamp when generating it. The expedient fudge added by commit 23525070d6c0e51f was actually after the closing } for the if block that auto-generated a Makefile.PL. Hence it was *always* changing the timestamp on every Makefile.PL just before running it, even the ones checked out from the repository. That seems a bit wrong. M make_ext.pl commit 5924d25db672e4188c36b980f26c737b98533b4f Author: Nicholas Clark <[email protected]> Date: Fri Apr 27 12:05:38 2012 +0200 make_ext.pl need not manipulate @INC, as buildcustomize.pl already does it. Remove from make_ext.pl code that predates the introduction of buildcustomize.pl, as that now sets up @INC correctly before make_ext.pl even runs. During the build process make_ext.pl is only run by miniperl. M make_ext.pl commit 14636674d1354874af66d4ede62b8e5fe6bb836b Author: Nicholas Clark <[email protected]> Date: Fri Apr 27 13:05:26 2012 +0200 In make_ext.pl, move loading FindExt and Cwd into the Win32-only code. As Cwd is now required instead of used and hence doesn't export, qualify the calls to getcwd() with the package name. M make_ext.pl ----------------------------------------------------------------------- Summary of changes: make_ext.pl | 44 +++++++++++++++++++------------------------- 1 files changed, 19 insertions(+), 25 deletions(-) diff --git a/make_ext.pl b/make_ext.pl index d6561b1..28a67a3 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -2,15 +2,6 @@ use strict; use warnings; use Config; -BEGIN { - if ($^O eq 'MSWin32') { - unshift @INC, '../dist/Cwd'; - require FindExt; - } else { - unshift @INC, 'dist/Cwd'; - } -} -use Cwd; my $is_Win32 = $^O eq 'MSWin32'; my $is_VMS = $^O eq 'VMS'; @@ -147,7 +138,9 @@ my $perl; my %extra_passthrough; if ($is_Win32) { - my $build = getcwd(); + require Cwd; + require FindExt; + my $build = Cwd::getcwd(); $perl = $^X; if ($perl =~ m#^\.\.#) { my $here = $build; @@ -167,7 +160,7 @@ if ($is_Win32) { print "In $build"; foreach my $dir (@dirs) { chdir($dir) or die "Cannot cd to $dir: $!\n"; - (my $ext = getcwd()) =~ s{/}{\\}g; + (my $ext = Cwd::getcwd()) =~ s{/}{\\}g; FindExt::scan_ext($ext); FindExt::set_static_extensions(split ' ', $Config{static_ext}); chdir $build @@ -377,11 +370,17 @@ WriteMakefile( # ex: set ro: EOM close $fh or die "Can't close Makefile.PL: $!"; + # As described in commit 23525070d6c0e51f: + # Push the atime and mtime of generated Makefile.PLs back 4 + # seconds. In certain circumstances ( on virtual machines ) the + # generated Makefile.PL can produce a Makefile that is older than + # the Makefile.PL. Altering the atime and mtime backwards by 4 + # seconds seems to resolve the issue. + eval { + my $ftime = time - 4; + utime $ftime, $ftime, 'Makefile.PL'; + }; } - eval { - my $ftime = time - 4; - utime $ftime, $ftime, 'Makefile.PL'; - }; print "\nRunning Makefile.PL in $ext_dir\n"; # Presumably this can be simplified @@ -450,8 +449,11 @@ EOS } if ($is_VMS) { - _macroify_passthrough($pass_through); - unshift @$pass_through, "/DESCRIPTION=$makefile"; + _quote_args($pass_through); + @$pass_through = ( + "/DESCRIPTION=$makefile", + '/MACRO=(' . join(',',@$pass_through) . ')' + ); } if (!$target or $target !~ /clean$/) { @@ -479,11 +481,3 @@ sub _quote_args { } @{$args} ; } - -sub _macroify_passthrough { - my $passthrough = shift; - _quote_args($passthrough); - my $macro = '/MACRO=(' . join(',',@$passthrough) . ')'; - @$passthrough = (); - @$passthrough[0] = $macro; -} -- Perl5 Master Repository
