From bb69371f66aa72a5508cff5335666807984c30b3 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Sat, 17 Sep 2016 10:11:02 +0200 Subject: [PATCH] updated miniupnp --- external/CMakeLists.txt | 8 +++---- external/miniupnpc/CMakeLists.txt | 39 ++++++++++++++++++------------- external/miniupnpc/Changelog.txt | 4 +++- external/miniupnpc/Makefile | 9 ++++++- external/miniupnpc/README | 5 +++- external/miniupnpc/VERSION | 2 +- external/miniupnpc/minissdpc.c | 3 +++ external/miniupnpc/miniupnpc.h | 4 ++-- 8 files changed, 48 insertions(+), 26 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index f0e65ac06..91611b117 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -59,15 +59,15 @@ else() add_subdirectory(miniupnpc) - set_property(TARGET upnpc-static PROPERTY FOLDER "external") + set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") if(MSVC) - set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") elseif(NOT MSVC) - set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") endif() set(UPNP_STATIC true PARENT_SCOPE) - set(UPNP_LIBRARIES "upnpc-static" PARENT_SCOPE) + set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) endif() find_package(Unbound) diff --git a/external/miniupnpc/CMakeLists.txt b/external/miniupnpc/CMakeLists.txt index fd75f9ff5..ab50fcbf9 100644 --- a/external/miniupnpc/CMakeLists.txt +++ b/external/miniupnpc/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) project (miniupnpc C) -set (MINIUPNPC_VERSION 1.9) +set (MINIUPNPC_VERSION 2.0) set (MINIUPNPC_API_VERSION 16) # - we comment out this block as we don't support these other build types @@ -34,6 +34,10 @@ endif (NO_GETADDRINFO) if (NOT WIN32) add_definitions (-DMINIUPNPC_SET_SOCKET_TIMEOUT) add_definitions (-D_BSD_SOURCE -D_DEFAULT_SOURCE) + if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + # add_definitions (-D_POSIX_C_SOURCE=200112L) + add_definitions (-D_XOPEN_SOURCE=600) + endif (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") else (NOT WIN32) add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends endif (NOT WIN32) @@ -68,8 +72,8 @@ if (CMAKE_COMPILER_IS_GNUC) endif () endif() -configure_file (miniupnpcstrings.h.cmake ${CMAKE_BINARY_DIR}/miniupnpcstrings.h) -include_directories (${CMAKE_BINARY_DIR}) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h) +include_directories (${CMAKE_CURRENT_BINARY_DIR}) set (MINIUPNPC_SOURCES igd_desc_parse.c @@ -78,7 +82,6 @@ set (MINIUPNPC_SOURCES minisoap.c minissdpc.c miniwget.c - upnpc.c upnpcommands.c upnpdev.c upnpreplyparse.c @@ -117,21 +120,25 @@ if (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED) endif (NOT UPNPC_BUILD_STATIC AND NOT UPNPC_BUILD_SHARED) if (UPNPC_BUILD_STATIC) - add_library (upnpc-static STATIC ${MINIUPNPC_SOURCES}) - set_target_properties (upnpc-static PROPERTIES OUTPUT_NAME "miniupnpc") - target_link_libraries (upnpc-static ${LDLIBS}) - set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-static) - set (UPNPC_LIBRARY_TARGET upnpc-static) + add_library (libminiupnpc-static STATIC ${MINIUPNPC_SOURCES}) + set_target_properties (libminiupnpc-static PROPERTIES OUTPUT_NAME "miniupnpc") + target_link_libraries (libminiupnpc-static ${LDLIBS}) + set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} libminiupnpc-static) + set (UPNPC_LIBRARY_TARGET libminiupnpc-static) + add_executable (upnpc-static upnpc.c) + target_link_libraries (upnpc-static LINK_PRIVATE libminiupnpc-static) endif (UPNPC_BUILD_STATIC) if (UPNPC_BUILD_SHARED) - add_library (upnpc-shared SHARED ${MINIUPNPC_SOURCES}) - set_target_properties (upnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc") - set_target_properties (upnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION}) - set_target_properties (upnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION}) - target_link_libraries (upnpc-shared ${LDLIBS}) - set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} upnpc-shared) - set (UPNPC_LIBRARY_TARGET upnpc-shared) + add_library (libminiupnpc-shared SHARED ${MINIUPNPC_SOURCES}) + set_target_properties (libminiupnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc") + set_target_properties (libminiupnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION}) + set_target_properties (libminiupnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION}) + target_link_libraries (libminiupnpc-shared ${LDLIBS}) + set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} libminiupnpc-shared) + set (UPNPC_LIBRARY_TARGET libminiupnpc-shared) + add_executable (upnpc-shared upnpc.c) + target_link_libraries (upnpc-shared LINK_PRIVATE libminiupnpc-shared) endif (UPNPC_BUILD_SHARED) if (UPNPC_BUILD_TESTS) diff --git a/external/miniupnpc/Changelog.txt b/external/miniupnpc/Changelog.txt index bf6343bd2..078bebce3 100644 --- a/external/miniupnpc/Changelog.txt +++ b/external/miniupnpc/Changelog.txt @@ -1,6 +1,8 @@ -$Id: Changelog.txt,v 1.222 2016/01/24 17:24:35 nanard Exp $ +$Id: Changelog.txt,v 1.223 2016/04/19 21:06:20 nanard Exp $ miniUPnP client Changelog. +VERSION 2.0 : released 2016/04/19 + 2016/01/24: change miniwget to return HTTP status code increments API_VERSION to 16 diff --git a/external/miniupnpc/Makefile b/external/miniupnpc/Makefile index 99a69301c..b7826caa1 100644 --- a/external/miniupnpc/Makefile +++ b/external/miniupnpc/Makefile @@ -38,6 +38,9 @@ CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT CFLAGS += -DMINIUPNPC_GET_SRC_ADDR CFLAGS += -D_BSD_SOURCE CFLAGS += -D_DEFAULT_SOURCE +ifeq ($(OS), NetBSD) +CFLAGS += -D_NETBSD_SOURCE +endif ifneq ($(OS), FreeBSD) ifneq ($(OS), Darwin) #CFLAGS += -D_POSIX_C_SOURCE=200112L @@ -136,7 +139,11 @@ endif LIBDIR ?= lib # install directories -INSTALLPREFIX ?= $(PREFIX)/usr +ifeq ($(strip $(PREFIX)),) +INSTALLPREFIX ?= /usr +else +INSTALLPREFIX ?= $(PREFIX) +endif INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR) INSTALLDIRBIN = $(INSTALLPREFIX)/bin diff --git a/external/miniupnpc/README b/external/miniupnpc/README index ab08de942..91535dbc8 100644 --- a/external/miniupnpc/README +++ b/external/miniupnpc/README @@ -3,7 +3,7 @@ Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ github: https://github.com/miniupnp/miniupnp freecode: http://freecode.com/projects/miniupnp Author: Thomas Bernard -Copyright (c) 2005-2014 Thomas Bernard +Copyright (c) 2005-2016 Thomas Bernard This software is subject to the conditions detailed in the LICENSE file provided within this distribution. @@ -32,6 +32,7 @@ To use the libminiupnpc in your application, link it with libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h, upnpcommands.h and miniwget.h : - upnpDiscover() +- UPNP_GetValidIGD() - miniwget() - parserootdesc() - GetUPNPUrls() @@ -59,3 +60,5 @@ send me an email ! For any question, you can use the web forum : http://miniupnp.tuxfamily.org/forum/ +Bugs should be reported on github : +https://github.com/miniupnp/miniupnp/issues diff --git a/external/miniupnpc/VERSION b/external/miniupnpc/VERSION index 2e0e38c63..cd5ac039d 100644 --- a/external/miniupnpc/VERSION +++ b/external/miniupnpc/VERSION @@ -1 +1 @@ -1.9 +2.0 diff --git a/external/miniupnpc/minissdpc.c b/external/miniupnpc/minissdpc.c index a6380dfd4..dc4f94702 100644 --- a/external/miniupnpc/minissdpc.c +++ b/external/miniupnpc/minissdpc.c @@ -11,6 +11,9 @@ #include #include #include +#if defined (__NetBSD__) +#include +#endif #if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) #ifdef _WIN32 #include diff --git a/external/miniupnpc/miniupnpc.h b/external/miniupnpc/miniupnpc.h index 5e8248850..0b5b47329 100644 --- a/external/miniupnpc/miniupnpc.h +++ b/external/miniupnpc/miniupnpc.h @@ -1,4 +1,4 @@ -/* $Id: miniupnpc.h,v 1.49 2016/01/24 17:24:36 nanard Exp $ */ +/* $Id: miniupnpc.h,v 1.50 2016/04/19 21:06:21 nanard Exp $ */ /* Project: miniupnp * http://miniupnp.free.fr/ * Author: Thomas Bernard @@ -19,7 +19,7 @@ #define UPNPDISCOVER_MEMORY_ERROR (-102) /* versions : */ -#define MINIUPNPC_VERSION "1.9" +#define MINIUPNPC_VERSION "2.0" #define MINIUPNPC_API_VERSION 16 /* Source port: