#
INCLUDE=${1:-"$PWD/include"}
-TABLES=
-
check_atm()
{
cat >/tmp/atmtest.c <<EOF
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"
if ! grep TC_CONFIG_XT Config > /dev/null
then
echo "using iptables"
- TABLES="iptables"
- else
- TABLES="xtables"
fi
}
IPT_LIB_DIR=""
for dir in /lib /usr/lib /usr/local/lib
do
- for file in $dir/$TABLES/lib*t_*so ; do
+ for file in $dir/{xtables,iptables}/lib*t_*so ; do
if [ -f $file ]; then
- echo $dir/$TABLES
- echo "IPT_LIB_DIR:=$dir/$TABLES" >> Config
+ echo ${file%/*}
+ echo "IPT_LIB_DIR:=${file%/*}" >> Config
return
fi
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"
echo -n "iptables modules directory: "
check_ipt_lib_dir
+
+echo -n "libc has setns: "
+check_setns