xref: /aosp_15_r20/prebuilts/build-tools/Android.bp (revision cda5da8d549138a6648c5ee6d7a49cf8f4a657be)
1package {
2    default_applicable_licenses: ["prebuilts_build-tools_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "prebuilts_build-tools_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-0BSD",
24        "SPDX-license-identifier-Apache-2.0",
25        "SPDX-license-identifier-BSD",
26        "SPDX-license-identifier-MIT",
27        "SPDX-license-identifier-PSF-2.0",
28        "SPDX-license-identifier-Zlib",
29        "legacy_unencumbered",
30    ],
31    license_text: [
32        "sysroots/aarch64-unknown-linux-musl/NOTICE.bionic",
33        "sysroots/aarch64-unknown-linux-musl/NOTICE.zlib",
34        "sysroots/arm-unknown-linux-musleabihf/NOTICE.bionic",
35        "sysroots/arm-unknown-linux-musleabihf/NOTICE.zlib",
36        "sysroots/i686-unknown-linux-musl/NOTICE.bionic",
37        "sysroots/i686-unknown-linux-musl/NOTICE.zlib",
38        "sysroots/x86_64-unknown-linux-musl/NOTICE.bionic",
39        "sysroots/x86_64-unknown-linux-musl/NOTICE.zlib",
40    ],
41}
42
43license {
44    name: "prebuilts_build-tools_bison_license",
45    package_name: "bison",
46    visibility: [":__subpackages__"],
47    license_kinds: ["SPDX-license-identifier-GPL-3.0"],
48    license_text: ["common/bison/NOTICE"],
49}
50
51license {
52    name: "prebuilts_build-tools_gnu_license",
53    package_name: "Official GNU software",
54    visibility: [":__subpackages__"],
55    license_kinds: ["SPDX-license-identifier-GPL-3.0"],
56    license_text: ["LICENSE-GPL-3.0"],
57}
58
59license {
60    name: "prebuilts_build-tools_flex_license",
61    package_name: "flex",
62    visibility: [":__subpackages__"],
63    license_kinds: ["SPDX-license-identifier-BSD"],
64    license_text: ["common/flex/NOTICE"],
65}
66
67cc_library_headers {
68    name: "FlexLexer",
69    host_supported: true,
70    vendor_available: true,
71    // TODO(b/153609531): remove when no longer needed.
72    native_bridge_supported: true,
73    licenses: ["prebuilts_build-tools_flex_license"],
74    export_include_dirs: ["common/flex"],
75}
76
77prebuilt_build_tool {
78    name: "bison",
79    deps: ["common/bison/**/*"],
80    licenses: ["prebuilts_build-tools_bison_license"],
81    export_to_make_var: "BISON",
82    enabled: false,
83    arch: {
84        x86_64: {
85            enabled: true,
86        },
87    },
88    target: {
89        darwin: {
90            src: "darwin-x86/bin/bison",
91            deps: ["darwin-x86/lib64/libc++.dylib"],
92        },
93        linux: {
94            src: "linux-x86/bin/bison",
95            deps: ["linux-x86/lib64/libc++.so"],
96        },
97    },
98}
99
100prebuilt_build_tool {
101    name: "flex",
102    export_to_make_var: "LEX",
103    enabled: false,
104    arch: {
105        x86_64: {
106            enabled: true,
107        },
108    },
109    licenses: ["prebuilts_build-tools_flex_license"],
110    target: {
111        darwin: {
112            src: "darwin-x86/bin/flex",
113        },
114        linux: {
115            src: "linux-x86/bin/flex",
116        },
117    },
118}
119
120prebuilt_build_tool {
121    name: "m4",
122    export_to_make_var: "M4",
123    enabled: false,
124    arch: {
125        x86_64: {
126            enabled: true,
127        },
128    },
129    licenses: ["prebuilts_build-tools_gnu_license"],
130    target: {
131        darwin: {
132            src: "darwin-x86/bin/m4",
133        },
134        linux: {
135            src: "linux-x86/bin/m4",
136        },
137    },
138}
139
140prebuilt_build_tool {
141    name: "make",
142    enabled: false,
143    arch: {
144        x86_64: {
145            enabled: true,
146        },
147    },
148    target: {
149        darwin: {
150            src: "darwin-x86/bin/make",
151        },
152        linux: {
153            src: "linux-x86/bin/make",
154        },
155    },
156    visibility: ["//vendor:__subpackages__"],
157}
158
159cc_prebuilt_binary {
160    name: "py3-launcher",
161    host_supported: true,
162    device_supported: false,
163    compile_multilib: "64",
164    stl: "none",
165    target: {
166        glibc_x86_64: {
167            srcs: ["linux-x86/bin/py3-launcher64"],
168        },
169        musl_arm64: {
170            srcs: ["linux_musl-arm64/bin/py3-launcher64"],
171        },
172        musl_x86_64: {
173            srcs: ["linux_musl-x86/bin/py3-launcher64"],
174        },
175        darwin_x86_64: {
176            srcs: ["darwin-x86/bin/py3-launcher64"],
177        },
178        darwin_arm64: {
179            // The darwin-x86 folder actually contains universal binaries that have both x86 and arm code
180            srcs: ["darwin-x86/bin/py3-launcher64"],
181        },
182    },
183
184    // Use the prebuilts for most branches
185    prefer: select(soong_config_variable("cpython3", "force_build_host"), {
186        true: false,
187        default: true,
188    }),
189}
190
191cc_prebuilt_binary {
192    name: "py3-launcher-static",
193    host_supported: true,
194    device_supported: false,
195    compile_multilib: "64",
196    stl: "none",
197    target: {
198        musl_arm64: {
199            srcs: ["linux_musl-arm64/bin/py3-launcher-static64"],
200        },
201        musl_x86_64: {
202            srcs: ["linux_musl-x86/bin/py3-launcher-static64"],
203        },
204    },
205
206    // Use the prebuilts for most branches
207    prefer: select(soong_config_variable("cpython3", "force_build_host"), {
208        true: false,
209        default: true,
210    }),
211}
212
213cc_prebuilt_binary {
214    name: "py3-launcher-autorun",
215    host_supported: true,
216    device_supported: false,
217    compile_multilib: "64",
218    stl: "none",
219    target: {
220        glibc_x86_64: {
221            srcs: ["linux-x86/bin/py3-launcher-autorun64"],
222        },
223        musl_arm64: {
224            srcs: ["linux_musl-arm64/bin/py3-launcher-autorun64"],
225        },
226        musl_x86_64: {
227            srcs: ["linux_musl-x86/bin/py3-launcher-autorun64"],
228        },
229        darwin_x86_64: {
230            srcs: ["darwin-x86/bin/py3-launcher-autorun64"],
231        },
232        darwin_arm64: {
233            // The darwin-x86 folder actually contains universal binaries that have both x86 and arm code
234            srcs: ["darwin-x86/bin/py3-launcher-autorun64"],
235        },
236    },
237
238    // Use the prebuilts for most branches
239    prefer: select(soong_config_variable("cpython3", "force_build_host"), {
240        true: false,
241        default: true,
242    }),
243}
244
245cc_prebuilt_binary {
246    name: "py3-launcher-autorun-static",
247    host_supported: true,
248    device_supported: false,
249    compile_multilib: "64",
250    stl: "none",
251    target: {
252        musl_arm64: {
253            srcs: ["linux_musl-arm64/bin/py3-launcher-autorun-static64"],
254        },
255        musl_x86_64: {
256            srcs: ["linux_musl-x86/bin/py3-launcher-autorun-static64"],
257        },
258    },
259
260    // Use the prebuilts for most branches
261    prefer: select(soong_config_variable("cpython3", "force_build_host"), {
262        true: false,
263        default: true,
264    }),
265}
266
267filegroup {
268    name: "py3-stdlib-prebuilt-srcs",
269    visibility: ["//visibility:private"],
270    srcs: ["common/py3-stdlib/**/*.py"],
271    path: "common/py3-stdlib",
272}
273
274python_library_host {
275    name: "py3-stdlib-prebuilt",
276    is_internal: true,
277    pkg_path: "python3.11",
278    srcs: [":py3-stdlib-prebuilt-srcs"],
279}
280
281dirgroup {
282    name: "trusty_dirgroup_prebuilts_build-tools",
283    dirs: ["."],
284    visibility: ["//trusty/vendor/google/aosp/scripts"],
285}
286