Subject: | [PATCH] regen run of Makefile.PL will use same -MCross arg as initial .PL run |
See attached patch.
Subject: | 0001-regen-run-of-Makefile.PL-will-use-same-MCross-arg-as.patch |
From b0ad6a1337bb2c020e264c7c3cf3f9d11afb9b90 Mon Sep 17 00:00:00 2001
From: bulk88 <bulk88@hotmail.com>
Date: Thu, 22 Aug 2013 15:51:59 -0400
Subject: [PATCH] regen run of Makefile.PL will use same -MCross arg as
initial .PL run
This is for the WinCE build process. If -MCross was used on the 1st run
of Makefile.PL, from buildext.pl for example, any regen runs done by
makefile, must call Makefile.PL the same way that was Makefile.PL was
initially called. Otherwise, the regen'ed makefile will be for a Desktop
Perl and not a CE Perl even though we are trying to build a CE Perl Module.
---
lib/ExtUtils/MM_Unix.pm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 67099a5..7281f3f 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -2524,8 +2524,12 @@ $(OBJECT) : $(FIRST_MAKEFILE)
my $newer_than_target = $Is{VMS} ? '$(MMS$SOURCE_LIST)' : '$?';
my $mpl_args = join " ", map qq["$_"], @ARGV;
-
- $m .= sprintf <<'MAKE_FRAG', $newer_than_target, $mpl_args;
+ my $cross = '';
+ if (defined $::Cross::platform) {
+ # Inherited from win32/buildext.pl
+ $cross = "-MCross=$::Cross::platform ";
+ }
+ $m .= sprintf <<'MAKE_FRAG', $newer_than_target, $cross, $mpl_args;
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
@@ -2534,7 +2538,7 @@ $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
- $(PERLRUN) Makefile.PL %s
+ $(PERLRUN) %sMakefile.PL %s
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
$(FALSE)
--
1.8.0.msysgit.0