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, 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 35cc_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 109cc_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 120tune2fs_libs = [ 121 "libext2_blkid", 122 "libext2_com_err", 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, 135 system_shared_libs: ["libc", "libdl"], 136} 137 138cc_binary { 139 name: "tune2fs_static", 140 static_executable: true, 141 defaults: ["tune2fs-defaults"], 142 143 static_libs: tune2fs_libs, 144} 145 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 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, 170 defaults: ["e2fsprogs-defaults"], 171 172 srcs: ["badblocks.c"], 173 shared_libs: [ 174 "libext2fs", 175 "libext2_com_err", 176 "libext2_uuid", 177 "libext2_blkid", 178 "libext2_e2p", 179 ], 180 system_shared_libs: ["libc", "libdl"], 181} 182 183//######################################################################## 184// Build chattr 185 186cc_binary { 187 name: "chattr-e2fsprogs", 188 host_supported: true, 189 defaults: ["e2fsprogs-defaults"], 190 191 srcs: ["chattr.c"], 192 shared_libs: [ 193 "libext2_com_err", 194 "libext2_e2p", 195 ], 196 system_shared_libs: ["libc", "libdl"], 197} 198 199//######################################################################## 200// Build lsattr 201 202cc_defaults { 203 name: "lsattr-defaults", 204 srcs: ["lsattr.c"], 205 defaults: ["e2fsprogs-defaults"], 206} 207 208lsattr_libs = [ 209 "libext2_com_err", 210 "libext2_e2p", 211] 212 213cc_binary { 214 name: "lsattr-e2fsprogs", 215 host_supported: true, 216 defaults: ["lsattr-defaults"], 217 218 shared_libs: lsattr_libs, 219 system_shared_libs: ["libc", "libdl"], 220} 221 222cc_binary { 223 name: "lsattr_static", 224 static_executable: true, 225 defaults: ["lsattr-defaults"], 226 227 static_libs: lsattr_libs, 228} 229 230//######################################################################## 231// Build blkid 232 233cc_binary { 234 name: "blkid", 235 defaults: ["e2fsprogs-defaults"], 236 237 srcs: ["blkid.c"], 238 shared_libs: [ 239 "libext2fs", 240 "libext2_blkid", 241 "libext2_com_err", 242 "libext2_e2p", 243 ], 244 system_shared_libs: ["libc", "libdl"], 245} 246 247//######################################################################## 248// Build e4crypt 249 250cc_binary { 251 name: "e4crypt", 252 host_supported: true, 253 defaults: ["e2fsprogs-defaults"], 254 255 srcs: ["e4crypt.c"], 256 shared_libs: [ 257 "libext2fs", 258 "libext2_uuid", 259 ], 260 system_shared_libs: ["libc", "libdl"], 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, 275 defaults: ["e2fsprogs-defaults"], 276 277 srcs: ["e2image.c"], 278 shared_libs: [ 279 "libext2fs", 280 "libext2_blkid", 281 "libext2_com_err", 282 "libext2_quota", 283 ], 284 system_shared_libs: ["libc", "libdl"], 285} 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} 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} 320