Subject: | [patch] minimal patch for win paths with spaces |
When the path to the installed perl has spaces
(eg C:\Program Files\Perl\bin), perl Makefile.PL
does not find its perl via find_perl() in init_PERL().
It tries to execute it, but did not quote the path before.
Quoting it like "C:\Program Files\Perl\bin\perl.exe" breaks the
detection of an absolute pathname in method file_name_is_absolute()
later.
So I quoted it like this:
C:\Program" "Files\Perl\bin\perl.exe
Second place to modify was in MM_Unix::constants, where the
definition of CONFIGDEP is done. Both entries need to be quoted
like this:
CONFIGDEP = "$(PERL_ARCHLIB)$(DFSEP)Config.pm" "$(PERL_INC)$(DFSEP)
config.h"
This part is a bit ugly. I needed a quick fix to install modules on my
box.
With this patch, 'perl Makefile.PL' generates a Makefile that runs
with 'nmake' and 'nmake install'. For 'nmake test' more work is needed.
So it can be a start for people to build on.
Subject: | min_patch_for_winpath_with_spaces.patch |
--- lib/ExtUtils/MM_Unix.pm.org 2011-07-06 23:17:22.000000000 +0200
+++ lib/ExtUtils/MM_Unix.pm 2011-07-21 18:55:40.227308100 +0200
@@ -444,6 +444,11 @@
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
};
+ # quote possible spaces for Windows
+ if ($Is{Win32} && 0 <= index $m[-1], ' ') {
+ $m[-1] =~ s{\ \$\(}{ "\$(}xmsg;
+ $m[-1] =~ s{\.([pmh]+)}{.$1"}xmsg;
+ }
push @m, qq{
@@ -1033,6 +1038,11 @@
}
print "Checking $abs\n" if ($trace >= 2);
next unless $self->maybe_command($abs);
+
+ # quote spaces for Windows
+ if ($Is{Win32} && 0 <= index $abs, ' ') {
+ $abs =~ s{\ }{"\ "}xmsg;
+ }
print "Executing $abs\n" if ($trace >= 2);
my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};