Try to automatically detect iptables modules directory.
Make the configure script look for iptables modules.
This also makes it possible to specify it on the
command line while building via "make IPT_LIB_DIR=/foo/bar".
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
#
INCLUDE=${1:-"$PWD/include"}
#
INCLUDE=${1:-"$PWD/include"}
check_atm()
{
cat >/tmp/atmtest.c <<EOF
check_atm()
{
cat >/tmp/atmtest.c <<EOF
if ! grep TC_CONFIG_XT Config > /dev/null
then
echo "using iptables"
if ! grep TC_CONFIG_XT Config > /dev/null
then
echo "using iptables"
+ TABLES="iptables"
+ else
+ TABLES="xtables"
+check_ipt_lib_dir()
+{
+ IPT_LIB_DIR=""
+ for dir in /lib /usr/lib /usr/local/lib
+ do
+ for file in $dir/$TABLES/lib*t_*so ; do
+ if [ -f $file ]; then
+ echo $dir/$TABLES
+ echo "IPT_LIB_DIR:=$dir/$TABLES" >> Config
+ return
+ fi
+ done
+ done
+ echo "not found!"
+}
+
echo "# Generated config based on" $INCLUDE >Config
echo "TC schedulers"
echo "# Generated config based on" $INCLUDE >Config
echo "TC schedulers"
check_xt_old_internal_h
check_ipt
check_xt_old_internal_h
check_ipt
+echo -n "iptables modules directory: "
+check_ipt_lib_dir
TCLIB += tc_stab.o
CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB
TCLIB += tc_stab.o
CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB
+ifneq ($(IPT_LIB_DIR),)
+ CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
+endif
TCSO :=
ifeq ($(TC_CONFIG_ATM),y)
TCSO :=
ifeq ($(TC_CONFIG_ATM),y)