3 userelocatableinc='define'
5 # On Android the shell is /system/bin/sh:
6 targetsh='/system/bin/sh'
9 # https://github.com/android/platform_bionic/blob/master/libc/CAVEATS
17 /*) run=$src/Cross/run
18 targetmkdir=$src/Cross/mkdir
22 *) pwd=`test -f ../Configure && cd ..; pwd`
24 targetmkdir=$pwd/Cross/mkdir
35 from=$from-$targetfrom
64 $to \$exe > /dev/null 2>&1
66 # send copy results to /dev/null as otherwise it outputs speed stats which gets in our way.
67 # sometimes there is no $?, I dunno why? we then get Cross/run-adb-shell: line 39: exit: XX: numeric argument required
68 foo=\`adb -s $targethost shell "sh -c '(cd \$cwd && \$env ; \$exe \$args) > $targetdir/output.stdout ; \$doexit '"\`
69 # We get back Ok\r\n on android for some reason, grrr:
71 result=\`cat output.stdout\`
73 result=\`echo "\$result" | sed -e 's|\r||g'\`
74 foo=\`echo \$foo | sed -e 's|\r||g'\`
75 # Also, adb doesn't exit with the commands exit code, like ssh does, double-grr
82 cat >$targetmkdir <<EOF
84 adb -s $targethost shell "mkdir -p \$@"
86 chmod a+rx $targetmkdir
94 $targetmkdir \`dirname \$f\`
95 adb -s $targethost push \$f \$f || exit 1
98 $targetmkdir $targetdir/\`dirname \$f\`
99 (adb -s $targethost push \$f $targetdir/\$f < /dev/null 2>&1) || exit 1
112 (adb -s $targethost pull $targetdir/\$f . > /dev/null 2>&1) || exit 1