This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Fix so will compile on C++11
[perl5.git] / hints / linux-android.sh
index 974043a..6a59cb7 100644 (file)
@@ -35,6 +35,7 @@ libswanted="$libswanted m"
 d_locconv='undef'
 d_setlocale='undef'
 d_setlocale_r='undef'
+d_lc_monetary_2008='undef'
 i_locale='undef'
 
 # https://code.google.com/p/android-source-browsing/source/browse/libc/netbsd/net/getservent_r.c?repo=platform--bionic&r=ca6fe7bebe3cc6ed7e2db5a3ede2de0fcddf411d#95
@@ -135,6 +136,8 @@ EOCBU
 
 if $test "X$targetrun" = "Xadb"; then
 
+$rm $run $to $from $targetmkdir
+
 case "$src" in
     /*) run=$src/Cross/run
             targetmkdir=$src/Cross/mkdir
@@ -189,25 +192,22 @@ $to \$exe > /dev/null 2>&1
 # sometimes there is no $?, I dunno why? we then get Cross/run-adb-shell: line 39: exit: XX: numeric argument required
 adb -s $targethost shell "sh -c '(cd \$cwd && \$env ; \$exe \$args > $targetdir/output.stdout 2>$targetdir/output.stderr) ; \$doexit '" > /dev/null
 
+rm output.stdout output.stderr output.status 2>/dev/null
+
 $from output.stdout
 $from output.stderr
 $from output.status
 
-result=\`$cat output.stdout\`
-result_err=\`$cat output.stderr\`
-result_status=\`$cat output.status\`
-rm output.stdout output.stderr output.status
-
 # We get back Ok\r\n on android for some reason, grrr:
-result=\`echo "\$result" | $tr -d '\r'\`
-result_err=\`echo "\$result_err" | $tr -d '\r'\`
-result_status=\`echo \$result_status | $tr -d '\r'\`
-
-echo "\$result"
-if test "X\$result_err" != X; then
-  echo "\$result_err" >&2
+$cat output.stdout | $tr -d '\r'
+if test -s output.stderr; then
+    $cat output.stderr | $tr -d '\r' >&2
 fi
 
+result_status=\`$cat output.status | $tr -d '\r'\`
+
+rm output.stdout output.stderr output.status
+
 # Also, adb doesn't exit with the commands exit code, like ssh does, double-grr
 exit \$result_status
 
@@ -252,9 +252,22 @@ fi # Cross-compiling with adb
 
 case "$usecrosscompile" in
 define)
+# The tests for this in Configure doesn't play nicely with
+# cross-compiling
+d_procselfexe="define"
 if $test "X$hostosname" = "Xdarwin"; then
   firstmakefile=GNUmakefile;
 fi
+
+# When cross-compiling, full_csh and d_csh will get the
+# host's values, which is all sorts of wrong.  So unless
+# full_csh has been set on the command line, set d_csh to
+# undef.
+case "$full_csh" in
+'') d_csh="$undef"
+;;
+esac
+
 ;;
 *)
 ldflags="$ldflags -L/system/lib"
@@ -271,7 +284,17 @@ case "$src" in
         ;;
 esac
 
-$cat <<EOO >> $pwd/config.arch
+$cat <<'EOO' >> $pwd/config.arch
 
 osname='android'
+eval "libpth='$libpth /system/lib /vendor/lib'"
+
+if $test "X$procselfexe" = X; then
+    case "$d_procselfexe" in
+        define) procselfexe='"/proc/self/exe"';;
+    esac
+fi
 EOO
+
+# Android is a linux variant, so run those hints.
+. ./hints/linux.sh