mirror of https://github.com/bitcoin/bitcoin
Includes a temporary patch to fix the Windows Autotools build. See https://miniupnp.tuxfamily.org/files/changelog.php?file=miniupnpc-2.2.7.tar.gz.pull/29707/head
parent
19865a8350
commit
6866b571ab
@ -1,30 +1,28 @@
|
|||||||
package=miniupnpc
|
package=miniupnpc
|
||||||
$(package)_version=2.2.2
|
$(package)_version=2.2.7
|
||||||
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
|
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
|
||||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||||
$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687
|
$(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1
|
||||||
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch no_libtool.patch
|
$(package)_patches=dont_leak_info.patch no_libtool.patch fix_windows_build.patch
|
||||||
|
|
||||||
# Next time this package is updated, ensure that _WIN32_WINNT is still properly set.
|
|
||||||
# See discussion in https://github.com/bitcoin/bitcoin/pull/25964.
|
|
||||||
define $(package)_set_vars
|
define $(package)_set_vars
|
||||||
$(package)_build_opts=CC="$($(package)_cc)"
|
$(package)_build_opts=CC="$($(package)_cc)"
|
||||||
$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags) -D_WIN32_WINNT=0x0601"
|
$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags)"
|
||||||
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
|
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
|
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
|
||||||
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch && \
|
patch -p1 < $($(package)_patch_dir)/no_libtool.patch && \
|
||||||
patch -p1 < $($(package)_patch_dir)/no_libtool.patch
|
patch -p1 < $($(package)_patch_dir)/fix_windows_build.patch
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
$(MAKE) libminiupnpc.a $($(package)_build_opts)
|
$(MAKE) build/libminiupnpc.a $($(package)_build_opts)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\
|
mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\
|
||||||
install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
|
install include/*.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\
|
||||||
install libminiupnpc.a $($(package)_staging_prefix_dir)/lib
|
install build/libminiupnpc.a $($(package)_staging_prefix_dir)/lib
|
||||||
endef
|
endef
|
||||||
|
@ -0,0 +1,143 @@
|
|||||||
|
build: Temporary patch to make Windows compile
|
||||||
|
|
||||||
|
--- a/Makefile.mingw
|
||||||
|
+++ b/Makefile.mingw
|
||||||
|
@@ -9,10 +9,12 @@
|
||||||
|
#
|
||||||
|
SRCDIR = src
|
||||||
|
INCDIR = include
|
||||||
|
+BUILD = build
|
||||||
|
|
||||||
|
CC ?= gcc
|
||||||
|
SETUP_COMPILER_FLAG?=
|
||||||
|
DLLWRAP = dllwrap
|
||||||
|
+MKDIR = mkdir -p
|
||||||
|
WINDRES = windres
|
||||||
|
SH = /bin/sh
|
||||||
|
ZIP = zip
|
||||||
|
@@ -26,24 +28,25 @@ CFLAGS ?= -Os
|
||||||
|
CFLAGS += -Wall
|
||||||
|
CFLAGS += -W -Wstrict-prototypes
|
||||||
|
|
||||||
|
-CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x501
|
||||||
|
+CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x601
|
||||||
|
CPPFLAGS += -Iinclude
|
||||||
|
CPPFLAGS += -I.
|
||||||
|
+CPPFLAGS += -I$(BUILD)
|
||||||
|
|
||||||
|
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
|
||||||
|
LDLIBS = -lws2_32 -liphlpapi
|
||||||
|
|
||||||
|
PYTHON=\utils\python25\python
|
||||||
|
-OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
||||||
|
+OBJS=$(addprefix $(BUILD)/,miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
||||||
|
minissdpc.o \
|
||||||
|
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
||||||
|
connecthostport.o portlistingparse.o receivedata.o \
|
||||||
|
- upnpdev.o addr_is_reserved.o
|
||||||
|
+ upnpdev.o addr_is_reserved.o)
|
||||||
|
OBJSDLL=$(addprefix dll-, $(OBJS)) winres.o
|
||||||
|
-BINARIES=upnpc-static.exe upnpc-shared.exe \
|
||||||
|
+BINARIES=$(addprefix $(BUILD)/,upnpc-static.exe upnpc-shared.exe \
|
||||||
|
upnp-listdevices-static.exe upnp-listdevices-shared.exe \
|
||||||
|
miniupnpc.dll libminiupnpc.a \
|
||||||
|
- testminixml.exe
|
||||||
|
+ testminixml.exe)
|
||||||
|
ifneq ($(GITHUB_SHA),)
|
||||||
|
COMMITREF=$(GITHUB_SHA)
|
||||||
|
else
|
||||||
|
@@ -76,11 +79,12 @@ clean:
|
||||||
|
$(RM) miniupnpc.dll miniupnpc.lib miniupnpc.dll.def
|
||||||
|
$(RM) libminiupnpc.a
|
||||||
|
$(RM) $(DISTFILE)
|
||||||
|
+ $(RM) -r build/
|
||||||
|
|
||||||
|
$(DISTFILE): $(BINARIES)
|
||||||
|
$(ZIP) $@ *.exe *.dll *.lib *.def *.a LICENSE README Changelog.txt
|
||||||
|
|
||||||
|
-libminiupnpc.a: $(OBJS)
|
||||||
|
+$(BUILD)/libminiupnpc.a: $(OBJS)
|
||||||
|
$(AR) cr $@ $?
|
||||||
|
|
||||||
|
pythonmodule: libminiupnpc.a
|
||||||
|
@@ -97,13 +101,13 @@ miniupnpc.dll: miniupnpc.def $(OBJSDLL)
|
||||||
|
|
||||||
|
miniupnpc.lib: miniupnpc.dll
|
||||||
|
|
||||||
|
-%.o: $(SRCDIR)/%.c
|
||||||
|
+$(BUILD)/%.o: $(SRCDIR)/%.c
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
||||||
|
|
||||||
|
-dll-%.o: $(SRCDIR)/%.c
|
||||||
|
+$(BUILD)/dll-%.o: $(SRCDIR)/%.c
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_EXPORTS -c -o $@ $<
|
||||||
|
|
||||||
|
-%-shared.o: $(SRCDIR)/%.c
|
||||||
|
+$(BUILD)/%-shared.o: $(SRCDIR)/%.c
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
# --enable-stdcall-fixup
|
||||||
|
@@ -131,7 +135,8 @@ miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings.exe VERSION
|
||||||
|
|
||||||
|
rc_version.h: miniupnpcstrings.h
|
||||||
|
else
|
||||||
|
-miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
|
||||||
|
+$(BUILD)/miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
|
||||||
|
+ @$(MKDIR) $(@D)
|
||||||
|
sed 's|OS_STRING ".*"|OS_STRING "Windows/Mingw32"|' $< | \
|
||||||
|
sed 's|MINIUPNPC_VERSION_STRING ".*"|MINIUPNPC_VERSION_STRING "$(shell cat VERSION)"|' > $@
|
||||||
|
|
||||||
|
@@ -143,7 +148,7 @@ rc_version.h: VERSION
|
||||||
|
mv $@.tmp $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
-miniupnpc.pc: VERSION
|
||||||
|
+$(BUILD)/miniupnpc.pc: VERSION
|
||||||
|
$(RM) $@
|
||||||
|
echo "prefix=$(INSTALLPREFIX)" >> $@
|
||||||
|
echo "exec_prefix=\$${prefix}" >> $@
|
||||||
|
@@ -156,32 +161,32 @@ miniupnpc.pc: VERSION
|
||||||
|
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
|
||||||
|
echo "Cflags: -I\$${includedir}" >> $@
|
||||||
|
|
||||||
|
-winres.o: miniupnpc.rc rc_version.h
|
||||||
|
+$(BUILD)/winres.o: miniupnpc.rc rc_version.h
|
||||||
|
$(WINDRES) -D INTERNAL_NAME=\\\"miniupnpc.dll\\0\\\" -i $< -o $@
|
||||||
|
|
||||||
|
testminixml.exe: testminixml.o minixml.o igd_desc_parse.o
|
||||||
|
$(CC) -static -o $@ $^
|
||||||
|
|
||||||
|
-minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
|
||||||
|
+$(BUILD)/minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
|
||||||
|
|
||||||
|
-upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
|
||||||
|
-upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
|
||||||
|
+$(BUILD)/upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
|
||||||
|
+$(BUILD)/upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
|
||||||
|
|
||||||
|
-miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h miniupnpcstrings.h $(SRCDIR)/connecthostport.h
|
||||||
|
+$(BUILD)/miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h $(BUILD)/miniupnpcstrings.h $(SRCDIR)/connecthostport.h
|
||||||
|
|
||||||
|
-minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h miniupnpcstrings.h
|
||||||
|
+$(BUILD)/minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h $(BUILD)/miniupnpcstrings.h
|
||||||
|
|
||||||
|
-miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
|
||||||
|
+$(BUILD)/miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
|
||||||
|
include/miniwget.h $(SRCDIR)/minixml.h $(SRCDIR)/addr_is_reserved.h
|
||||||
|
|
||||||
|
-igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
|
||||||
|
+$(BUILD)/igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
|
||||||
|
|
||||||
|
-upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
|
||||||
|
+$(BUILD)/upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
|
||||||
|
|
||||||
|
-upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
|
||||||
|
+$(BUILD)/upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
|
||||||
|
include/miniupnpc.h include/portlistingparse.h
|
||||||
|
|
||||||
|
-minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
|
||||||
|
+$(BUILD)/minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
|
||||||
|
|
||||||
|
-upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h
|
||||||
|
+$(BUILD)/upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
commit fec515a7ac9991a0ee91068fda046b54b191155e
|
|
||||||
Author: fanquake <fanquake@gmail.com>
|
|
||||||
Date: Wed Jul 27 15:52:37 2022 +0100
|
|
||||||
|
|
||||||
build: respect CFLAGS in makefile.mingw
|
|
||||||
|
|
||||||
Similar to the other Makefile.
|
|
||||||
|
|
||||||
Cherry-pick of https://github.com/miniupnp/miniupnp/pull/619.
|
|
||||||
|
|
||||||
diff --git a/Makefile.mingw b/Makefile.mingw
|
|
||||||
index 2bff7bd..88430d2 100644
|
|
||||||
--- a/Makefile.mingw
|
|
||||||
+++ b/Makefile.mingw
|
|
||||||
@@ -19,7 +19,7 @@ else
|
|
||||||
RM = rm -f
|
|
||||||
endif
|
|
||||||
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
|
|
||||||
-CFLAGS = -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
|
|
||||||
+CFLAGS ?= -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
|
|
||||||
LDLIBS = -lws2_32 -liphlpapi
|
|
||||||
# -lwsock32
|
|
||||||
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
|
|
Loading…
Reference in new issue