linux: detect libcap-ng or libcap

This commit is contained in:
Thomas Bernard 2020-05-04 00:09:42 +02:00
parent ca0a3b30ba
commit 9ffc336b5c
1 changed files with 19 additions and 0 deletions

19
miniupnpd/configure vendored
View File

@ -529,6 +529,25 @@ case $FW in
;;
esac
if [ "$FW" = "iptables" ] || [ "$FW" = "nftables" ] ; then
# linux
if [ "$PKG_CONFIG" ] ; then
if ${PKG_CONFIG} --exists libcap-ng ; then
echo "detected libcap-ng `${PKG_CONFIG} --modversion libcap-ng`"
echo "CFLAGS += `${PKG_CONFIG} --cflags libcap-ng`" >> config.mk
echo "LDLIBS += `${PKG_CONFIG} --static --libs-only-l libcap-ng`" >> config.mk
echo "LDFLAGS += `${PKG_CONFIG} --libs-only-L --libs-only-other libcap-ng`" >> config.mk
echo "#define HAS_LIBCAP_NG" >> ${CONFIGFILE}
elif ${PKG_CONFIG} --exists libcap ; then
echo "detected libcap `${PKG_CONFIG} --modversion libcap`"
echo "CFLAGS += `${PKG_CONFIG} --cflags libcap`" >> config.mk
echo "LDLIBS += `${PKG_CONFIG} --static --libs-only-l libcap`" >> config.mk
echo "LDFLAGS += `${PKG_CONFIG} --libs-only-L --libs-only-other libcap`" >> config.mk
echo "#define HAS_LIBCAP" >> ${CONFIGFILE}
fi
fi
fi
if [ "$MAKEFILE" = "Makefile.bsd" ] || [ "$OS_NAME" = "Darwin" ] || [ "$OS_NAME" = "SunOS" ] ; then
echo "FWNAME = $FW" > bsdmake.inc
fi