From 54037d7b983167477c4cfea2fdc192208305d857 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sun, 22 Sep 2024 22:50:10 +0200 Subject: [PATCH] Move FD_SETSIZE to configure.ac The commit from the pull request #644 sets the macro FD_SETSIZE to 128 for every host OS, while it is needed on Windows only. Note that this macro has a much higher value on other OS and after this commit it get reduced to 128 only. Since in configure.ac is already present a hook to change the compile defines for Windows, move there also FD_SETSIZE. Signed-off-by: Antonio Borneo --- Makefile.am | 6 ++---- configure.ac | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0f24ee6bd..2230e628f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,15 +37,13 @@ DISTCLEANFILES += jimtcl/jsmn/jsmn.o endif # common flags used in openocd build -AM_CFLAGS = $(GCC_WARNINGS)\ - -DFD_SETSIZE=128 +AM_CFLAGS = $(GCC_WARNINGS) AM_CPPFLAGS = $(HOST_CPPFLAGS)\ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -DPKGDATADIR=\"$(pkgdatadir)\" \ - -DBINDIR=\"$(bindir)\"\ - -DFD_SETSIZE=128 + -DBINDIR=\"$(bindir)\" if INTERNAL_JIMTCL AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \ diff --git a/configure.ac b/configure.ac index f13727e89..779de40c6 100644 --- a/configure.ac +++ b/configure.ac @@ -436,7 +436,7 @@ AS_CASE([$host], # In case enable_buspirate=auto, make sure it will not be built. enable_buspirate=no - AC_SUBST([HOST_CPPFLAGS], [-D__USE_MINGW_ANSI_STDIO]) + AC_SUBST([HOST_CPPFLAGS], ["-D__USE_MINGW_ANSI_STDIO -DFD_SETSIZE=128"]) ], [*darwin*], [ is_darwin=yes