2017-02-02 11:00:02 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-09-25 17:26:47 +00:00
|
|
|
WRKDIR=/tmp
|
|
|
|
SDKDIR=${WRKDIR}/r2-sdk
|
2017-02-02 11:00:02 +00:00
|
|
|
if [ -n "$1" ]; then
|
|
|
|
if [ -f "$1" ]; then
|
|
|
|
echo "Target directory exists. Cant build the SDK in there"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
SDKDIR="$1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Builds an SDK to build stuff for rbin
|
2017-08-31 17:54:50 +00:00
|
|
|
export CFLAGS="-Os -fPIC"
|
2017-02-02 11:00:02 +00:00
|
|
|
make mrproper
|
2017-09-25 17:00:15 +00:00
|
|
|
if [ -z "${R2_PLUGINS_CFG}" ]; then
|
|
|
|
R2_PLUGINS_CFG=plugins.bin.cfg
|
|
|
|
fi
|
|
|
|
cp -f "${R2_PLUGINS_CFG}" plugins.cfg
|
2017-02-02 11:00:02 +00:00
|
|
|
#./configure-plugins
|
2017-08-31 13:22:43 +00:00
|
|
|
./configure --prefix="$PREFIX" --with-nonpic --without-pic --without-gpl || exit 1
|
2017-02-02 11:00:02 +00:00
|
|
|
#--disable-loadlibs || exit 1
|
|
|
|
make -j8 || exit 1
|
|
|
|
rm -rf "${SDKDIR}"
|
|
|
|
mkdir -p "${SDKDIR}"/lib
|
|
|
|
rm -f libr/libr.a
|
|
|
|
cp -rf libr/include "${SDKDIR}"
|
|
|
|
FILES=`find libr shlr -iname '*.a'`
|
|
|
|
cp -f ${FILES} "${SDKDIR}"/lib
|
2017-08-31 13:22:43 +00:00
|
|
|
OS=`uname`
|
|
|
|
AR=`uname -m`
|
|
|
|
SF=r2sdk-${OS}-${AR}
|
|
|
|
|
|
|
|
(
|
2017-09-25 17:26:47 +00:00
|
|
|
cd ${WRKDIR}
|
2017-08-31 13:22:43 +00:00
|
|
|
mv r2-sdk ${SF}
|
|
|
|
zip -r ${SF}.zip ${SF}
|
|
|
|
)
|
2017-09-25 17:26:47 +00:00
|
|
|
mv ${WRKDIR}/${SF} .
|
|
|
|
mv ${WRKDIR}/${SF}.zip .
|
|
|
|
ln -fs ${SF} r2sdk
|