changeset 1668:49cb3cf4bd6f

When explicitly passing --disable-fuzz to ./configure fuzz was actually enabled. Signed-off-by: Alexander Dahl <[email protected]>
author Alexander Dahl <ada@thorsis.com>
date Fri, 27 Mar 2020 23:23:11 +0800
parents 986126448688
children 3080aed32bf1 ba6fc7afe1c5
files configure.ac
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Tue Mar 10 15:38:38 2020 +0100
+++ b/configure.ac	Fri Mar 27 23:23:11 2020 +0800
@@ -341,14 +341,21 @@
 AC_ARG_ENABLE(fuzz,
 	[  --enable-fuzz           Build fuzzing. Not recommended for deployment.],
 	[
-		AC_DEFINE(DROPBEAR_FUZZ, 1, Fuzzing)
-		AC_MSG_NOTICE(Enabling fuzzing)
-		DROPBEAR_FUZZ=1
-		# libfuzzer needs linking with c++ libraries
-		AC_PROG_CXX
+		if test "x$enableval" = "xyes"; then
+            AC_DEFINE(DROPBEAR_FUZZ, 1, Fuzzing)
+            AC_MSG_NOTICE(Enabling fuzzing)
+            DROPBEAR_FUZZ=1
+            # libfuzzer needs linking with c++ libraries
+            AC_PROG_CXX
+        else
+            AC_DEFINE(DROPBEAR_FUZZ, 0, Fuzzing)
+            AC_MSG_NOTICE(Disabling fuzzing)
+            DROPBEAR_FUZZ=0
+        fi
 	],
 	[
 		AC_DEFINE(DROPBEAR_FUZZ, 0, Fuzzing)
+		AC_MSG_NOTICE(Disabling fuzzing)
 		DROPBEAR_FUZZ=0
 	]