2011-11-22 14:12:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
MAKE=make
|
|
|
|
gmake --help >/dev/null 2>&1
|
|
|
|
[ $? = 0 ] && MAKE=gmake
|
|
|
|
|
|
|
|
# find root
|
2015-06-17 02:39:19 +00:00
|
|
|
cd "$(dirname "$PWD/$0")" ; cd ..
|
2011-11-22 14:12:29 +00:00
|
|
|
|
|
|
|
ccache --help > /dev/null 2>&1
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
[ -z "${CC}" ] && CC=gcc
|
|
|
|
CC="ccache ${CC}"
|
|
|
|
export CC
|
|
|
|
fi
|
2015-01-24 02:30:07 +00:00
|
|
|
PREFIX=/usr
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
PREFIX="$1"
|
|
|
|
fi
|
2015-01-24 20:45:32 +00:00
|
|
|
DOBUILD=1
|
|
|
|
if [ 1 = "${DOBUILD}" ]; then
|
2015-01-24 20:18:26 +00:00
|
|
|
# build
|
|
|
|
if [ -f config-user.mk ]; then
|
|
|
|
${MAKE} mrproper > /dev/null 2>&1
|
|
|
|
fi
|
2015-11-01 09:26:38 +00:00
|
|
|
export CFLAGS="-fPIC"
|
2015-04-08 14:07:57 +00:00
|
|
|
#-D__ANDROID__=1"
|
2015-01-24 20:18:26 +00:00
|
|
|
./configure-plugins
|
2015-06-17 02:39:19 +00:00
|
|
|
./configure --prefix="$PREFIX" --with-nonpic --without-pic --disable-loadlibs
|
2011-11-22 14:12:29 +00:00
|
|
|
fi
|
2015-11-01 09:26:38 +00:00
|
|
|
${MAKE} -j 8 || exit 1
|
2015-04-09 21:36:18 +00:00
|
|
|
BINS="rarun2 rasm2 radare2 ragg2 rabin2 rax2 rahash2 rafind2 rasign2 r2agent radiff2"
|
2015-06-17 02:39:19 +00:00
|
|
|
# shellcheck disable=SC2086
|
2015-04-09 21:36:18 +00:00
|
|
|
for a in ${BINS} ; do
|
|
|
|
(
|
2015-07-22 23:19:10 +00:00
|
|
|
cd binr/$a
|
|
|
|
${MAKE} clean
|
|
|
|
if [ "`uname`" = Darwin ]; then
|
|
|
|
${MAKE} -j2
|
|
|
|
else
|
|
|
|
LDFLAGS=-static ${MAKE} -j2
|
|
|
|
fi
|
|
|
|
strip -s $a
|
2015-04-09 21:36:18 +00:00
|
|
|
)
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -rf r2-static
|
|
|
|
mkdir r2-static
|
2015-11-01 09:26:38 +00:00
|
|
|
exec ${MAKE} install DESTDIR="${PWD}/r2-static"
|