From 4926250c8d7d8793153d7d8552a96f130eb68937 Mon Sep 17 00:00:00 2001 From: Joris Goosen Date: Thu, 21 Sep 2023 16:20:54 +0200 Subject: [PATCH] Add option to disable spawnv define (#301) --- configure.ac | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7855bd9..6cc35c6 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,15 @@ AS_CASE([$host], AC_SUBST([EXTRA_LDFLAGS]) AS_CASE([$host], - [*mingw*], [CFLAGS="$CFLAGS -D_spawnv=spawnv"], + [*mingw*], + [ + #There is no real way to determine whether UCRT is used vs normal MINGW but one way is by checking a define in + #If we are in UCRT we do not want to set the spawnv define because it breaks the build + IS_UCRT=`echo '#include '| gcc -E -dM - | grep -i _UCRT | xargs` + AS_IF([test "$IS_UCRT" == ""], [ + CFLAGS="$CFLAGS -D_spawnv=spawnv" + ]) + ], [CFLAGS="$CFLAGS"]) AC_ARG_VAR([LIB_FUZZING_ENGINE], [Location of prebuilt fuzzing engine library])