-ifeq ($(KERNEL),2.4)
- define Build/Configure
- chmod a+x $(PKG_BUILD_DIR)/extensions/.*-test*
- rm -f $(PKG_BUILD_DIR)/.configured*
- $(MAKE) -C $(PKG_BUILD_DIR) \
- clean
- endef
-endif
-
-TARGET_CFLAGS += $(FPIC)
-CONFIGURE_ARGS += --enable-devel --with-xtlibdir=/usr/lib/iptables
-
-define Build/Compile
- mkdir -p $(PKG_INSTALL_DIR)
- $(MAKE) -C $(PKG_BUILD_DIR) \
- $(TARGET_CONFIGURE_OPTS) \
- COPT_FLAGS="$(TARGET_CFLAGS)" \
- LDFLAGS="-rdynamic -static-libgcc" \
- KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
- KBUILD_OUTPUT="$(LINUX_DIR)" \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- all install $(MAKE_TARGETS)
-endef
+define Package/libxtables
+ $(call Package/iptables/Default)
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=IPv4/IPv6 firewall - shared xtables library
+endef
+
+define Package/libipq
+ $(call Package/iptables/Default)
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=IPv4/IPv6 firewall - shared libipq library
+endef
+
+TARGET_CPPFLAGS := \
+ -I$(PKG_BUILD_DIR)/include \
+ -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
+ $(TARGET_CPPFLAGS)
+
+TARGET_CFLAGS += \
+ -I$(PKG_BUILD_DIR)/include \
+ -I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include
+
+CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-devel \
+ --enable-ipv6 \
+ --enable-libipq \
+ --with-kernel="$(LINUX_DIR)" \
+ --with-xtlibdir=/usr/lib/iptables
+
+MAKE_FLAGS := \
+ $(TARGET_CONFIGURE_OPTS) \
+ COPT_FLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="-rdynamic -static-libgcc" \
+ KERNEL_DIR="$(LINUX_DIR)" PREFIX=/usr \
+ KBUILD_OUTPUT="$(LINUX_DIR)" \