radare2/preconfigure

49 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/sh
2021-11-05 00:25:02 +00:00
# env setup
2021-08-25 11:53:08 +00:00
MAKE=make
2021-08-27 09:00:43 +00:00
gmake --version > /dev/null 2>&1
2021-08-25 11:53:08 +00:00
[ $? = 0 ] && MAKE=gmake
2021-11-05 00:25:02 +00:00
2022-03-21 18:00:22 +00:00
echo "[*] Finding `type ${MAKE}` OK"
if [ ! -f config-user.mk ]; then
printf "[*] Configuring the build system ... "
./configure > /dev/null 2>&1 || exit 1
echo OK
fi
2021-11-05 00:25:02 +00:00
# checks
if [ -d "$HOME/.local/share/radare2/prefix/include/capstone" ]; then
echo "[*] Using capstone from r2pm"
export PKG_CONFIG_PATH
else
printf "[*] Checking out capstone... "
rm -rf shlr/capstone
${MAKE} -C shlr capstone > /dev/null 2>&1 || exit 1
echo OK
fi
V35WD=libr/arch/p/arm/v35
printf "[*] Checking out vector35-arm64... "
if [ ! -d "${V35WD}/arch-arm64/.git" ]; then
2021-11-05 00:25:02 +00:00
rm -rf ${V35WD}/arch-arm64
${MAKE} -C ${V35WD} arch-arm64 > /dev/null || exit 1
fi
echo OK
printf "[*] Checking out vector35-armv7... "
if [ ! -d "${V35WD}/arch-armv7/.git" ]; then
2021-11-05 00:25:02 +00:00
rm -rf ${V35WD}/arch-armv7
${MAKE} -C ${V35WD} arch-armv7 > /dev/null || exit 1
fi
echo OK
printf "[*] Running configure... "
CFGARGS=""
if [ `uname` = Linux ]; then
CFGARGS="${CFGARGS} --with-rpath"
fi
./configure ${CFGARGS} > /dev/null 2>&1
echo OK
echo "[*] Ready. You can now run 'make'."