xref: /aosp_15_r20/external/e2fsprogs/Android.bp (revision 6a54128f25917bfc36a8a6e9d722c04a0b4641b6)
1// Copyright 2017 The Android Open Source Project
2
3package {
4    default_applicable_licenses: ["external_e2fsprogs_license"],
5}
6
7// Added automatically by a large-scale-change that took the approach of
8// 'apply every license found to every target'. While this makes sure we respect
9// every license restriction, it may not be entirely correct.
10//
11// e.g. GPL in an MIT project might only apply to the contrib/ directory.
12//
13// Please consider splitting the single license below into multiple licenses,
14// taking care not to lose any license_kind information, and overriding the
15// default license using the 'licenses: [...]' property on targets as needed.
16//
17// For unused files, consider creating a 'fileGroup' with "//visibility:private"
18// to attach the license to, and including a comment whether the files may be
19// used in the current project.
20// See: http://go/android-license-faq
21license {
22    name: "external_e2fsprogs_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-0BSD",
26        "SPDX-license-identifier-Apache-2.0",
27        "SPDX-license-identifier-BSD",
28        "SPDX-license-identifier-GPL",
29        "SPDX-license-identifier-GPL-2.0",
30        "SPDX-license-identifier-LGPL",
31        "SPDX-license-identifier-LGPL-2.0",
32        "SPDX-license-identifier-LGPL-2.1",
33        "SPDX-license-identifier-LGPL-3.0",
34        "SPDX-license-identifier-MIT",
35        "legacy_notice",
36        "legacy_unencumbered",
37    ],
38    license_text: [
39        "NOTICE",
40    ],
41}
42
43cc_defaults {
44    name: "e2fsprogs-defaults",
45    cflags: [
46        "-Wall",
47        "-Werror",
48        // Some warnings that Android's build system enables by default are not
49        // supported by upstream e2fsprogs.  When such a warning shows up,
50        // disable it below.  Please don't disable warnings that upstream
51        // e2fsprogs is supposed to support; for those, fix the code instead.
52        "-Wno-pointer-arith",
53        "-Wno-sign-compare",
54        "-Wno-type-limits",
55        "-Wno-typedef-redefinition",
56        "-Wno-unused-parameter",
57    ],
58    target: {
59        bionic: {
60            system_shared_libs: [
61                "libc",
62                "libdl",
63            ],
64        },
65        darwin: {
66            // This matches what the upstream CI uses
67            cflags: ["-Wno-error=deprecated-declarations"],
68        },
69        windows: {
70            include_dirs: ["external/e2fsprogs/include/mingw"],
71        },
72    },
73}
74
75subdirs = [
76    "contrib",
77    "debugfs",
78    "e2fsck",
79    "lib",
80    "misc",
81    "resize",
82]
83