summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2021-05-20 18:28:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-20 22:55:00 (GMT)
commit6aac70a870fc40482eca943ff0b64003497d69c1 (patch)
treeccda33257024978db9833175a9d4a32b300d6db2 /Makefile
parent36a7eb68760b7a45ce6b16be300dd04fbe9bd029 (diff)
downloadgit-6aac70a870fc40482eca943ff0b64003497d69c1.zip
git-6aac70a870fc40482eca943ff0b64003497d69c1.tar.gz
git-6aac70a870fc40482eca943ff0b64003497d69c1.tar.bz2
simple-ipc: correct ifdefs when NO_PTHREADS is defined
Simple IPC always requires threads (in addition to various platform-specific IPC support). Fix the ifdefs in the Makefile to define SUPPORTS_SIMPLE_IPC when appropriate. Previously, the Unix version of the code would only verify that Unix domain sockets were available. This problem was reported here: https://lore.kernel.org/git/YKN5lXs4AoK%2FJFTO@coredump.intra.peff.net/T/#m08be8f1942ea8a2c36cfee0e51cdf06489fdeafc Reported-by: Randall S. Becker <rsbecker@nexbridge.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dfc37b0..8ca59f4 100644
--- a/Makefile
+++ b/Makefile
@@ -1679,13 +1679,31 @@ ifdef NO_UNIX_SOCKETS
else
LIB_OBJS += unix-socket.o
LIB_OBJS += unix-stream-server.o
- LIB_OBJS += compat/simple-ipc/ipc-shared.o
- LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
endif
+# Simple IPC requires threads and platform-specific IPC support.
+# Only platforms that have both should include these source files
+# in the build.
+#
+# On Windows-based systems, Simple IPC requires threads and Windows
+# Named Pipes. These are always available, so Simple IPC support
+# is optional.
+#
+# On Unix-based systems, Simple IPC requires pthreads and Unix
+# domain sockets. So support is only enabled when both are present.
+#
ifdef USE_WIN32_IPC
+ BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC
LIB_OBJS += compat/simple-ipc/ipc-shared.o
LIB_OBJS += compat/simple-ipc/ipc-win32.o
+else
+ifndef NO_PTHREADS
+ifndef NO_UNIX_SOCKETS
+ BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC
+ LIB_OBJS += compat/simple-ipc/ipc-shared.o
+ LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
+endif
+endif
endif
ifdef NO_ICONV