about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2019-11-07 05:05:55 +0000
committerDavid Carlier <devnexen@gmail.com>2019-11-07 05:05:55 +0000
commit7b82ef22bea26b7f867cff21de2866b74f4f9dc1 (patch)
treebe40b6385d858db7da3f18ad47f05a3cdf31a05e
parentc3b2fee07413fcab6f13d0c66ea0ca30760b2b1b (diff)
parenta09cfd57a475e8e5ec9549b87938791c131ae2f5 (diff)
downloadafl++-7b82ef22bea26b7f867cff21de2866b74f4f9dc1.tar.gz
Little tweks for BSD
-rwxr-xr-xunicorn_mode/build_unicorn_support.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/unicorn_mode/build_unicorn_support.sh b/unicorn_mode/build_unicorn_support.sh
index 88dae90b..91a1494f 100755
--- a/unicorn_mode/build_unicorn_support.sh
+++ b/unicorn_mode/build_unicorn_support.sh
@@ -70,14 +70,16 @@ if [ "$PLT" = "Linux" ]; then
   CKSUMCMD='sha384sum --'
   PYTHONBIN=python2
   MAKECMD=make
+  CORES=`nproc`
   TARCMD=tar
   EASY_INSTALL=easy_install
 fi
 
 if [ "$PLT" = "Darwin" ]; then
-  CKSUMCMD="shasum -a 384 --tag"
+  CKSUMCMD="shasum -a 384"
   PYTHONBIN=python2.7
   MAKECMD=make
+  CORES=`sysctl hw.ncpu | cut -d' ' -f2`
   TARCMD=tar
   EASY_INSTALL=easy_install-2.7
 fi
@@ -86,6 +88,7 @@ if [ "$PLT" = "FreeBSD" ]; then
   CKSUMCMD="sha384 -q"
   PYTHONBIN=python2.7
   MAKECMD=gmake
+  CORES=`sysctl hw.ncpu | cut -d' ' -f2`
   TARCMD=gtar
   EASY_INSTALL=easy_install-2.7
 fi
@@ -94,6 +97,7 @@ if [ "$PLT" = "NetBSD" ] || [ "$PLT" = "OpenBSD" ]; then
   CKSUMCMD="cksum -a sha384 -q"
   PYTHONBIN=python2.7
   MAKECMD=gmake
+  CORES=`sysctl hw.ncpu | cut -d' ' -f2`
   TARCMD=gtar
   EASY_INSTALL=easy_install-2.7
 fi
@@ -141,9 +145,9 @@ if [ ! "$CKSUM" = "$UNICORN_SHA384" ]; then
   echo "[*] Downloading Unicorn v1.0.1 from the web..."
   rm -f "$ARCHIVE"
   # NetBSD does not support SSL in the userland, we gotta trust github url
-  wget --no-check-certificate -O "$ARCHIVE" -- "$UNICORN_URL" || exit 1
+  wget -O "$ARCHIVE" -- "$UNICORN_URL" || exit 1
 
-  CKSUM=`CHKSUMCMD "$ARCHIVE" 2>/dev/null | cut -d' ' -f1`
+  CKSUM=`CKSUMCMD "$ARCHIVE" 2>/dev/null | cut -d' ' -f1`
 
 fi
 
@@ -184,7 +188,7 @@ echo "[+] Configuration complete."
 
 echo "[*] Attempting to build Unicorn (fingers crossed!)..."
 
-UNICORN_QEMU_FLAGS="--python=$PYTHONBIN" $MAKECMD -j4 || exit 1
+UNICORN_QEMU_FLAGS="--python=$PYTHONBIN" $MAKECMD -j$CORES || exit 1
 
 echo "[+] Build process successful!"