Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: iptables.patch

Issue 8494091: ABP/Android iptables build (Closed)
Patch Set: Created Oct. 5, 2012, 9:21 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff -u -r --unidirectional-new-file '--exclude=libxt_*.c' '--exclude=libipt_*.c ' '--exclude=libip6t_*.c' android-source/external/iptables/Android.mk iptables/A ndroid.mk
2 --- android-source/external/iptables/Android.mk 2012-05-30 14:16:39.408709076 +0 400
3 +++ iptables/Android.mk 2012-05-30 18:50:01.378032668 +0400
4 @@ -1,5 +1,3 @@
5 -BUILD_IPTABLES_V14 := 1
6 -
7 LOCAL_PATH:= $(call my-dir)
8
9 include $(call all-subdir-makefiles)
10 diff -u -r --unidirectional-new-file '--exclude=libxt_*.c' '--exclude=libipt_*.c ' '--exclude=libip6t_*.c' android-source/external/iptables/extensions/Android.mk iptables/extensions/Android.mk
11 --- android-source/external/iptables/extensions/Android.mk 2012-05-30 14:16 :39.411709447 +0400
12 +++ iptables/extensions/Android.mk 2012-06-01 12:24:42.946696872 +0400
13 @@ -4,7 +4,13 @@
14
15 MY_srcdir:=$(LOCAL_PATH)
16 # Exclude some modules that are problematic to compile (types/header).
17 -MY_excluded_modules:=TCPOPTSTRIP
18 +MY_excluded_modules:=TCPOPTSTRIP MIRROR LOG TTL NETMAP ULOG MASQUERADE icmp ecn SAME realm \
19 + SNAT CLUSTERIP ah ECN unclean addrtype ttl dscp NFQUEUE NFLOG physdev TE E CONNSECMARK \
20 + SECMARK string recent hashlimit cpu CT sctp AUDIT osf connmark CONNMARK conntrack \
21 + quota2 quota TRACE policy u32 udp cluster tos CLASSIFY comment TPROXY RA TEEST time \
22 + set mark MARK IDLETIMER state devgroup limit LED connlimit pkttype TCPMS S TOS esp \
23 + CHECKSUM socket statistic connbytes NOTRACK DSCP iprange length tcpmss m ac rateest \
24 + helper
25
26 MY_pfx_build_mod := $(patsubst ${MY_srcdir}/libxt_%.c,%,$(wildcard ${MY_srcdir} /libxt_*.c))
27 MY_pf4_build_mod := $(patsubst ${MY_srcdir}/libipt_%.c,%,$(wildcard ${MY_srcdir }/libipt_*.c))
28 @@ -46,7 +52,8 @@
29
30 MY_initext_func := $(addprefix xt_,${MY_pfx_build_mod})
31 MY_GEN_INITEXT:= $(MY_intermediates)/initext.c
32 -$(MY_GEN_INITEXT):
33 +LOCAL_GEN_INITEXT:= $(LOCAL_PATH)/$(MY_GEN_INITEXT)
34 +$(LOCAL_GEN_INITEXT):
35 @mkdir -p $(dir $@)
36 @( \
37 echo "" >$@; \
38 @@ -76,7 +83,7 @@
39
40 $(MY_intermediates)/initext.o : $(MY_GEN_INITEXT) $(MY_gen_lib_sources)
41
42 -LOCAL_GENERATED_SOURCES:= $(MY_GEN_INITEXT) $(MY_gen_lib_sources)
43 +LOCAL_SRC_FILES:= $(MY_GEN_INITEXT) $(MY_gen_lib_sources)
44
45 include $(BUILD_STATIC_LIBRARY)
46
47 @@ -109,7 +116,8 @@
48
49 MY_initext4_func := $(addprefix ipt_,${MY_pf4_build_mod})
50 MY_GEN_INITEXT4:= $(MY_intermediates)/initext4.c
51 -$(MY_GEN_INITEXT4):
52 +LOCAL_GEN_INITEXT4:= $(LOCAL_PATH)/$(MY_GEN_INITEXT4)
53 +$(LOCAL_GEN_INITEXT4):
54 @mkdir -p $(dir $@)
55 @( \
56 echo "" >$@; \
57 @@ -139,7 +147,7 @@
58
59 $(MY_intermediates)/initext4.o : $(MY_GEN_INITEXT4) $(MY_gen_lib_sources)
60
61 -LOCAL_GENERATED_SOURCES:= $(MY_GEN_INITEXT4) ${MY_gen_lib_sources}
62 +LOCAL_SRC_FILES:= $(MY_GEN_INITEXT4) ${MY_gen_lib_sources}
63
64 include $(BUILD_STATIC_LIBRARY)
65
66 @@ -172,7 +180,8 @@
67
68 MY_initext6_func := $(addprefix ip6t_,${MY_pf6_build_mod})
69 MY_GEN_INITEXT6:= $(MY_intermediates)/initext6.c
70 -$(MY_GEN_INITEXT6):
71 +LOCAL_GEN_INITEXT6:= $(LOCAL_PATH)/$(MY_GEN_INITEXT6)
72 +$(LOCAL_GEN_INITEXT6):
73 @mkdir -p $(dir $@)
74 @( \
75 echo "" >$@; \
76 @@ -202,7 +211,7 @@
77
78 $(MY_intermediates)/initext6.o : $(MY_GEN_INITEXT6) $(MY_gen_lib_sources)
79
80 -LOCAL_GENERATED_SOURCES:= $(MY_GEN_INITEXT6) $(MY_gen_lib_sources)
81 +LOCAL_SRC_FILES:= $(MY_GEN_INITEXT6) $(MY_gen_lib_sources)
82
83 include $(BUILD_STATIC_LIBRARY)
84
85 diff -u -r --unidirectional-new-file '--exclude=libxt_*.c' '--exclude=libipt_*.c ' '--exclude=libip6t_*.c' android-source/external/iptables/extensions/fixinit.py iptables/extensions/fixinit.py
86 --- android-source/external/iptables/extensions/fixinit.py 1970-01-01 03:00 :00.000000000 +0300
87 +++ iptables/extensions/fixinit.py 2012-05-31 00:35:59.927307126 +0400
88 @@ -0,0 +1,31 @@
89 +#!/usr/bin/python
90 +# Author: Rodrigo Zechin Rosauro
91 +"""
92 +This script will convert all _init() functions on iptables extension sources in order
93 +to compile then on Android.
94 +This will for example, convert "void _init(void)" on libipt_LOG.c to "void libi pt_LOG_init(void)".
95 +This is necessary because we cannot use the "-D_INIT=$*_init" on LOCAL_CFLAGS d ue to the way NDK works.
96 +"""
97 +
98 +import sys, os, glob, re
99 +
100 +def main():
101 + regex=re.compile(r"[^\w]_init\s*\(")
102 + os.chdir(os.path.dirname(os.path.abspath(__file__)))
103 + for prefix in ("libxt", "libipt", "libip6t"):
104 + for src in glob.glob("%s_*.c"%prefix):
105 + name = src.replace(".c","")
106 + f=open(src, "r")
107 + data=f.read()
108 + f.close()
109 + if regex.search(data):
110 + print "Converting %s..."%src
111 + data=regex.sub(" %s_init("%name, data)
112 + f=open(src, "w")
113 + f.write(data)
114 + f.close()
115 + print "DONE!"
116 +
117 +if __name__=="__main__":
118 + main()
119 +
120 diff -u -r --unidirectional-new-file '--exclude=libxt_*.c' '--exclude=libipt_*.c ' '--exclude=libip6t_*.c' android-source/external/iptables/Makefile iptables/Mak efile
121 --- android-source/external/iptables/Makefile 1970-01-01 03:00:00.000000000 +0 300
122 +++ iptables/Makefile 2012-06-01 11:48:49.180876859 +0400
123 @@ -0,0 +1,15 @@
124 +all: fixextensions build release
125 +
126 +clean:
127 + rm extensions/initext*
128 + rm -rf obj/
129 +
130 +fixextensions:
131 + python extensions/fixinit.py
132 +
133 +build:
134 + ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk
135 +
136 +release:
137 + strip obj/local/armeabi/iptables
138 + strip obj/local/armeabi/ip6tables
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld