@@ -184,10 +184,16 @@ AC_ARG_ENABLE([extended-functional-tests],
184
184
185
185
AC_ARG_ENABLE ( [ fuzz] ,
186
186
AS_HELP_STRING ( [ --enable-fuzz] ,
187
- [ enable building of fuzz targets (default no). enabling this will disable all other targets] ) ,
187
+ [ build for fuzzing (default no). enabling this will disable all other targets and override --{enable,disable}-fuzz-binary ] ) ,
188
188
[ enable_fuzz=$enableval] ,
189
189
[ enable_fuzz=no] )
190
190
191
+ AC_ARG_ENABLE ( [ fuzz-binary] ,
192
+ AS_HELP_STRING ( [ --enable-fuzz-binary] ,
193
+ [ enable building of fuzz binary (default yes).] ) ,
194
+ [ enable_fuzz_binary=$enableval] ,
195
+ [ enable_fuzz_binary=yes] )
196
+
191
197
AC_ARG_ENABLE ( [ danger_fuzz_link_all] ,
192
198
AS_HELP_STRING ( [ --enable-danger-fuzz-link-all] ,
193
199
[ Danger! Modifies source code. Needs git and gnu sed installed. Link each fuzz target (default no).] ) ,
@@ -1224,7 +1230,7 @@ AC_DEFUN([SUPPRESS_WARNINGS],
1224
1230
1225
1231
dnl enable-fuzz should disable all other targets
1226
1232
if test "x$enable_fuzz" = "xyes"; then
1227
- AC_MSG_WARN ( enable-fuzz will disable all other targets )
1233
+ AC_MSG_WARN ( enable-fuzz will disable all other targets and force -- enable-fuzz-binary=yes )
1228
1234
build_bitcoin_utils=no
1229
1235
build_bitcoin_cli=no
1230
1236
build_bitcoin_tx=no
@@ -1240,10 +1246,11 @@ if test "x$enable_fuzz" = "xyes"; then
1240
1246
use_upnp=no
1241
1247
use_natpmp=no
1242
1248
use_zmq=no
1249
+ enable_fuzz_binary=yes
1243
1250
1244
1251
AX_CHECK_PREPROC_FLAG ( [ -DABORT_ON_FAILED_ASSUME] ,[ [ DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"] ] ,,[ [ $CXXFLAG_WERROR] ] )
1245
1252
1246
- AC_MSG_CHECKING ( [ whether main function is needed] )
1253
+ AC_MSG_CHECKING ( [ whether main function is needed for fuzz binary ] )
1247
1254
AX_CHECK_LINK_FLAG (
1248
1255
[ [ -fsanitize=$use_sanitizers] ] ,
1249
1256
[ AC_MSG_RESULT ( [ no] ) ] ,
@@ -1271,6 +1278,8 @@ else
1271
1278
QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES)
1272
1279
QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES)
1273
1280
fi
1281
+
1282
+ CPPFLAGS="$CPPFLAGS -DPROVIDE_MAIN_FUNCTION"
1274
1283
fi
1275
1284
1276
1285
if test x$enable_wallet != xno; then
@@ -1716,6 +1725,7 @@ AM_CONDITIONAL([USE_BDB], [test "x$use_bdb" = "xyes"])
1716
1725
AM_CONDITIONAL([ ENABLE_TRACING] ,[ test x$have_sdt = xyes] )
1717
1726
AM_CONDITIONAL([ ENABLE_TESTS] ,[ test x$BUILD_TEST = xyes] )
1718
1727
AM_CONDITIONAL([ ENABLE_FUZZ] ,[ test x$enable_fuzz = xyes] )
1728
+ AM_CONDITIONAL([ ENABLE_FUZZ_BINARY] ,[ test x$enable_fuzz_binary = xyes] )
1719
1729
AM_CONDITIONAL([ ENABLE_FUZZ_LINK_ALL] ,[ test x$enable_danger_fuzz_link_all = xyes] )
1720
1730
AM_CONDITIONAL([ ENABLE_QT] ,[ test x$bitcoin_enable_qt = xyes] )
1721
1731
AM_CONDITIONAL([ ENABLE_QT_TESTS] ,[ test x$BUILD_TEST_QT = xyes] )
@@ -1732,6 +1742,8 @@ AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
1732
1742
AM_CONDITIONAL([ ENABLE_ARM_CRC] ,[ test x$enable_arm_crc = xyes] )
1733
1743
AM_CONDITIONAL([ USE_ASM] ,[ test x$use_asm = xyes] )
1734
1744
AM_CONDITIONAL([ WORDS_BIGENDIAN] ,[ test x$ac_cv_c_bigendian = xyes] )
1745
+ AM_CONDITIONAL([ USE_NATPMP] ,[ test x$use_natpmp = xyes] )
1746
+ AM_CONDITIONAL([ USE_UPNP] ,[ test x$use_upnp = xyes] )
1735
1747
1736
1748
AC_DEFINE ( CLIENT_VERSION_MAJOR , _CLIENT_VERSION_MAJOR , [ Major version] )
1737
1749
AC_DEFINE ( CLIENT_VERSION_MINOR , _CLIENT_VERSION_MINOR , [ Minor version] )
0 commit comments