File system-miniupnpc.patch of Package warzone2100
From cae7a552c1d174764033f27e577ca0b5e2fab489 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?=
<Mailaender@users.noreply.github.com>
Date: Sat, 24 Jun 2017 16:44:05 +0200
Subject: [PATCH] Use system supplied miniupnpc
---
Makefile.am | 1 -
configure.ac | 4 +++-
src/Makefile.am | 7 +++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 563933e78a..5224a7a44c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,6 @@ endif
SUBDIRS = \
win32 \
- 3rdparty/miniupnpc \
lib/framework \
lib/exceptionhandler \
lib/script \
diff --git a/configure.ac b/configure.ac
index 0a54c17b05..82ba6a3f61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -425,6 +425,9 @@ PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto >= 1.0.0])
# check for nearbyint()
AC_CHECK_LIB(m, nearbyint, [MATH_LIB=""], AC_MSG_ERROR([nearbyint not found.]))
+# check for miniupnpc
+AC_CHECK_LIB(miniupnpc, upnpDiscover, AC_SUBST([MINIUPNPC_LIBS], [-lminiupnpc]), AC_MSG_ERROR([miniupnpc not found.]))
+
# When (cross-)compiling for Windows (MinGW) we need to link in iberty for the Dr. MinGW derived exception handler.
if test "x$host_os_mingw32" = "xyes" ; then
AC_CHECK_LIB(iberty, main, AC_SUBST([IBERTY_LIBS], [-liberty]), AC_MSG_ERROR([libiberty not found.]))
@@ -502,7 +505,6 @@ AC_CONFIG_FILES([Makefile
pkg/nsis/Makefile
win32/Makefile
tests/Makefile
- 3rdparty/miniupnpc/Makefile
lib/framework/Makefile
lib/exceptionhandler/Makefile
lib/gamelib/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index ee4d49029b..9e6327944f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -290,8 +290,7 @@ COMMONLIBS = \
$(top_builddir)/lib/netplay/libnetplay.a \
$(top_builddir)/lib/ivis_opengl/libivis_opengl.a \
$(top_builddir)/lib/gamelib/libgamelib.a \
- $(top_builddir)/lib/exceptionhandler/libexceptionhandler.a \
- $(top_builddir)/3rdparty/miniupnpc/libminiupnpc.a
+ $(top_builddir)/lib/exceptionhandler/libexceptionhandler.a
if PORTABLE
warzone2100_portable_SOURCES = $(COMMONSOURCES) $(nodist_COMMONSOURCES)
@@ -331,11 +330,11 @@ endif
if PORTABLE
warzone2100_portable_LDADD = $(warzone2100_portable_LIBS) $(LTLIBINTL) $(SDL_LIBS) $(PHYSFS_LIBS) $(PNG_LIBS) $(VORBISFILE_LIBS) $(VORBIS_LIBS) \
- $(THEORA_LIBS) $(OPENAL_LIBS) $(FONT_LIBS) $(OPENGL_LIBS) $(SQT5_LIBS) $(QT5_LIBS) $(GLEW_LIBS) \
+ $(THEORA_LIBS) $(OPENAL_LIBS) $(FONT_LIBS) $(OPENGL_LIBS) $(SQT5_LIBS) $(QT5_LIBS) $(GLEW_LIBS) $(MINIUPNPC_LIBS) \
$(X_LIBS) $(X_EXTRA_LIBS) $(LIBCRYPTO_LIBS) $(LDFLAGS)
else
warzone2100_LDADD = $(warzone2100_LIBS) $(LTLIBINTL) $(SDL_LIBS) $(PHYSFS_LIBS) $(PNG_LIBS) $(VORBISFILE_LIBS) $(VORBIS_LIBS) \
- $(THEORA_LIBS) $(OPENAL_LIBS) $(FONT_LIBS) $(OPENGL_LIBS) $(SQT5_LIBS) $(QT5_LIBS) $(GLEW_LIBS) \
+ $(THEORA_LIBS) $(OPENAL_LIBS) $(FONT_LIBS) $(OPENGL_LIBS) $(SQT5_LIBS) $(QT5_LIBS) $(GLEW_LIBS) $(MINIUPNPC_LIBS) \
$(X_LIBS) $(X_EXTRA_LIBS) $(LIBCRYPTO_LIBS) $(LDFLAGS)
endif