1ifneq ($(TARGET_SIMULATOR),true) 2 BUILD_IPTABLES := 1 3endif 4ifeq ($(BUILD_IPTABLES),1) 5 6LOCAL_PATH:= $(call my-dir) 7 8# 9# Build libraries 10# 11 12# libiptc 13 14include $(CLEAR_VARS) 15 16LOCAL_C_INCLUDES:= \ 17 $(KERNEL_HEADERS) \ 18 $(LOCAL_PATH)/include/ 19 20LOCAL_CFLAGS:=-DNO_SHARED_LIBS 21 22LOCAL_SRC_FILES:= \ 23 libiptc/libip4tc.c 24 25LOCAL_MODULE_TAGS:=debug 26LOCAL_MODULE:=libiptc 27 28include $(BUILD_STATIC_LIBRARY) 29 30# libext 31 32include $(CLEAR_VARS) 33 34LOCAL_MODULE_TAGS:=debug 35LOCAL_MODULE:=libext 36 37# LOCAL_MODULE_CLASS must be defined before calling $(local-intermediates-dir) 38# 39LOCAL_MODULE_CLASS := STATIC_LIBRARIES 40intermediates := $(call local-intermediates-dir) 41 42LOCAL_C_INCLUDES:= \ 43 $(LOCAL_PATH)/include/ \ 44 $(KERNEL_HEADERS) \ 45 $(intermediates)/extensions/ 46 47LOCAL_CFLAGS:=-DNO_SHARED_LIBS 48LOCAL_CFLAGS+=-D_INIT=$*_init 49LOCAL_CFLAGS+=-DIPTABLES_VERSION=\"1.3.7\" 50 51PF_EXT_SLIB:=ah addrtype comment 2connmark conntrack 2dscp 2ecn esp 52PF_EXT_SLIB+=hashlimit helper icmp iprange length limit mac multiport #2mark 53PF_EXT_SLIB+=owner physdev pkttype policy realm sctp standard state tcp 54PF_EXT_SLIB+=2tcpmss 2tos 2ttl udp unclean CLASSIFY CONNMARK DNAT LOG #DSCP ECN 55PF_EXT_SLIB+=MASQUERADE MIRROR NETMAP NFQUEUE NOTRACK REDIRECT REJECT #MARK 56PF_EXT_SLIB+=SAME SNAT ULOG # TOS TCPMSS TTL 57 58EXT_FUNC+=$(foreach T,$(PF_EXT_SLIB),ipt_$(T)) 59 60# generated headers 61 62GEN_INITEXT:= $(intermediates)/extensions/gen_initext.c 63$(GEN_INITEXT): PRIVATE_PATH := $(LOCAL_PATH) 64$(GEN_INITEXT): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/extensions/create_initext "$(EXT_FUNC)" > $@ 65$(GEN_INITEXT): PRIVATE_MODULE := $(LOCAL_MODULE) 66$(GEN_INITEXT): 67 $(transform-generated-source) 68 69$(intermediates)/extensions/initext.o : $(GEN_INITEXT) 70 71LOCAL_GENERATED_SOURCES:= $(GEN_INITEXT) 72 73LOCAL_SRC_FILES:= \ 74 $(foreach T,$(PF_EXT_SLIB),extensions/libipt_$(T).c) \ 75 extensions/initext.c 76 77LOCAL_STATIC_LIBRARIES := \ 78 libc 79 80include $(BUILD_STATIC_LIBRARY) 81 82# 83# Build iptables 84# 85 86include $(CLEAR_VARS) 87 88LOCAL_C_INCLUDES:= \ 89 $(LOCAL_PATH)/include/ \ 90 $(KERNEL_HEADERS) 91 92LOCAL_CFLAGS:=-DNO_SHARED_LIBS 93LOCAL_CFLAGS+=-DIPTABLES_VERSION=\"1.3.7\" # -DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" 94#LOCAL_CFLAGS+=-DIPT_LIB_DIR=\"$(IPT_LIBDIR)\" 95 96LOCAL_SRC_FILES:= \ 97 iptables.c \ 98 iptables-standalone.c 99 100LOCAL_MODULE_TAGS:=debug 101LOCAL_MODULE:=iptables 102 103LOCAL_STATIC_LIBRARIES := \ 104 libiptc \ 105 libext 106 107include $(BUILD_EXECUTABLE) 108 109endif 110