Improve configure argument handling in sys/install.sh ##build

* Handle --help, --with-capstone5 and --install (no symlinks)
This commit is contained in:
pancake 2019-05-14 17:53:34 +02:00
parent 786f16fe2f
commit 092173bf90
2 changed files with 29 additions and 4 deletions

View File

@ -80,7 +80,7 @@ fi
[ -z "${PREFIX}" ] && PREFIX="${DEFAULT_PREFIX}"
case "$1" in
-h)
-h|--help)
echo "Usage: sys/build.sh [/usr]"
exit 0
;;
@ -96,6 +96,10 @@ case "$1" in
;;
esac
if [ "$USE_CS5" = 1 ]; then
CFGARG="${CFGARG} --with-capstone5"
fi
ccache --help > /dev/null 2>&1
if [ $? = 0 ]; then
[ -z "${CC}" ] && CC=gcc
@ -132,9 +136,6 @@ fi
# build
${MAKE} mrproper > /dev/null 2>&1
if [ -d shlr/capstone/.git ]; then
( cd shlr/capstone ; git clean -xdf )
fi
[ "`uname`" = Linux ] && export LDFLAGS="-Wl,--as-needed ${LDFLAGS}"
if [ -z "${KEEP_PLUGINS_CFG}" ]; then
rm -f plugins.cfg

View File

@ -6,6 +6,30 @@ gmake --help >/dev/null 2>&1
# if owner of sys/install.sh != uid && uid == 0 { exec sudo -u id -A $SUDO_UID sys/install.sh $* }
while : ; do
case "$1" in
--help)
./configure --help
echo
echo "NOTE: Use sys/install.sh --install to use 'cp' instead of 'ln'."
echo
exit 0
;;
"--with-capstone5")
export USE_CS5=1
rm -rf shlr/capstone
shift
continue
;;
"--install")
export INSTALL_TARGET="install"
shift
continue
;;
esac
break
done
if [ "${UID}" = 0 ]; then
echo "[XX] Do not run this script as root!"
if [ -n "${SUDO_USER}" ]; then