From 687e70194a437896b56cfbcf4f53cf564f7851ea Mon Sep 17 00:00:00 2001 From: Jess Robinson Date: Fri, 4 Jan 2013 10:48:34 +0000 Subject: [PATCH] Hints file for android cross-compiling. The hints file names for cross-compiling (currently) need to match the prefix of the cross-compiler used. --- MANIFEST | 1 + hints/linux-android.sh | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 hints/linux-android.sh diff --git a/MANIFEST b/MANIFEST index 878a915..7d7c2bf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4031,6 +4031,7 @@ hints/irix_6_1.sh Hints for named architecture hints/irix_6.sh Hints for named architecture hints/isc_2.sh Hints for named architecture hints/isc.sh Hints for named architecture +hints/linux-android.sh Hints for named architecture hints/linux.sh Hints for named architecture hints/lynxos.sh Hints for named architecture hints/midnightbsd.sh Hints for named architecture diff --git a/hints/linux-android.sh b/hints/linux-android.sh new file mode 100644 index 0000000..d2f4118 --- /dev/null +++ b/hints/linux-android.sh @@ -0,0 +1,100 @@ +# set -x + +# Having fun with the dlopen check.. :( +#d_dlopen='define' +#d_dlerror='define' + + +case "$src" in + /*) run=$src/Cross/run + targetmkdir=$src/Cross/mkdir + to=$src/Cross/to + from=$src/Cross/from + ;; + *) pwd=`test -f ../Configure && cd ..; pwd` + run=$pwd/Cross/run + targetmkdir=$pwd/Cross/mkdir + to=$pwd/Cross/to + from=$pwd/Cross/from + ;; +esac + +targetrun=adb-shell +targetto=adb-push +targetfrom=adb-pull +run=$run-$targetrun +to=$to-$targetto +from=$from-$targetfrom + +cat >$run < /dev/null 2>&1 + +# send copy results to /dev/null as otherwise it outputs speed stats which gets in our way. +foo=\`adb -s $targethost shell "sh -c '(cd \$cwd && \$exe \$@ > \$exe.stdout) ; \$doexit '"\` +# We get back Ok\r\n on android for some reason, grrr: +$from \$exe.stdout +result=\`cat \$exe.stdout\` +rm \$exe.stdout +foo=\`echo \$foo | sed -e 's|\r||g'\` +# Also, adb doesn't exit with the commands exit code, like ssh does, double-grr +echo \$result +exit \$foo +# if test "X\$doexit" != X; then +# exit \$foo +#else +# echo \$foo +#fi + +EOF +chmod a+rx $run + +cat >$targetmkdir <$to <&1) || exit 1 + ;; + esac +done +exit 0 +EOF +chmod a+rx $to + +cat >$from < /dev/null 2>&1) || exit 1 +done +exit 0 +EOF +chmod a+rx $from + -- 2.7.4