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