$ENV{CATALYST_DEVEL_SHAREDIR} = $share_dir;
my $instdir = tempdir(CLEANUP => 1);
-$ENV{PERL_MM_OPT} = "INSTALL_BASE=$instdir";
-$ENV{INSTALL_BASE} = $instdir;
+my $MAKE = $Config{make} || 'make';
+
+my $escaped_path = $instdir;
+$escaped_path =~ s/\\/\\\\/g;
+if ($escaped_path =~ s/ /\\ /g) {
+ $escaped_path = qq{"$escaped_path"};
+}
+
+$ENV{PERL_MM_OPT} = "INSTALL_BASE=$escaped_path";
+
if ($ENV{MAKEFLAGS}) {
$ENV{MAKEFLAGS} =~ s/PREFIX=[^\s]+//;
$ENV{MAKEFLAGS} =~ s/INSTALL_BASE=[^\s]+//;
command_ok( [ $^X, 'Makefile.PL' ] );
ok -e "Makefile", "Makefile generated";
-#NOTE: do not assume that 'make' is always 'make' as e.g. Win32/strawberry perl uses 'dmake'
-command_ok( [ ($Config{make} || 'make') ] );
+command_ok( [ $MAKE ] );
run_generated_component_tests();
is $server_script, $server_script_new;
diag "Installed app is in $instdir";
-command_ok( [ ($Config{make} || 'make', 'install') ] );
+command_ok( [ $MAKE, 'install' ] );
my $inst_app_dir = catdir($instdir);
chdir($inst_app_dir) or die "Cannot chdir to $inst_app_dir: $!";