]>
Commit | Line | Data |
---|---|---|
a95c632b AD |
1 | // Copyright 2017 The Android Open Source Project |
2 | ||
3 | // Library used to export files from this directory to other programs in this | |
4 | // project. | |
5 | cc_library { | |
6 | name: "libext2_misc", | |
7 | host_supported: true, | |
c19b18f8 | 8 | defaults: ["e2fsprogs-defaults"], |
a95c632b | 9 | |
0a3d8041 JQ |
10 | target: { |
11 | windows: { | |
12 | include_dirs: [ "external/e2fsprogs/include/mingw" ], | |
182fa0cd DW |
13 | enabled: true, |
14 | cflags: ["-Wno-unused-variable"], | |
0a3d8041 JQ |
15 | }, |
16 | }, | |
17 | ||
a95c632b AD |
18 | srcs: [ |
19 | "create_inode.c", | |
20 | ], | |
c19b18f8 | 21 | cflags: ["-Wno-error=format-extra-args"], |
a95c632b AD |
22 | shared_libs: [ |
23 | "libext2_quota", | |
24 | "libext2fs", | |
25 | ], | |
88ca49f9 | 26 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
27 | export_include_dirs: ["."], |
28 | } | |
29 | ||
30 | //######################################################################## | |
31 | // Build mke2fs | |
32 | ||
33 | cc_binary { | |
34 | name: "mke2fs", | |
35 | host_supported: true, | |
c19b18f8 | 36 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
37 | |
38 | srcs: [ | |
39 | "mke2fs.c", | |
40 | "util.c", | |
41 | "mk_hugefiles.c", | |
42 | "default_profile.c", | |
a95c632b | 43 | ], |
25a03337 SM |
44 | cflags: [ |
45 | "-Wno-error=format", | |
46 | "-Wno-error=type-limits", | |
47 | "-Wno-format-extra-args", | |
38aaf9d5 | 48 | ], |
bee92ebe JQ |
49 | target: { |
50 | host: { | |
51 | static_libs: [ | |
52 | "libext2_blkid", | |
53 | "libext2_misc", | |
54 | "libext2_uuid", | |
55 | "libext2_quota", | |
56 | "libext2_com_err", | |
57 | "libext2_e2p", | |
58 | "libext2fs", | |
59 | "libsparse", | |
60 | "libbase", | |
61 | "libz", | |
62 | ], | |
63 | }, | |
25a03337 SM |
64 | not_windows: { |
65 | required: [ | |
66 | "mke2fs.conf", | |
67 | ], | |
68 | }, | |
0a3d8041 JQ |
69 | windows: { |
70 | include_dirs: [ "external/e2fsprogs/include/mingw" ], | |
c19b18f8 TT |
71 | cflags: [ |
72 | "-D_POSIX", | |
73 | "-D__USE_MINGW_ALARM", | |
74 | // mke2fs.c has a warning from gcc which cannot be suppressed: | |
75 | // passing argument 3 of 'ext2fs_get_device_size' from | |
76 | // incompatible pointer type | |
77 | "-Wno-error" | |
78 | ], | |
0a3d8041 JQ |
79 | ldflags: ["-static"], |
80 | host_ldlibs: ["-lws2_32"], | |
81 | enabled: true | |
82 | }, | |
bee92ebe | 83 | android: { |
25a03337 SM |
84 | required: [ |
85 | "mke2fs.conf", | |
86 | ], | |
bee92ebe JQ |
87 | shared_libs: [ |
88 | "libext2fs", | |
89 | "libext2_blkid", | |
90 | "libext2_misc", | |
91 | "libext2_uuid", | |
92 | "libext2_quota", | |
93 | "libext2_com_err", | |
94 | "libext2_e2p", | |
95 | ], | |
25a03337 | 96 | symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"], |
bee92ebe JQ |
97 | }, |
98 | }, | |
99 | stl: "libc++_static", | |
a95c632b AD |
100 | include_dirs: ["external/e2fsprogs/e2fsck"], |
101 | } | |
102 | ||
103 | //########################################################################## | |
104 | // Build tune2fs | |
105 | ||
106 | cc_defaults { | |
107 | name: "tune2fs-defaults", | |
c19b18f8 | 108 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
109 | srcs: [ |
110 | "tune2fs.c", | |
111 | "util.c", | |
112 | ], | |
c19b18f8 | 113 | cflags: ["-DNO_RECOVERY"], |
a95c632b AD |
114 | include_dirs: ["external/e2fsprogs/e2fsck"], |
115 | } | |
116 | ||
117 | tune2fs_libs = [ | |
118 | "libext2_com_err", | |
119 | "libext2_blkid", | |
120 | "libext2_quota", | |
121 | "libext2_uuid", | |
122 | "libext2_e2p", | |
123 | "libext2fs", | |
124 | ] | |
125 | ||
126 | cc_binary { | |
127 | name: "tune2fs", | |
128 | host_supported: true, | |
129 | defaults: ["tune2fs-defaults"], | |
130 | ||
131 | shared_libs: tune2fs_libs, | |
88ca49f9 | 132 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
133 | } |
134 | ||
135 | cc_binary { | |
136 | name: "tune2fs_static", | |
137 | static_executable: true, | |
138 | defaults: ["tune2fs-defaults"], | |
139 | ||
33b80078 | 140 | static_libs: tune2fs_libs, |
a95c632b AD |
141 | } |
142 | ||
143 | cc_library_static { | |
144 | name: "libtune2fs", | |
145 | defaults: ["tune2fs-defaults"], | |
146 | ||
147 | cflags: ["-DBUILD_AS_LIB"], | |
148 | static_libs: tune2fs_libs, | |
149 | } | |
150 | ||
151 | //######################################################################## | |
152 | // Build badblocks | |
153 | ||
154 | cc_binary { | |
155 | name: "badblocks", | |
156 | host_supported: true, | |
c19b18f8 | 157 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
158 | |
159 | srcs: ["badblocks.c"], | |
a95c632b AD |
160 | shared_libs: [ |
161 | "libext2fs", | |
162 | "libext2_com_err", | |
163 | "libext2_uuid", | |
164 | "libext2_blkid", | |
165 | "libext2_e2p", | |
166 | ], | |
88ca49f9 | 167 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
168 | } |
169 | ||
170 | //######################################################################## | |
171 | // Build chattr | |
172 | ||
173 | cc_binary { | |
174 | name: "chattr", | |
175 | host_supported: true, | |
c19b18f8 | 176 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
177 | |
178 | srcs: ["chattr.c"], | |
a95c632b AD |
179 | shared_libs: [ |
180 | "libext2_com_err", | |
181 | "libext2_e2p", | |
182 | ], | |
88ca49f9 | 183 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
184 | } |
185 | ||
186 | //######################################################################## | |
187 | // Build lsattr | |
188 | ||
189 | cc_defaults { | |
190 | name: "lsattr-defaults", | |
191 | srcs: ["lsattr.c"], | |
c19b18f8 | 192 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
193 | } |
194 | ||
195 | lsattr_libs = [ | |
196 | "libext2_com_err", | |
197 | "libext2_e2p", | |
198 | ] | |
199 | ||
200 | cc_binary { | |
201 | name: "lsattr", | |
202 | host_supported: true, | |
203 | defaults: ["lsattr-defaults"], | |
204 | ||
205 | shared_libs: lsattr_libs, | |
88ca49f9 | 206 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
207 | } |
208 | ||
209 | cc_binary { | |
210 | name: "lsattr_static", | |
211 | static_executable: true, | |
212 | defaults: ["lsattr-defaults"], | |
213 | ||
33b80078 | 214 | static_libs: lsattr_libs, |
a95c632b AD |
215 | } |
216 | ||
217 | //######################################################################## | |
218 | // Build blkid | |
219 | ||
220 | cc_binary { | |
221 | name: "blkid", | |
c19b18f8 | 222 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
223 | |
224 | srcs: ["blkid.c"], | |
a95c632b AD |
225 | shared_libs: [ |
226 | "libext2fs", | |
227 | "libext2_blkid", | |
228 | "libext2_com_err", | |
229 | "libext2_e2p", | |
230 | ], | |
88ca49f9 | 231 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
232 | } |
233 | ||
234 | //######################################################################## | |
235 | // Build e4crypt | |
236 | ||
237 | cc_binary { | |
238 | name: "e4crypt", | |
239 | host_supported: true, | |
c19b18f8 | 240 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
241 | |
242 | srcs: ["e4crypt.c"], | |
a95c632b AD |
243 | shared_libs: [ |
244 | "libext2fs", | |
245 | "libext2_uuid", | |
246 | ], | |
88ca49f9 | 247 | system_shared_libs: ["libc", "libdl"], |
a95c632b AD |
248 | |
249 | target: { | |
250 | darwin: { | |
251 | enabled: false, | |
252 | }, | |
253 | }, | |
254 | } | |
255 | ||
256 | //########################################################################## | |
257 | // Build e2image | |
258 | ||
259 | cc_binary { | |
260 | name: "e2image", | |
261 | host_supported: true, | |
c19b18f8 | 262 | defaults: ["e2fsprogs-defaults"], |
a95c632b AD |
263 | |
264 | srcs: ["e2image.c"], | |
a95c632b AD |
265 | shared_libs: [ |
266 | "libext2fs", | |
267 | "libext2_blkid", | |
268 | "libext2_com_err", | |
269 | "libext2_quota", | |
270 | ], | |
88ca49f9 | 271 | system_shared_libs: ["libc", "libdl"], |
a95c632b | 272 | } |