qemu_mode, build script: avoid which, add patch to prereqs, list all
missing prereqs in one invocation
@@ -62,15 +62,15 @@ if [ ! -f "../afl-showmap" ]; then
fi
+PREREQ_NOTFOUND=
+for i in libtool wget python automake autoconf sha384sum bison iconv patch; do
-for i in libtool wget python automake autoconf sha384sum bison iconv; do
-
- T=`which "$i" 2>/dev/null`
+ T=`type "$i" | awk '{print $NF}' 2>/dev/null`
if [ "$T" = "" ]; then
echo "[-] Error: '$i' not found, please install first."
- exit 1
+ PREREQ_NOTFOUND=1
fi
@@ -79,7 +79,7 @@ done
if [ ! -d "/usr/include/glib-2.0/" -a ! -d "/usr/local/include/glib-2.0/" ]; then
echo "[-] Error: devel version of 'glib2' not found, please install first."
- exit 1
+ PREREQ_NOTFOUND=1
fi
@@ -90,6 +90,10 @@ if echo "$CC" | grep -qF /afl-; then
fi
+if [ "$PREREQ_NOTFOUND" == "1" ]; then
+ exit 1
+fi
+
echo "[+] All checks passed!"
ARCHIVE="`basename -- "$QEMU_URL"`"
