Skip to content

Commit 8e2d93f

Browse files
committed
build: fix cflags passing for mingw miniupnpc
Cherry-pick of a patch upstreamed to miniupnpc, see here: miniupnp/miniupnp#619.
1 parent 2b2c970 commit 8e2d93f

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

depends/packages/miniupnpc.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $(package)_version=2.2.2
33
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687
6-
$(package)_patches=dont_leak_info.patch
6+
$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch
77

88
define $(package)_set_vars
99
$(package)_build_opts=CC="$($(package)_cc)"
@@ -13,7 +13,8 @@ $(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$
1313
endef
1414

1515
define $(package)_preprocess_cmds
16-
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch
16+
patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \
17+
patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch
1718
endef
1819

1920
define $(package)_build_cmds
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
commit fec515a7ac9991a0ee91068fda046b54b191155e
2+
Author: fanquake <[email protected]>
3+
Date: Wed Jul 27 15:52:37 2022 +0100
4+
5+
build: respect CFLAGS in makefile.mingw
6+
7+
Similar to the other Makefile.
8+
9+
Cherry-pick of https://github.com/miniupnp/miniupnp/pull/619.
10+
11+
diff --git a/Makefile.mingw b/Makefile.mingw
12+
index 2bff7bd..88430d2 100644
13+
--- a/Makefile.mingw
14+
+++ b/Makefile.mingw
15+
@@ -19,7 +19,7 @@ else
16+
RM = rm -f
17+
endif
18+
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
19+
-CFLAGS = -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
20+
+CFLAGS ?= -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
21+
LDLIBS = -lws2_32 -liphlpapi
22+
# -lwsock32
23+
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()

0 commit comments

Comments
 (0)