]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - configure
Drop capabilities if not running ip exec vrf with libcap
[mirror_iproute2.git] / configure
index f0668ab3f7e9120d09e559aab1517edc248031c2..5ef5cd4cf9cde980c5951153594a9c93de3bf41c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,4 +1,5 @@
 #! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
 # This is not an autoconf generated configure
 #
 INCLUDE=${1:-"$PWD/include"}
@@ -16,18 +17,6 @@ check_prog()
     command -v $1 >/dev/null 2>&1 && (echo "$3:=y" >> $CONFIG; echo "yes") || (echo "no"; return 1)
 }
 
-check_docs()
-{
-    if check_prog latex " latex: " HAVE_LATEX; then
-        check_prog pdflatex " pdflatex: " HAVE_PDFLATEX || echo " WARNING: no PDF docs can be built from LaTeX files"
-        check_prog sgml2latex " sgml2latex: " HAVE_SGML2LATEX || echo " WARNING: no LaTeX files can be build from SGML files"
-    else
-        echo " WARNING: no docs can be built from LaTeX files"
-    fi
-
-    check_prog sgml2html " sgml2html: " HAVE_SGML2HTML || echo " WARNING: no HTML docs can be built from SGML"
-}
-
 check_toolchain()
 {
     : ${PKG_CONFIG:=pkg-config}
@@ -347,6 +336,20 @@ EOF
     rm -f $TMPDIR/strtest.c $TMPDIR/strtest
 }
 
+check_cap()
+{
+       if ${PKG_CONFIG} libcap --exists
+       then
+               echo "HAVE_CAP:=y" >>$CONFIG
+               echo "yes"
+
+               echo 'CFLAGS += -DHAVE_LIBCAP' `${PKG_CONFIG} libcap --cflags` >>$CONFIG
+               echo 'LDLIBS +=' `${PKG_CONFIG} libcap --libs` >> $CONFIG
+       else
+               echo "no"
+       fi
+}
+
 quiet_config()
 {
        cat <<EOF
@@ -421,10 +424,8 @@ check_berkeley_db
 echo -n "need for strlcpy: "
 check_strlcpy
 
-echo
-echo -n "docs:"
-check_docs
-echo
+echo -n "libcap support: "
+check_cap
 
 echo >> $CONFIG
 echo "%.o: %.c" >> $CONFIG