xref: /aosp_15_r20/external/gptfdisk/Android.bp (revision 57696d54d05c64fd1b1787f8371dbcf104911cfb)
1*57696d54SAkhilesh Sanikoppackage {
2*57696d54SAkhilesh Sanikop    default_applicable_licenses: ["external_gptfdisk_license"],
3*57696d54SAkhilesh Sanikop}
4*57696d54SAkhilesh Sanikop
5*57696d54SAkhilesh Sanikop// Added automatically by a large-scale-change that took the approach of
6*57696d54SAkhilesh Sanikop// 'apply every license found to every target'. While this makes sure we respect
7*57696d54SAkhilesh Sanikop// every license restriction, it may not be entirely correct.
8*57696d54SAkhilesh Sanikop//
9*57696d54SAkhilesh Sanikop// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10*57696d54SAkhilesh Sanikop//
11*57696d54SAkhilesh Sanikop// Please consider splitting the single license below into multiple licenses,
12*57696d54SAkhilesh Sanikop// taking care not to lose any license_kind information, and overriding the
13*57696d54SAkhilesh Sanikop// default license using the 'licenses: [...]' property on targets as needed.
14*57696d54SAkhilesh Sanikop//
15*57696d54SAkhilesh Sanikop// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16*57696d54SAkhilesh Sanikop// to attach the license to, and including a comment whether the files may be
17*57696d54SAkhilesh Sanikop// used in the current project.
18*57696d54SAkhilesh Sanikop// See: http://go/android-license-faq
19*57696d54SAkhilesh Sanikoplicense {
20*57696d54SAkhilesh Sanikop    name: "external_gptfdisk_license",
21*57696d54SAkhilesh Sanikop    visibility: [":__subpackages__"],
22*57696d54SAkhilesh Sanikop    license_kinds: [
23*57696d54SAkhilesh Sanikop        "SPDX-license-identifier-GPL",
24*57696d54SAkhilesh Sanikop        "SPDX-license-identifier-GPL-2.0",
25*57696d54SAkhilesh Sanikop        "SPDX-license-identifier-LGPL",
26*57696d54SAkhilesh Sanikop    ],
27*57696d54SAkhilesh Sanikop    license_text: [
28*57696d54SAkhilesh Sanikop        "COPYING",
29*57696d54SAkhilesh Sanikop    ],
30*57696d54SAkhilesh Sanikop}
31*57696d54SAkhilesh Sanikop
32*57696d54SAkhilesh Sanikopcc_defaults {
33*57696d54SAkhilesh Sanikop    name: "gptfdisk_default_flags",
34*57696d54SAkhilesh Sanikop    cflags: [
35*57696d54SAkhilesh Sanikop        "-Wno-unused-parameter",
36*57696d54SAkhilesh Sanikop        "-Wno-macro-redefined",
37*57696d54SAkhilesh Sanikop        "-Wno-pragma-pack",
38*57696d54SAkhilesh Sanikop        "-Werror",
39*57696d54SAkhilesh Sanikop        "-fPIC",
40*57696d54SAkhilesh Sanikop        "-D_FILE_OFFSET_BITS=64",
41*57696d54SAkhilesh Sanikop    ],
42*57696d54SAkhilesh Sanikop    // This project requires _FILE_OFFSET_BITS=64, which isn't globally
43*57696d54SAkhilesh Sanikop    // true for 32-bit Android builds. It's safe here because the libraries
44*57696d54SAkhilesh Sanikop    // built by this build file aren't exported. If that changes, you'll
45*57696d54SAkhilesh Sanikop    // need to come up with a plan (probably either upstreaming better 32-bit
46*57696d54SAkhilesh Sanikop    // support, or waiting until we no longer support 32-bit either).
47*57696d54SAkhilesh Sanikop    visibility: [":__subpackages__"],
48*57696d54SAkhilesh Sanikop}
49*57696d54SAkhilesh Sanikop
50*57696d54SAkhilesh Sanikopcc_binary {
51*57696d54SAkhilesh Sanikop    name: "sgdisk",
52*57696d54SAkhilesh Sanikop    defaults: ["gptfdisk_default_flags"],
53*57696d54SAkhilesh Sanikop    host_supported: true,
54*57696d54SAkhilesh Sanikop
55*57696d54SAkhilesh Sanikop    srcs: [
56*57696d54SAkhilesh Sanikop        "sgdisk.cc",
57*57696d54SAkhilesh Sanikop    ],
58*57696d54SAkhilesh Sanikop
59*57696d54SAkhilesh Sanikop    shared_libs: ["libext2_uuid"],
60*57696d54SAkhilesh Sanikop    static_libs: ["libgptf"],
61*57696d54SAkhilesh Sanikop    visibility: ["//visibility:any_system_partition"],
62*57696d54SAkhilesh Sanikop}
63*57696d54SAkhilesh Sanikop
64*57696d54SAkhilesh Sanikoplib_common_srcs = [
65*57696d54SAkhilesh Sanikop    "gptcl.cc",
66*57696d54SAkhilesh Sanikop    "crc32.cc",
67*57696d54SAkhilesh Sanikop    "support.cc",
68*57696d54SAkhilesh Sanikop    "guid.cc",
69*57696d54SAkhilesh Sanikop    "gptpart.cc",
70*57696d54SAkhilesh Sanikop    "mbrpart.cc",
71*57696d54SAkhilesh Sanikop    "basicmbr.cc",
72*57696d54SAkhilesh Sanikop    "mbr.cc",
73*57696d54SAkhilesh Sanikop    "gpt.cc",
74*57696d54SAkhilesh Sanikop    "bsd.cc",
75*57696d54SAkhilesh Sanikop    "parttypes.cc",
76*57696d54SAkhilesh Sanikop    "attributes.cc",
77*57696d54SAkhilesh Sanikop    "diskio.cc",
78*57696d54SAkhilesh Sanikop    "android_popt.cc",
79*57696d54SAkhilesh Sanikop]
80*57696d54SAkhilesh Sanikop
81*57696d54SAkhilesh Sanikopcc_library_static {
82*57696d54SAkhilesh Sanikop    name: "libgptf",
83*57696d54SAkhilesh Sanikop    defaults: ["gptfdisk_default_flags"],
84*57696d54SAkhilesh Sanikop    host_supported: true,
85*57696d54SAkhilesh Sanikop
86*57696d54SAkhilesh Sanikop    export_include_dirs: ["."],
87*57696d54SAkhilesh Sanikop    srcs: lib_common_srcs + ["diskio-unix.cc"],
88*57696d54SAkhilesh Sanikop
89*57696d54SAkhilesh Sanikop    shared_libs: ["libext2_uuid"],
90*57696d54SAkhilesh Sanikop}
91*57696d54SAkhilesh Sanikop
92*57696d54SAkhilesh Sanikopcc_library_static {
93*57696d54SAkhilesh Sanikop    name: "libgptf_fuzzer_lib",
94*57696d54SAkhilesh Sanikop    defaults: ["gptfdisk_default_flags"],
95*57696d54SAkhilesh Sanikop    host_supported: true,
96*57696d54SAkhilesh Sanikop
97*57696d54SAkhilesh Sanikop    export_include_dirs: ["."],
98*57696d54SAkhilesh Sanikop    srcs: lib_common_srcs + ["diskio-heap.cc"],
99*57696d54SAkhilesh Sanikop    cflags: ["-DENABLE_HEAP_DISKIO"],
100*57696d54SAkhilesh Sanikop
101*57696d54SAkhilesh Sanikop    shared_libs: ["libext2_uuid"],
102*57696d54SAkhilesh Sanikop}
103