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