miniupnpd: Makefile: move libssl detection to configure

fix: use "openssl" pkg-config instead of "libssl"
(libcrypto was missing)

Improvement : libssl is linked only when needed
(IGD2 and HTTPS both enabled)
This commit is contained in:
Ivan Shapovalov 2024-09-03 14:49:10 +02:00 committed by Thomas Bernard
parent 6ab64d765b
commit d1fb15e40e
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
4 changed files with 16 additions and 9 deletions

View File

@ -120,8 +120,6 @@ LIBS += -lkvm
LIBS += -lsocket -lnsl -lkstat -lresolv
.endif
LIBS += -lssl -lcrypto
# set PREFIX variable to install in the wanted place
INSTALLBINDIR = $(PREFIX)/sbin

View File

@ -74,11 +74,6 @@ NETFILTER_SCRIPTS = $(addprefix $(SRCDIR)/netfilter/, \
#LDLIBS += -lnfnetlink
# OpenWrt packager disables https server for IGD v2 and hardcodes libuuid support
ifeq ($(TARGET_OPENWRT),)
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
endif # ($(TARGET_OPENWRT,)
ifneq ($(shell ldd --version | grep GLIBC),)
GLIBC_VERSION := $(shell ldd --version | head -n 1 | sed 's/^.* //')
GLIBC_VERSION_MAJOR = $(shell echo $(GLIBC_VERSION) | cut -f 1 -d . )

View File

@ -67,8 +67,6 @@ NFT_SCRIPTS = $(addprefix $(SRCDIR)/netfilter_nft/scripts/, \
#LDLIBS += -lnfnetlink
LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl)
# genuuid uses the uuidgen CLI tool which is part of libuuid
# from the e2fsprogs
# 'cat /proc/sys/kernel/random/uuid' could be also used

16
miniupnpd/configure vendored
View File

@ -751,6 +751,22 @@ case $OS_FAMILY in
;;
esac
# OpenSSL : only with IGDv2 enabled
if [ -n "$HTTPS" ] && [ -n "$IGD2" ] ; then
case $OS_FAMILY in
Linux)
if pkg_detect openssl; then
:
else
echo "Warning: openssl pkg-config not found!"
fi
;;
*BSD)
echo "LIBS += -lssl -lcrypto" >> bsdmake.inc
;;
esac
fi
# set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above
if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then
V6SOCKETS_ARE_V6ONLY=0