Cwd.pm: Handle native android builds better
authorBrian Fraser <fraserbn@gmail.com>
Mon, 13 Jan 2014 05:31:18 +0000 (02:31 -0300)
committerBrian Fraser <fraserbn@gmail.com>
Sun, 26 Jan 2014 17:44:24 +0000 (14:44 -0300)
dist/PathTools/Cwd.pm
dist/PathTools/lib/File/Spec.pm
dist/PathTools/lib/File/Spec/Cygwin.pm
dist/PathTools/lib/File/Spec/Epoc.pm
dist/PathTools/lib/File/Spec/Functions.pm
dist/PathTools/lib/File/Spec/Mac.pm
dist/PathTools/lib/File/Spec/OS2.pm
dist/PathTools/lib/File/Spec/Unix.pm
dist/PathTools/lib/File/Spec/VMS.pm
dist/PathTools/lib/File/Spec/Win32.pm

index b9f74e0..0c9b82d 100644 (file)
@@ -171,7 +171,7 @@ use strict;
 use Exporter;
 use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 my $xs_version = $VERSION;
 $VERSION =~ tr/_//;
 
@@ -343,6 +343,23 @@ foreach my $try ('/bin/pwd',
         last;
     }
 }
+
+# Android has a built-in pwd. Using $pwd_cmd will DTRT if
+# this perl was compiled with -Dd_useshellcmds, which is the
+# default for Android, but the block below is needed for the
+# miniperl running on the host when cross-compiling, and
+# potentially for native builds with -Ud_useshellcmds.
+if ($^O =~ /android/) {
+    # If targetsh is executable, then we're either a full
+    # perl, or a miniperl for a native build.
+    if (-x $Config::Config{targetsh}) {
+        $pwd_cmd = "$Config::Config{targetsh} -c pwd"
+    }
+    else {
+        $pwd_cmd = "$Config::Config{sh} -c pwd"
+    }
+}
+
 my $found_pwd_cmd = defined($pwd_cmd);
 unless ($pwd_cmd) {
     # Isn't this wrong?  _backtick_pwd() will fail if someone has
index c37924f..7bcd08d 100644 (file)
@@ -3,7 +3,7 @@ package File::Spec;
 use strict;
 use vars qw(@ISA $VERSION);
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 my %module = (MacOS   => 'Mac',
index d232e0d..d8ceaac 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);
index 3a5796d..e5ac358 100644 (file)
@@ -3,7 +3,7 @@ package File::Spec::Epoc;
 use strict;
 use vars qw($VERSION @ISA);
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 require File::Spec::Unix;
index af039e7..2bb3218 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 
 use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
 
-$VERSION = '3.45';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 require Exporter;
index 7a5b41e..117de58 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.45';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);
index 3de4544..b619cdf 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);
index 270a1fe..26cd78d 100644 (file)
@@ -3,7 +3,7 @@ package File::Spec::Unix;
 use strict;
 use vars qw($VERSION);
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 my $xs_version = $VERSION;
 $VERSION =~ tr/_//;
 
index 1fd1a47..431546a 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.45_01';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);
index 4c16586..ddb37c7 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use vars qw(@ISA $VERSION);
 require File::Spec::Unix;
 
-$VERSION = '3.45';
+$VERSION = '3.46';
 $VERSION =~ tr/_//;
 
 @ISA = qw(File::Spec::Unix);