Add basic fuzzing support for libstrophe

This commit is contained in:
Jordy Zomer
2021-06-10 16:04:05 +00:00
committed by Dmitry Podgorny
parent 2f491e0250
commit 1f0a3f1ad1
3 changed files with 69 additions and 0 deletions

View File

@@ -33,6 +33,16 @@ AC_ARG_ENABLE([tls],
AC_ARG_ENABLE([cares],
[AS_HELP_STRING([--enable-cares], [use c-ares for DNS resolution])])
AC_ARG_ENABLE([fuzzing], [--enable-fuzzing Turn on fuzzing],
[case "${enableval}" in yes) fuzzing=true ;; no) fuzzing=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-fuzzing]) ;; esac],[fuzzing=false])
AM_CONDITIONAL([FUZZ], [test x$fuzzing = xtrue])
if test "x$enable_fuzzing" = "xyes" ; then
if ! test "x$CC" = "xclang" ; then
AC_MSG_ERROR(["You need to set CC=clang to use --enable-fuzzing, used $CC"])
fi
fi
AC_SEARCH_LIBS([socket], [network socket])
AC_CHECK_FUNCS([snprintf vsnprintf])
AC_CHECK_DECLS([va_copy], [], [], [#include <stdarg.h>])