]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - configure
v4.4.0
[mirror_iproute2.git] / configure
index c3dacdba14ff3e9cd1c2d462c5e349d6f09b2b64..d2540b0d321994900e4f90df34de31e563aac155 100755 (executable)
--- a/configure
+++ b/configure
@@ -201,7 +201,7 @@ check_setns()
 {
     cat >$TMPDIR/setnstest.c <<EOF
 #include <sched.h>
-int main(int argc, char **argv) 
+int main(int argc, char **argv)
 {
        (void)setns(0,0);
        return 0;
@@ -249,6 +249,29 @@ EOF
     rm -f $TMPDIR/ipsettest.c $TMPDIR/ipsettest
 }
 
+check_elf()
+{
+    cat >$TMPDIR/elftest.c <<EOF
+#include <libelf.h>
+#include <gelf.h>
+int main(void)
+{
+       Elf_Scn *scn;
+       GElf_Shdr shdr;
+       return elf_version(EV_CURRENT);
+}
+EOF
+
+    if $CC -I$INCLUDE -o $TMPDIR/elftest $TMPDIR/elftest.c -lelf >/dev/null 2>&1
+    then
+       echo "TC_CONFIG_ELF:=y" >>Config
+       echo "yes"
+    else
+       echo "no"
+    fi
+    rm -f $TMPDIR/elftest.c $TMPDIR/elftest
+}
+
 check_selinux()
 # SELinux is a compile time option in the ss utility
 {
@@ -261,6 +284,39 @@ check_selinux()
        fi
 }
 
+check_mnl()
+{
+       if ${PKG_CONFIG} libmnl --exists
+       then
+               echo "HAVE_MNL:=y" >>Config
+               echo "yes"
+       else
+               echo "no"
+       fi
+}
+
+check_berkeley_db()
+{
+    cat >$TMPDIR/dbtest.c <<EOF
+#include <fcntl.h>
+#include <stdlib.h>
+#include <db_185.h>
+int main(int argc, char **argv) {
+       dbopen("/tmp/xxx_test_db.db", O_CREAT|O_RDWR, 0644, DB_HASH, NULL);
+       return 0;
+}
+EOF
+    $CC -I$INCLUDE -o $TMPDIR/dbtest $TMPDIR/dbtest.c -ldb >/dev/null 2>&1
+    if [ $? -eq 0 ]
+    then
+       echo "HAVE_BERKELEY_DB:=y" >>Config
+       echo "yes"
+    else
+       echo "no"
+    fi
+    rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest
+}
+
 echo "# Generated config based on" $INCLUDE >Config
 check_toolchain
 
@@ -278,7 +334,8 @@ check_ipt
 echo -n " IPSET  "
 check_ipset
 
-echo -n -e "\niptables modules directory: "
+echo
+echo -n "iptables modules directory: "
 check_ipt_lib_dir
 
 echo -n "libc has setns: "
@@ -287,5 +344,16 @@ check_setns
 echo -n "SELinux support: "
 check_selinux
 
-echo -e "\nDocs"
+echo -n "ELF support: "
+check_elf
+
+echo -n "libmnl support: "
+check_mnl
+
+echo -n "Berkeley DB: "
+check_berkeley_db
+
+echo
+echo -n "docs:"
 check_docs
+echo