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