Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115425
D7743.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D7743.diff
View Options
diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk
--- a/depends/packages/libevent.mk
+++ b/depends/packages/libevent.mk
@@ -3,8 +3,10 @@
$(package)_download_path=https://github.com/libevent/libevent/archive/
$(package)_file_name=release-$($(package)_version).tar.gz
$(package)_sha256_hash=229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e
+$(package)_patches=0001-fix-windows-getaddrinfo.patch
define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/0001-fix-windows-getaddrinfo.patch && \
./autogen.sh
endef
@@ -13,6 +15,11 @@
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
+ # When building for Windows, we set _WIN32_WINNT to target the same Windows
+ # version as we do in cmake. Due to quirks in libevents build system, this is
+ # also required to enable support for ipv6.
+ # See https://github.com/bitcoin/bitcoin/pull/19375.
+ $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601
endef
define $(package)_config_cmds
diff --git a/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch b/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch
new file mode 100644
--- /dev/null
+++ b/depends/patches/libevent/0001-fix-windows-getaddrinfo.patch
@@ -0,0 +1,15 @@
+diff -ur libevent-2.1.8-stable.orig/configure.ac libevent-2.1.8-stable/configure.ac
+--- libevent-2.1.8-stable.orig/configure.ac 2017-01-29 17:51:00.000000000 +0000
++++ libevent-2.1.8-stable/configure.ac 2020-03-07 01:11:16.311335005 +0000
+@@ -389,6 +389,10 @@
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
++#ifdef _WIN32
++#include <winsock2.h>
++#include <ws2tcpip.h>
++#endif
+ ]],
+ [[
+ getaddrinfo;
+Only in libevent-2.1.8-stable: configure.ac~
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 11:04 (18 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187484
Default Alt Text
D7743.diff (1 KB)
Attached To
D7743: build: target Windows 7 when building libevent and fix ipv6 usage
Event Timeline
Log In to Comment