diff --git a/sys/android-build.sh b/sys/android-build.sh index df71e0de34..0556a46433 100755 --- a/sys/android-build.sh +++ b/sys/android-build.sh @@ -1,6 +1,7 @@ #!/bin/sh BUILD=1 +FLAGS="" PREFIX="/data/data/org.radare.radare2installer/radare2" type pax @@ -8,16 +9,22 @@ type pax cd `dirname $PWD/$0` ; cd .. +# we need a more recent ndk to build the mergedlib for mips + case "$1" in "mips") NDK_ARCH=mips STATIC_BUILD=0 STRIP=mips-linux-android-strip +# FLAGS="-mlong-calls" +# export LDFLAGS="-fuse-ld=gold" ;; "mips64") NDK_ARCH=mips64 STATIC_BUILD=0 STRIP=mips64el-linux-android-strip +# FLAGS="-mlong-calls" +# export LDFLAGS="-fuse-ld=gold" ;; "arm") NDK_ARCH=arm @@ -87,7 +94,7 @@ echo NDK_ARCH: ${NDK_ARCH} echo "Using NDK_ARCH: ${NDK_ARCH}" echo "Using STATIC_BUILD: ${STATIC_BUILD}" -export CFLAGS="-fPIC -fPIE" +export CFLAGS="-fPIC -fPIE ${FLAGS}" if [ "${BUILD}" = 1 ]; then if [ -z "${NDK}" ]; then diff --git a/sys/ref.sh b/sys/ref.sh new file mode 100755 index 0000000000..4655933027 --- /dev/null +++ b/sys/ref.sh @@ -0,0 +1,33 @@ +# create .h from .c +# > git grep R_API open.c |cut -d : -f 2- | sed -e 's, {,;,' + +# find files with \r\n +# > git grep `printf "\r\n"` + +# find and replace + +case "$1" in +h) + git grep ^R_API $2 |cut -d : -f 2- | sed -e 's, {,;,' + ;; +g) + git grep "$2" + ;; +n) + shift + while : ; do + A="$1" + perl -ne 's/\r\n/\n/g;print' < $A > $A._ + mv $A._ $A + shift + [ -z "$1" ] && break + done + ;; +*) + echo "Usage sys/ref.sh [action] [...]" + echo " h [path] # print R_API function signatures from C to H" + echo " s [sed] # perform regex on a bunch of files" + echo " n [newlines] # newlines replacements" + echo " g [regex] [path] # perform regex on a bunch of files" + ;; +esac