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