From 580f36a4b42b245b943d7f2fc88313769d6af050 Mon Sep 17 00:00:00 2001 From: pancake Date: Sat, 24 Jan 2015 21:18:26 +0100 Subject: [PATCH] More fixes for the Android package --- config-user.mk.acr | 4 ---- libr/core/config.c | 5 ++++- sys/android-build.sh | 3 +-- sys/static.sh | 15 +++++++++------ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config-user.mk.acr b/config-user.mk.acr index da4007443b..4a6bb924c5 100644 --- a/config-user.mk.acr +++ b/config-user.mk.acr @@ -8,13 +8,9 @@ LIBDIR=@LIBDIR@ MANDIR=@MANDIR@ DATADIR=@DATADIR@ INCLUDEDIR=@INCLUDEDIR@ -HAVE_LIB_EWF=@HAVE_LIB_EWF@ -EWF_CFLAGS=@EWF_CFLAGS@ -EWF_LDFLAGS=@EWF_LDFLAGS@ HAVE_LIB_GMP=@HAVE_LIB_GMP@ LIL_ENDIAN=@LIL_ENDIAN@ USE_RPATH=@USE_RPATH@ -HAVE_LIBVERSION=@HAVE_LIBVERSION@ BUILD_OS=@BUILD_OS@ MKPLUGINS=mk/stat.mk mk/sloc.mk diff --git a/libr/core/config.c b/libr/core/config.c index c64bea354b..165ed9b19b 100644 --- a/libr/core/config.c +++ b/libr/core/config.c @@ -992,8 +992,11 @@ R_API int r_core_config_init(RCore *core) { SETPREF("dir.plugins", R2_LIBDIR"/radare2/"R2_VERSION"/", "Path to plugin files to be loaded at startup"); SETPREF("dir.source", "", "Path to find source files"); SETPREF("dir.types", "/usr/include", "Default path to look for cparse type files"); +#if __ANDROID__ + SETPREF("dir.projects", "/data/data/org.radare.installer/radare2/projects", "Default path for projects"); +#else SETPREF("dir.projects", "~/"R2_HOMEDIR"/projects", "Default path for projects"); - +#endif SETPREF("stack.bytes", "true", "Show bytes instead of values in stack"); SETPREF("stack.anotated", "false", "Show anotated hexdump in visual debug"); SETI("stack.size", 64, "Define size of anotated hexdump in visual debug"); diff --git a/sys/android-build.sh b/sys/android-build.sh index 5fd113d56d..f6cac7c273 100755 --- a/sys/android-build.sh +++ b/sys/android-build.sh @@ -133,12 +133,11 @@ cd ../.. chmod +x "${HERE}/${D}/${PREFIX}/bin/"* find ${D}/${PREFIX}/share/radare2/*/www -# TODO: remove unused files like include files and so on +# Remove development files rm -f ${HERE}/${D}/${PREFIX}/lib/radare2/*/*.so rm -f ${HERE}/${D}/${PREFIX}/lib/*.a rm -rf ${HERE}/${D}/${PREFIX}/share/radare2/*/www/*/node_modules rm -rf ${HERE}/${D}/${PREFIX}/include -rm -rf ${HERE}/${D}/${PREFIX}/doc eval `grep ^VERSION= ${HERE}/config-user.mk` #WWWROOT="/data/data/org.radare.installer/radare2/share/radare2/${VERSION}/www" #ln -fs ${WWWROOT} ${HERE}/${D}/data/data/org.radare.installer/www diff --git a/sys/static.sh b/sys/static.sh index 601e3508da..d8111570cf 100755 --- a/sys/static.sh +++ b/sys/static.sh @@ -17,11 +17,14 @@ PREFIX=/usr if [ -n "$1" ]; then PREFIX="$1" fi -# build -if [ -f config-user.mk ]; then - ${MAKE} mrproper > /dev/null 2>&1 +DOBUILD=$1 +if [ -n "${DOBUILD}" ]; then + # build + if [ -f config-user.mk ]; then + ${MAKE} mrproper > /dev/null 2>&1 + fi + export CFLAGS="-fPIC -pie -D__ANDROID__=1" + ./configure-plugins + ./configure --prefix=$PREFIX --with-nonpic --without-pic && \ fi -export CFLAGS="-fPIC -pie" -./configure-plugins -./configure --prefix=$PREFIX --with-nonpic --without-pic && \ ${MAKE} -j 8