Whamcloud - gitweb
757381d8c4f7f474ba056646f70d27b5b3206e9b
[tools/e2fsprogs.git] / misc / Android.bp
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,
8     recovery_available: true,
9     defaults: ["e2fsprogs-defaults"],
10
11     target: {
12         windows: {
13             include_dirs: [ "external/e2fsprogs/include/mingw" ],
14             enabled: true,
15             cflags: ["-Wno-unused-variable"],
16         },
17     },
18
19     srcs: [
20         "create_inode.c",
21     ],
22     cflags: ["-Wno-error=format-extra-args"],
23     shared_libs: [
24         "libext2fs",
25         "libext2_com_err",
26         "libext2_quota",
27     ],
28     system_shared_libs: ["libc", "libdl"],
29     export_include_dirs: ["."],
30 }
31
32 //########################################################################
33 // Build mke2fs
34
35 cc_binary {
36     name: "mke2fs",
37     host_supported: true,
38     recovery_available: true,
39     defaults: ["e2fsprogs-defaults"],
40
41     srcs: [
42         "mke2fs.c",
43         "util.c",
44         "mk_hugefiles.c",
45         "default_profile.c",
46     ],
47     cflags: [
48         "-Wno-error=format",
49         "-Wno-error=type-limits",
50         "-Wno-format-extra-args",
51     ],
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         },
67         not_windows: {
68             required: [
69                 "mke2fs.conf",
70             ],
71         },
72         windows: {
73             include_dirs: [ "external/e2fsprogs/include/mingw" ],
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             ],
82             ldflags: ["-static"],
83             host_ldlibs: ["-lws2_32"],
84             enabled: true
85         },
86         android: {
87             required: [
88                 "mke2fs.conf",
89             ],
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             ],
99             symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"],
100         },
101     },
102     stl: "libc++_static",
103     include_dirs: ["external/e2fsprogs/e2fsck"],
104 }
105
106 //##########################################################################
107 // Build tune2fs
108
109 cc_defaults {
110     name: "tune2fs-defaults",
111     defaults: ["e2fsprogs-defaults"],
112     srcs: [
113         "tune2fs.c",
114         "util.c",
115     ],
116     cflags: ["-DNO_RECOVERY"],
117     include_dirs: ["external/e2fsprogs/e2fsck"],
118 }
119
120 tune2fs_libs = [
121     "libext2_blkid",
122     "libext2_com_err",
123     "libext2_quota",
124     "libext2_uuid",
125     "libext2_e2p",
126     "libext2fs",
127 ]
128
129 cc_binary {
130     name: "tune2fs",
131     host_supported: true,
132     vendor_ramdisk_available: true,
133     defaults: ["tune2fs-defaults"],
134
135     shared_libs: tune2fs_libs,
136     system_shared_libs: ["libc", "libdl"],
137 }
138
139 cc_binary {
140     name: "tune2fs_static",
141     static_executable: true,
142     defaults: ["tune2fs-defaults"],
143
144     static_libs: tune2fs_libs,
145 }
146
147 cc_binary {
148     name: "tune2fs_ramdisk",
149     stem: "tune2fs",
150     static_executable: true,
151     ramdisk: true,
152     defaults: ["tune2fs-defaults"],
153     system_shared_libs: [],
154     static_libs: tune2fs_libs,
155 }
156
157 cc_library_static {
158     name: "libtune2fs",
159     defaults: ["tune2fs-defaults"],
160
161     cflags: ["-DBUILD_AS_LIB"],
162     static_libs: tune2fs_libs,
163 }
164
165 //########################################################################
166 // Build badblocks
167
168 cc_binary {
169     name: "badblocks",
170     host_supported: true,
171     defaults: ["e2fsprogs-defaults"],
172
173     srcs: ["badblocks.c"],
174     shared_libs: [
175         "libext2fs",
176         "libext2_com_err",
177         "libext2_uuid",
178         "libext2_blkid",
179         "libext2_e2p",
180     ],
181     system_shared_libs: ["libc", "libdl"],
182 }
183
184 //########################################################################
185 // Build chattr
186
187 cc_binary {
188     name: "chattr-e2fsprogs",
189     host_supported: true,
190     defaults: ["e2fsprogs-defaults"],
191
192     srcs: ["chattr.c"],
193     shared_libs: [
194         "libext2_com_err",
195         "libext2_e2p",
196     ],
197     system_shared_libs: ["libc", "libdl"],
198 }
199
200 //########################################################################
201 // Build lsattr
202
203 cc_defaults {
204     name: "lsattr-defaults",
205     srcs: ["lsattr.c"],
206     defaults: ["e2fsprogs-defaults"],
207 }
208
209 lsattr_libs = [
210     "libext2_com_err",
211     "libext2_e2p",
212 ]
213
214 cc_binary {
215     name: "lsattr-e2fsprogs",
216     host_supported: true,
217     defaults: ["lsattr-defaults"],
218
219     shared_libs: lsattr_libs,
220     system_shared_libs: ["libc", "libdl"],
221 }
222
223 cc_binary {
224     name: "lsattr_static",
225     static_executable: true,
226     defaults: ["lsattr-defaults"],
227
228     static_libs: lsattr_libs,
229 }
230
231 //########################################################################
232 // Build blkid
233
234 cc_binary {
235     name: "blkid",
236     defaults: ["e2fsprogs-defaults"],
237
238     srcs: ["blkid.c"],
239     shared_libs: [
240         "libext2fs",
241         "libext2_blkid",
242         "libext2_com_err",
243         "libext2_e2p",
244     ],
245     system_shared_libs: ["libc", "libdl"],
246 }
247
248 //########################################################################
249 // Build e4crypt
250
251 cc_binary {
252     name: "e4crypt",
253     host_supported: true,
254     defaults: ["e2fsprogs-defaults"],
255
256     srcs: ["e4crypt.c"],
257     shared_libs: [
258         "libext2fs",
259         "libext2_uuid",
260     ],
261     system_shared_libs: ["libc", "libdl"],
262
263     target: {
264         darwin: {
265             enabled: false,
266         },
267     },
268 }
269
270 //##########################################################################
271 // Build e2image
272
273 cc_binary {
274     name: "e2image",
275     host_supported: true,
276     defaults: ["e2fsprogs-defaults"],
277
278     srcs: ["e2image.c"],
279     shared_libs: [
280         "libext2fs",
281         "libext2_blkid",
282         "libext2_com_err",
283         "libext2_quota",
284     ],
285     system_shared_libs: ["libc", "libdl"],
286 }
287
288 //##########################################################################
289 // Build filefrag
290
291 cc_binary {
292     name: "filefrag",
293     host_supported: true,
294     defaults: ["e2fsprogs-defaults"],
295
296     srcs: ["filefrag.c"],
297     shared_libs: [
298         "libext2fs",
299     ],
300     system_shared_libs: ["libc", "libdl"],
301 }
302
303 //##########################################################################
304 // Build e2freefrag
305
306 cc_binary {
307     name: "e2freefrag",
308     host_supported: true,
309     defaults: ["e2fsprogs-defaults"],
310
311     srcs: [
312         "e2freefrag.c",
313     ],
314     header_libs: ["libext2-headers"],
315     shared_libs: [
316         "libext2fs",
317         "libext2_com_err",
318     ],
319     system_shared_libs: ["libc", "libdl"],
320 }