diff --git a/lib/ExtUtils/Depends.pm b/lib/ExtUtils/Depends.pm index e3644fd..943df2a 100644 --- a/lib/ExtUtils/Depends.pm +++ b/lib/ExtUtils/Depends.pm @@ -219,11 +219,13 @@ { instpath => $instpath, typemaps => \@typemaps, - inc => "-I$instpath $inc", + inc => "-I". _quote_if_space($instpath) ." $inc", libs => $libs, deps => \@deps, } } + +sub _quote_if_space { $_[0] =~ / / ? qq{"$_[0]"} : $_[0] } sub load_deps { my $self = shift; @@ -362,7 +364,9 @@ }, map { -d $_ ? ($_) : () } @INC); # only extant dirs if ($matching_file && -f $matching_file) { - push @found_libs, ('-L' . $matching_dir, '-l' . $stem); + push @found_libs, + '-L' . _quote_if_space($matching_dir), + '-l' . $stem; # Android's linker ignores the RTLD_GLOBAL flag # and loads everything as if under RTLD_LOCAL. # What this means in practice is that modules need