From cd01381bb3bdbe904ff0137c95553441bea41661 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Tue, 3 Sep 2024 14:22:06 +0200 Subject: [PATCH] miniupnpd: Makefile: move libuuid detection to configure --- miniupnpd/Makefile.linux | 7 ------- miniupnpd/Makefile.linux_nft | 7 ------- miniupnpd/configure | 13 ++++++++++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/miniupnpd/Makefile.linux b/miniupnpd/Makefile.linux index f7648d2..5058125 100644 --- a/miniupnpd/Makefile.linux +++ b/miniupnpd/Makefile.linux @@ -77,13 +77,6 @@ NETFILTER_SCRIPTS = $(addprefix $(SRCDIR)/netfilter/, \ # 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) -ifeq ($(TEST),1) -LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid) -else -$(info please install uuid-dev package / libuuid) -endif # ($(TEST),1) endif # ($(TARGET_OPENWRT,) ifneq ($(shell ldd --version | grep GLIBC),) diff --git a/miniupnpd/Makefile.linux_nft b/miniupnpd/Makefile.linux_nft index a42f434..7006de3 100644 --- a/miniupnpd/Makefile.linux_nft +++ b/miniupnpd/Makefile.linux_nft @@ -69,13 +69,6 @@ NFT_SCRIPTS = $(addprefix $(SRCDIR)/netfilter_nft/scripts/, \ LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl) -TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1) -ifeq ($(TEST),1) -LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid) -else -$(info please install uuid-dev package / libuuid) -endif # ($(TEST),1) - # genuuid uses the uuidgen CLI tool which is part of libuuid # from the e2fsprogs # 'cat /proc/sys/kernel/random/uuid' could be also used diff --git a/miniupnpd/configure b/miniupnpd/configure index a8576b3..a62f09c 100755 --- a/miniupnpd/configure +++ b/miniupnpd/configure @@ -716,9 +716,16 @@ if [ "$MAKEFILE" ] ; then fi # UUID API -case $OS_NAME in - OpenWrt) - echo "#define LIB_UUID" >> ${CONFIGFILE} +case $OS_FAMILY in + Linux) + if [ "$OS_NAME" = "OpenWrt" ]; then + # OpenWrt hardcodes libuuid support + echo "#define LIB_UUID" >> ${CONFIGFILE} + elif pkg_detect uuid; then + echo "#define LIB_UUID" >> ${CONFIGFILE} + else + echo "Warning: uuid pkg-config not found" + fi ;; *) if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then