From 93e619a021dea4933483728678b7566a1fdaa2fb Mon Sep 17 00:00:00 2001 From: Joris Goosen Date: Tue, 23 May 2023 14:22:04 +0000 Subject: [PATCH] Add option to disable spawnv define --- configure.ac | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7855bd9..7bb29f6 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,17 @@ AC_SUBST([SANITIZERS]) AM_ICONV +AC_ARG_ENABLE( + [spawnvfix], + [AS_HELP_STRING([--disable-spawnvfix], [Do not use _spawnv=spanv define on MINGW builds because it breaks UCRT builds.])] +) + +use_spawnvfix="" + +AS_IF([test "x$enable_spawnvfix" != "xno"], [ + use_spawnvfix="-D_spawnv=spawnv" +]) + AC_CANONICAL_HOST AS_CASE([$host], [*linux*|*bsd*|*mingw*|*cygwin*|*gnu*], [EXTRA_LIBS="-lm"], @@ -60,7 +71,7 @@ AS_CASE([$host], AC_SUBST([EXTRA_LDFLAGS]) AS_CASE([$host], - [*mingw*], [CFLAGS="$CFLAGS -D_spawnv=spawnv"], + [*mingw*], [CFLAGS="$CFLAGS $use_spawnvfix"], [CFLAGS="$CFLAGS"]) AC_ARG_VAR([LIB_FUZZING_ENGINE], [Location of prebuilt fuzzing engine library])