summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/curl/ExternalProject_curl.mk1
-rw-r--r--external/curl/UnpackedTarball_curl.mk6
-rw-r--r--external/curl/emscripten-proxy-poll.patch.020
3 files changed, 27 insertions, 0 deletions
diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index 9d39e62e6fd3..45aa6d561389 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -65,6 +65,7 @@ $(call gb_ExternalProject_get_state_target,curl,build):
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(filter MACOSX,$(OS)),CFLAGS='$(CFLAGS) \
-mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)') \
+ $(if $(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),--disable-socketpair) \
$(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \
CPPFLAGS='$(curl_CPPFLAGS)' \
CFLAGS="$(gb_CFLAGS) $(call gb_ExternalProject_get_build_flags,curl)" \
diff --git a/external/curl/UnpackedTarball_curl.mk b/external/curl/UnpackedTarball_curl.mk
index 4412857d36a0..4f21212eff8d 100644
--- a/external/curl/UnpackedTarball_curl.mk
+++ b/external/curl/UnpackedTarball_curl.mk
@@ -33,4 +33,10 @@ $(eval $(call gb_UnpackedTarball_add_patches,curl, \
))
endif
+ifeq ($(ENABLE_EMSCRIPTEN_PROXY_POSIX_SOCKETS),TRUE)
+$(eval $(call gb_UnpackedTarball_add_patches,curl, \
+ external/curl/emscripten-proxy-poll.patch.0 \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/curl/emscripten-proxy-poll.patch.0 b/external/curl/emscripten-proxy-poll.patch.0
new file mode 100644
index 000000000000..ac1f4a84d25c
--- /dev/null
+++ b/external/curl/emscripten-proxy-poll.patch.0
@@ -0,0 +1,20 @@
+--- lib/select.c
++++ lib/select.c
+@@ -51,6 +51,8 @@
+ #include "curl_printf.h"
+ #include "curl_memory.h"
+ #include "memdebug.h"
++
++int websocket_proxy_poll(struct pollfd *fds, nfds_t nfds, int timeout);
+
+ /*
+ * Internal function used for waiting a specific amount of ms
+@@ -318,7 +320,7 @@
+ pending_ms = -1;
+ else
+ pending_ms = 0;
+- r = poll(ufds, nfds, pending_ms);
++ r = websocket_proxy_poll(ufds, nfds, pending_ms);
+ if(r <= 0) {
+ if((r == -1) && (SOCKERRNO == EINTR))
+ /* make EINTR from select or poll not a "lethal" error */