From 80cd8b0868dc37723ee83e1a8b51add8a37e5600 Mon Sep 17 00:00:00 2001
From: Anh <zenpoems@gmail.com>
Date: Thu, 2 Aug 2018 17:27:43 +0000
Subject: [PATCH] Add afl to tree

---
 build-all.sh           | 13 +++++++++++++
 clean-all.sh           |  3 +++
 set_env_vars           |  5 +++--
 test/gzip/test_gzip.sh |  2 ++
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/build-all.sh b/build-all.sh
index a2342ed..ecfedce 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -15,3 +15,16 @@ scons $SCONSDEBUG -j 3 || exit
 
 cd $ZFUZZ_HOME/libzafl/src
 scons
+
+cd $ZFUZZ_HOME
+if [ ! -e afl ]; then
+	echo
+	echo Setup AFL
+	echo 
+	wget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
+	tar -xzvf afl-latest.tgz
+	rm afl-latest.tgz
+	mv afl-* afl
+	cd afl
+	make
+fi
diff --git a/clean-all.sh b/clean-all.sh
index a118c7e..53ca585 100755
--- a/clean-all.sh
+++ b/clean-all.sh
@@ -5,3 +5,6 @@ scons -c || exit
 
 cd $ZFUZZ_HOME/libzafl/src
 scons -c || exit
+
+cd $ZFUZZ_HOME
+rm -fr afl
diff --git a/set_env_vars b/set_env_vars
index c46d053..7c90af4 100644
--- a/set_env_vars
+++ b/set_env_vars
@@ -1,2 +1,3 @@
-export ZFUZZ_HOME=$PWD
-export AFL_TRANSFORMS=$PWD/afl_transforms
+export ZFUZZ_HOME=`pwd`
+export AFL_TRANSFORMS=$ZFUZZ_HOME/afl_transforms
+export AFL_PATH=$ZFUZZ_HOME/afl
diff --git a/test/gzip/test_gzip.sh b/test/gzip/test_gzip.sh
index d8d1154..ac5fbcc 100755
--- a/test/gzip/test_gzip.sh
+++ b/test/gzip/test_gzip.sh
@@ -1,3 +1,5 @@
+#!/bin/bash -x 
+
 TMP_FILE_1=/tmp/gzip.tmp.$$
 TMP_FILE_2=/tmp/gzip.tmp.$$
 
-- 
GitLab