]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blobdiff - configure
red: fix adaptive spelling
[lisovros/iproute2_canprio.git] / configure
index a903bb0c35f250cd756a80b035567bc06c28ec92..09a6987600fb2b8fa9749e146a6a3a67f4ad67a3 100755 (executable)
--- a/configure
+++ b/configure
@@ -3,7 +3,7 @@
 #
 INCLUDE=${1:-"$PWD/include"}
 
-function check_atm
+check_atm()
 {
 cat >/tmp/atmtest.c <<EOF
 #include <atm.h>
@@ -24,7 +24,7 @@ fi
 rm -f /tmp/atmtest.c /tmp/atmtest
 }
 
-function check_xt
+check_xt()
 {
 #check if we have xtables from iptables >= 1.4.5.
 cat >/tmp/ipttest.c <<EOF
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
 
 EOF
 
-if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
+if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL $(pkg-config xtables --cflags --libs) -ldl >/dev/null 2>&1
 then
        echo "TC_CONFIG_XT:=y" >>Config
        echo "using xtables"
@@ -55,7 +55,7 @@ fi
 rm -f /tmp/ipttest.c /tmp/ipttest
 }
 
-function check_xt_old
+check_xt_old()
 {
 # bail if previous XT checks has already succeded.
 if grep TC_CONFIG_XT Config > /dev/null
@@ -63,7 +63,7 @@ then
        return
 fi
 
-#check if we need dont our internal header ..
+#check if we dont need our internal header ..
 cat >/tmp/ipttest.c <<EOF
 #include <xtables.h>
 char *lib_dir;
@@ -94,7 +94,7 @@ fi
 rm -f /tmp/ipttest.c /tmp/ipttest
 }
 
-function check_xt_old_internal_h
+check_xt_old_internal_h()
 {
 # bail if previous XT checks has already succeded.
 if grep TC_CONFIG_XT Config > /dev/null
@@ -134,7 +134,7 @@ fi
 rm -f /tmp/ipttest.c /tmp/ipttest
 }
 
-function check_ipt
+check_ipt()
 {
        if ! grep TC_CONFIG_XT Config > /dev/null
        then
@@ -142,6 +142,43 @@ function check_ipt
        fi
 }
 
+check_ipt_lib_dir()
+{
+       IPT_LIB_DIR=""
+       for dir in /lib /usr/lib /usr/local/lib
+       do
+               for file in $dir/{xtables,iptables}/lib*t_*so ; do
+                       if [ -f $file ]; then
+                               echo ${file%/*}
+                               echo "IPT_LIB_DIR:=${file%/*}" >> Config
+                               return
+                       fi
+               done
+       done
+       echo "not found!"
+}
+
+check_setns()
+{
+cat >/tmp/setnstest.c <<EOF
+#include <sched.h>
+int main(int argc, char **argv) 
+{
+       (void)setns(0,0);
+       return 0;
+}
+EOF
+gcc -I$INCLUDE -o /tmp/setnstest /tmp/setnstest.c >/dev/null 2>&1
+if [ $? -eq 0 ]
+then
+       echo "IP_CONFIG_SETNS:=y" >>Config
+       echo "yes"
+else
+       echo "no"
+fi
+rm -f /tmp/setnstest.c /tmp/setnstest
+}
+
 echo "# Generated config based on" $INCLUDE >Config
 
 echo "TC schedulers"
@@ -155,3 +192,8 @@ check_xt_old
 check_xt_old_internal_h
 check_ipt
 
+echo -n "iptables modules directory: "
+check_ipt_lib_dir
+
+echo -n "libc has setns: "
+check_setns