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