From 62d62e4f881db4105075d1b63d62dd42cfe96c54 Mon Sep 17 00:00:00 2001 From: Guilherme Senges Date: Thu, 29 Aug 2019 17:44:40 -0300 Subject: [PATCH] Applied patch to OpenWRT compatibility --- miniupnpd/Makefile.linux | 6 ++++++ miniupnpd/genconfig.sh | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/miniupnpd/Makefile.linux b/miniupnpd/Makefile.linux index 023f33a..7be3093 100644 --- a/miniupnpd/Makefile.linux +++ b/miniupnpd/Makefile.linux @@ -77,7 +77,10 @@ CPPFLAGS += -DIPTABLES_143 endif CFLAGS += $(shell $(PKG_CONFIG) --cflags libiptc) +#OpenWrt packager passes correct libraries +ifeq ($(TARGET_OPENWRT),) LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libiptc) +endif LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libiptc) LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-other libiptc) else @@ -157,6 +160,8 @@ LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libmnl) LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack) endif # ($(TEST),1) +# OpenWrt packager disables https server for IGD v2 and hardcodes libuuid support +ifeq ($(TARGET_OPENWRT),) LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl) TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1) @@ -165,6 +170,7 @@ LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid) else $(info please install uuid-dev package / libuuid) endif # ($(TEST),1) +endif # ($(TARGET_OPENWRT,) GLIBC_VERSION := $(shell ldd --version | head -n 1 | sed 's/^.* //') GLIBC_VERSION_MAJOR = $(shell echo $(GLIBC_VERSION) | cut -f 1 -d . ) diff --git a/miniupnpd/genconfig.sh b/miniupnpd/genconfig.sh index fe3d3cb..35aa9d1 100755 --- a/miniupnpd/genconfig.sh +++ b/miniupnpd/genconfig.sh @@ -379,12 +379,19 @@ case $FW in esac # UUID API -if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then - echo "#define BSD_UUID" >> ${CONFIGFILE} -fi -if grep uuid_generate /usr/include/uuid/uuid.h > /dev/null 2>&1 ; then - echo "#define LIB_UUID" >> ${CONFIGFILE} -fi +case $OS_NAME in + OpenWRT) + echo "#define LIB_UUID" >> ${CONFIGFILE} + ;; + *) + if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then + echo "#define BSD_UUID" >> ${CONFIGFILE} + fi + if grep uuid_generate /usr/include/uuid/uuid.h > /dev/null 2>&1 ; then + echo "#define LIB_UUID" >> ${CONFIGFILE} + fi + ;; +esac # set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then