Whamcloud - gitweb
AOSP: Build filefrag
[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         "libext2_quota",
25         "libext2fs",
26     ],
27     system_shared_libs: ["libc", "libdl"],
28     export_include_dirs: ["."],
29 }
30
31 //########################################################################
32 // Build mke2fs
33
34 cc_binary {
35     name: "mke2fs",
36     host_supported: true,
37     recovery_available: true,
38     defaults: ["e2fsprogs-defaults"],
39
40     srcs: [
41         "mke2fs.c",
42         "util.c",
43         "mk_hugefiles.c",
44         "default_profile.c",
45     ],
46     cflags: [
47         "-Wno-error=format",
48         "-Wno-error=type-limits",
49         "-Wno-format-extra-args",
50     ],
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         },
66         not_windows: {
67             required: [
68                 "mke2fs.conf",
69             ],
70         },
71         windows: {
72             include_dirs: [ "external/e2fsprogs/include/mingw" ],
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             ],
81             ldflags: ["-static"],
82             host_ldlibs: ["-lws2_32"],
83             enabled: true
84         },
85         android: {
86             required: [
87                 "mke2fs.conf",
88             ],
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             ],
98             symlinks: ["mkfs.ext2", "mkfs.ext3", "mkfs.ext4"],
99         },
100     },
101     stl: "libc++_static",
102     include_dirs: ["external/e2fsprogs/e2fsck"],
103 }
104
105 //##########################################################################
106 // Build tune2fs
107
108 cc_defaults {
109     name: "tune2fs-defaults",
110     defaults: ["e2fsprogs-defaults"],
111     srcs: [
112         "tune2fs.c",
113         "util.c",
114     ],
115     cflags: ["-DNO_RECOVERY"],
116     include_dirs: ["external/e2fsprogs/e2fsck"],
117 }
118
119 tune2fs_libs = [
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,
133     system_shared_libs: ["libc", "libdl"],
134 }
135
136 cc_binary {
137     name: "tune2fs_static",
138     static_executable: true,
139     defaults: ["tune2fs-defaults"],
140
141     static_libs: tune2fs_libs,
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,
158     defaults: ["e2fsprogs-defaults"],
159
160     srcs: ["badblocks.c"],
161     shared_libs: [
162         "libext2fs",
163         "libext2_com_err",
164         "libext2_uuid",
165         "libext2_blkid",
166         "libext2_e2p",
167     ],
168     system_shared_libs: ["libc", "libdl"],
169 }
170
171 //########################################################################
172 // Build chattr
173
174 cc_binary {
175     name: "chattr",
176     host_supported: true,
177     defaults: ["e2fsprogs-defaults"],
178
179     srcs: ["chattr.c"],
180     shared_libs: [
181         "libext2_com_err",
182         "libext2_e2p",
183     ],
184     system_shared_libs: ["libc", "libdl"],
185 }
186
187 //########################################################################
188 // Build lsattr
189
190 cc_defaults {
191     name: "lsattr-defaults",
192     srcs: ["lsattr.c"],
193     defaults: ["e2fsprogs-defaults"],
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,
207     system_shared_libs: ["libc", "libdl"],
208 }
209
210 cc_binary {
211     name: "lsattr_static",
212     static_executable: true,
213     defaults: ["lsattr-defaults"],
214
215     static_libs: lsattr_libs,
216 }
217
218 //########################################################################
219 // Build blkid
220
221 cc_binary {
222     name: "blkid",
223     defaults: ["e2fsprogs-defaults"],
224
225     srcs: ["blkid.c"],
226     shared_libs: [
227         "libext2fs",
228         "libext2_blkid",
229         "libext2_com_err",
230         "libext2_e2p",
231     ],
232     system_shared_libs: ["libc", "libdl"],
233 }
234
235 //########################################################################
236 // Build e4crypt
237
238 cc_binary {
239     name: "e4crypt",
240     host_supported: true,
241     defaults: ["e2fsprogs-defaults"],
242
243     srcs: ["e4crypt.c"],
244     shared_libs: [
245         "libext2fs",
246         "libext2_uuid",
247     ],
248     system_shared_libs: ["libc", "libdl"],
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,
263     defaults: ["e2fsprogs-defaults"],
264
265     srcs: ["e2image.c"],
266     shared_libs: [
267         "libext2fs",
268         "libext2_blkid",
269         "libext2_com_err",
270         "libext2_quota",
271     ],
272     system_shared_libs: ["libc", "libdl"],
273 }
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 }