Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 1 | // Copyright 2019 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Bob Badour | 5f197c6 | 2021-03-08 11:42:11 -0800 | [diff] [blame] | 15 | // *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE |
| 16 | // CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE |
| 17 | // DEPENDING ON IT IN YOUR PROJECT. *** |
| 18 | package { |
| 19 | default_applicable_licenses: ["external_python_cpython3_license"], |
| 20 | } |
| 21 | |
| 22 | // Added automatically by a large-scale-change that took the approach of |
| 23 | // 'apply every license found to every target'. While this makes sure we respect |
| 24 | // every license restriction, it may not be entirely correct. |
| 25 | // |
| 26 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 27 | // |
| 28 | // Please consider splitting the single license below into multiple licenses, |
| 29 | // taking care not to lose any license_kind information, and overriding the |
| 30 | // default license using the 'licenses: [...]' property on targets as needed. |
| 31 | // |
| 32 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 33 | // to attach the license to, and including a comment whether the files may be |
| 34 | // used in the current project. |
| 35 | // See: http://go/android-license-faq |
| 36 | license { |
| 37 | name: "external_python_cpython3_license", |
| 38 | visibility: [":__subpackages__"], |
| 39 | license_kinds: [ |
| 40 | "SPDX-license-identifier-0BSD", |
| 41 | "SPDX-license-identifier-Apache-2.0", |
| 42 | "SPDX-license-identifier-BSD", |
| 43 | "SPDX-license-identifier-CC0-1.0", |
| 44 | "SPDX-license-identifier-GPL", |
| 45 | "SPDX-license-identifier-MIT", |
| 46 | "SPDX-license-identifier-MS-RL", // by exception only |
| 47 | "SPDX-license-identifier-PSF-2.0", |
| 48 | "SPDX-license-identifier-Unicode-DFS", |
| 49 | "SPDX-license-identifier-W3C", |
| 50 | "SPDX-license-identifier-Zlib", |
| 51 | "legacy_by_exception_only", // by exception only |
| 52 | "legacy_notice", |
| 53 | "legacy_unencumbered", |
| 54 | ], |
| 55 | license_text: [ |
| 56 | "LICENSE", |
| 57 | ], |
| 58 | } |
| 59 | |
Tom Cherry | ff869db | 2020-01-08 14:13:00 -0800 | [diff] [blame] | 60 | build = [ |
| 61 | "Android-bionic.bp", |
| 62 | "Android-linux_x86_64.bp", |
| 63 | "Android-darwin_x86_64.bp", |
| 64 | ] |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 65 | |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 66 | soong_config_module_type { |
| 67 | name: "cpython3_cc_defaults", |
| 68 | module_type: "cc_defaults", |
| 69 | config_namespace: "cpython3", |
| 70 | bool_variables: ["force_build_host"], |
| 71 | properties: ["defaults"], |
| 72 | } |
| 73 | |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 74 | // By default, disable the source and use the prebuilts for host linux |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 75 | // and darwin. Overridden by cpython3-interp-force_build_host when |
| 76 | // force_build_host is true (set on aosp-build-tools). |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 77 | cc_defaults { |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 78 | name: "cpython3-interp-host-prebuilts", |
| 79 | defaults_visibility: ["//visibility:private"], |
| 80 | target: { |
| 81 | linux_glibc: { |
| 82 | enabled: false, |
| 83 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 84 | linux_musl: { |
| 85 | enabled: false, |
| 86 | }, |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 87 | darwin: { |
| 88 | enabled: false, |
| 89 | }, |
| 90 | }, |
| 91 | } |
| 92 | |
| 93 | cc_defaults { |
| 94 | name: "cpython3-interp-force_build_host", |
| 95 | defaults_visibility: ["//visibility:private"], |
| 96 | target: { |
| 97 | linux_glibc: { |
| 98 | enabled: true, |
| 99 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 100 | linux_musl: { |
| 101 | enabled: true, |
| 102 | }, |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 103 | darwin: { |
| 104 | enabled: true, |
| 105 | }, |
| 106 | }, |
| 107 | } |
| 108 | |
| 109 | cpython3_cc_defaults { |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 110 | name: "py3-interp-defaults", |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 111 | defaults_visibility: ["//visibility:private"], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 112 | cflags: [ |
| 113 | "-fwrapv", |
| 114 | "-O3", |
| 115 | "-Wall", |
| 116 | "-Wstrict-prototypes", |
| 117 | "-DPy_BUILD_CORE", |
| 118 | "-Werror", |
| 119 | "-Wno-invalid-source-encoding", |
| 120 | "-Wno-int-conversion", |
| 121 | "-Wno-missing-field-initializers", |
| 122 | "-Wno-null-pointer-arithmetic", |
| 123 | "-Wno-register", |
| 124 | "-Wno-shift-count-overflow", |
| 125 | "-Wno-sign-compare", |
| 126 | "-Wno-tautological-compare", |
| 127 | "-Wno-tautological-constant-out-of-range-compare", |
| 128 | "-Wno-unused-function", |
| 129 | "-Wno-unused-parameter", |
| 130 | "-Wno-unused-result", |
| 131 | ], |
| 132 | local_include_dirs: [ |
| 133 | "Include", |
| 134 | "Include/internal", |
| 135 | ], |
| 136 | static_libs: ["libffi"], |
| 137 | target: { |
| 138 | android: { |
| 139 | local_include_dirs: ["android/bionic/pyconfig"], |
| 140 | }, |
| 141 | android_arm: { |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 142 | cflags: ["-DSOABI=\"cpython-39android-arm-android-bionic\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 143 | }, |
| 144 | android_arm64: { |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 145 | cflags: ["-DSOABI=\"cpython-39android-arm64-android-bionic\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 146 | }, |
| 147 | android_x86: { |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 148 | cflags: ["-DSOABI=\"cpython-39android-x86-android-bionic\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 149 | }, |
| 150 | android_x86_64: { |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 151 | cflags: ["-DSOABI=\"cpython-39android-x86_64-android-bionic\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 152 | }, |
Dan Willemsen | 6e34514 | 2020-12-16 19:03:07 -0800 | [diff] [blame] | 153 | host: { |
| 154 | // Host builds are moving to prebuilts, which has a higher risk of |
| 155 | // having an incompatible libc++.so when installed. |
| 156 | stl: "libc++_static", |
| 157 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 158 | // Regenerate include dirs with android_regen.sh |
| 159 | darwin_x86_64: { |
| 160 | local_include_dirs: ["android/darwin_x86_64/pyconfig"], |
| 161 | cflags: [ |
| 162 | "-Wno-deprecated-declarations", |
| 163 | "-Wno-pointer-arith", |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 164 | "-DSOABI=\"cpython-39android-x86_64-darwin\"", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 165 | ], |
| 166 | }, |
| 167 | linux_bionic: { |
| 168 | // NB linux_bionic is a 'host' architecture but it uses the bionic libc like 'android' |
| 169 | // targets so use the android pyconfig. |
| 170 | local_include_dirs: ["android/bionic/pyconfig"], |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 171 | cflags: ["-DSOABI=\"cpython-39android-x86_64-linux-bionic\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 172 | }, |
| 173 | linux_glibc_x86: { |
| 174 | enabled: false, |
| 175 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 176 | linux_musl_x86: { |
| 177 | enabled: false, |
| 178 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 179 | linux_glibc_x86_64: { |
| 180 | local_include_dirs: ["android/linux_x86_64/pyconfig"], |
Haibo Huang | 717117f | 2021-01-25 15:24:19 -0800 | [diff] [blame] | 181 | cflags: ["-DSOABI=\"cpython-39android-x86_64-linux-gnu\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 182 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 183 | linux_musl_x86_64: { |
| 184 | local_include_dirs: ["android/linux_x86_64/pyconfig"], |
| 185 | cflags: ["-DSOABI=\"cpython-39android-x86_64-linux-gnu\""], |
| 186 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 187 | windows: { |
| 188 | enabled: false, |
| 189 | }, |
| 190 | }, |
| 191 | host_supported: true, |
| 192 | compile_multilib: "both", |
| 193 | multilib: { |
| 194 | lib32: { |
| 195 | suffix: "32", |
| 196 | }, |
| 197 | lib64: { |
| 198 | suffix: "64", |
| 199 | }, |
| 200 | }, |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 201 | soong_config_variables: { |
| 202 | force_build_host: { |
| 203 | defaults: ["cpython3-interp-force_build_host"], |
| 204 | }, |
| 205 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | cc_library_static { |
| 209 | name: "py3-interp", |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 210 | defaults: ["py3-interp-defaults", "cpython3-interp-host-prebuilts"], |
Haibo Huang | 5bb95e9 | 2021-01-14 11:35:14 -0800 | [diff] [blame] | 211 | cflags: ["-DPy_BUILD_CORE", "-DPLATLIBDIR=\"lib\""], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 212 | srcs: [ |
Haibo Huang | 5bb95e9 | 2021-01-14 11:35:14 -0800 | [diff] [blame] | 213 | // Makefile.pre.in PEGEN_OBJS |
| 214 | "Parser/pegen/pegen.c", |
| 215 | "Parser/pegen/parse.c", |
| 216 | "Parser/pegen/parse_string.c", |
| 217 | "Parser/pegen/peg_api.c", |
| 218 | |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 219 | // Makefile.pre.in PARSER_OBJS |
| 220 | "Parser/acceler.c", |
| 221 | "Parser/grammar1.c", |
| 222 | "Parser/listnode.c", |
| 223 | "Parser/myreadline.c", |
| 224 | "Parser/node.c", |
| 225 | "Parser/parser.c", |
| 226 | "Parser/parsetok.c", |
| 227 | "Parser/token.c", |
| 228 | "Parser/tokenizer.c", |
| 229 | |
| 230 | // Makefile.pre.in OBJECT_OBJS |
| 231 | "Objects/abstract.c", |
| 232 | "Objects/accu.c", |
| 233 | "Objects/boolobject.c", |
| 234 | "Objects/bytes_methods.c", |
| 235 | "Objects/bytearrayobject.c", |
| 236 | "Objects/bytesobject.c", |
| 237 | "Objects/call.c", |
| 238 | "Objects/capsule.c", |
| 239 | "Objects/cellobject.c", |
| 240 | "Objects/classobject.c", |
| 241 | "Objects/codeobject.c", |
| 242 | "Objects/complexobject.c", |
| 243 | "Objects/descrobject.c", |
| 244 | "Objects/enumobject.c", |
| 245 | "Objects/exceptions.c", |
Haibo Huang | 5bb95e9 | 2021-01-14 11:35:14 -0800 | [diff] [blame] | 246 | "Objects/genericaliasobject.c", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 247 | "Objects/genobject.c", |
| 248 | "Objects/fileobject.c", |
| 249 | "Objects/floatobject.c", |
| 250 | "Objects/frameobject.c", |
| 251 | "Objects/funcobject.c", |
| 252 | "Objects/interpreteridobject.c", |
| 253 | "Objects/iterobject.c", |
| 254 | "Objects/listobject.c", |
| 255 | "Objects/longobject.c", |
| 256 | "Objects/dictobject.c", |
| 257 | "Objects/odictobject.c", |
| 258 | "Objects/memoryobject.c", |
| 259 | "Objects/methodobject.c", |
| 260 | "Objects/moduleobject.c", |
| 261 | "Objects/namespaceobject.c", |
| 262 | "Objects/object.c", |
| 263 | "Objects/obmalloc.c", |
| 264 | "Objects/picklebufobject.c", |
| 265 | "Objects/rangeobject.c", |
| 266 | "Objects/setobject.c", |
| 267 | "Objects/sliceobject.c", |
| 268 | "Objects/structseq.c", |
| 269 | "Objects/tupleobject.c", |
| 270 | "Objects/typeobject.c", |
| 271 | "Objects/unicodeobject.c", |
| 272 | "Objects/unicodectype.c", |
| 273 | "Objects/weakrefobject.c", |
| 274 | |
| 275 | // Makefile.pre.in PYTHON_OBJS |
| 276 | "Python/_warnings.c", |
| 277 | "Python/Python-ast.c", |
| 278 | "Python/asdl.c", |
| 279 | "Python/ast.c", |
| 280 | "Python/ast_opt.c", |
| 281 | "Python/ast_unparse.c", |
| 282 | "Python/bltinmodule.c", |
| 283 | "Python/ceval.c", |
| 284 | "Python/codecs.c", |
| 285 | "Python/compile.c", |
| 286 | "Python/context.c", |
| 287 | "Python/dynamic_annotations.c", |
| 288 | "Python/errors.c", |
| 289 | "Python/frozen.c", |
| 290 | "Python/frozenmain.c", |
| 291 | "Python/future.c", |
| 292 | "Python/getargs.c", |
| 293 | "Python/getcompiler.c", |
| 294 | "Python/getcopyright.c", |
| 295 | "Python/getplatform.c", |
| 296 | "Python/getversion.c", |
| 297 | "Python/graminit.c", |
| 298 | "Python/hamt.c", |
Haibo Huang | 5bb95e9 | 2021-01-14 11:35:14 -0800 | [diff] [blame] | 299 | "Python/hashtable.c", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 300 | "Python/import.c", |
| 301 | "Python/importdl.c", |
| 302 | "Python/initconfig.c", |
| 303 | "Python/marshal.c", |
| 304 | "Python/modsupport.c", |
| 305 | "Python/mysnprintf.c", |
| 306 | "Python/mystrtoul.c", |
| 307 | "Python/pathconfig.c", |
| 308 | "Python/peephole.c", |
| 309 | "Python/preconfig.c", |
| 310 | "Python/pyarena.c", |
| 311 | "Python/pyctype.c", |
| 312 | "Python/pyfpe.c", |
| 313 | "Python/pyhash.c", |
| 314 | "Python/pylifecycle.c", |
| 315 | "Python/pymath.c", |
| 316 | "Python/pystate.c", |
| 317 | "Python/pythonrun.c", |
| 318 | "Python/pytime.c", |
| 319 | "Python/bootstrap_hash.c", |
| 320 | "Python/structmember.c", |
| 321 | "Python/symtable.c", |
| 322 | "Python/sysmodule.c", |
| 323 | "Python/thread.c", |
| 324 | "Python/traceback.c", |
| 325 | "Python/getopt.c", |
| 326 | "Python/pystrcmp.c", |
| 327 | "Python/pystrtod.c", |
| 328 | "Python/pystrhex.c", |
| 329 | "Python/dtoa.c", |
| 330 | "Python/formatter_unicode.c", |
| 331 | "Python/fileutils.c", |
| 332 | "Python/dynload_shlib.c", |
| 333 | ], |
| 334 | |
| 335 | target: { |
| 336 | linux: { |
| 337 | cflags: [ |
Luca Stefani | 9d70c2b | 2020-08-24 14:25:20 +0200 | [diff] [blame] | 338 | "-DPLATFORM=\"linux\"", |
Luca Stefani | b9c5ed9 | 2020-08-24 15:05:00 +0200 | [diff] [blame] | 339 | "-DABIFLAGS=\"\"", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 340 | ], |
| 341 | }, |
| 342 | darwin_x86_64: { |
| 343 | cflags: [ |
| 344 | "-DPLATFORM=\"darwin\"", |
Luca Stefani | b9c5ed9 | 2020-08-24 15:05:00 +0200 | [diff] [blame] | 345 | "-DABIFLAGS=\"\"", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 346 | ], |
| 347 | }, |
| 348 | }, |
| 349 | } |
| 350 | |
| 351 | cc_defaults { |
| 352 | name: "py3-launcher-defaults", |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 353 | defaults: ["py3-interp-defaults", "cpython3-interp-host-prebuilts"], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 354 | cflags: [ |
Spandan Das | b9068f6 | 2021-08-18 16:46:57 +0000 | [diff] [blame] | 355 | "-DVERSION=\"3.9\"", |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 356 | "-DVPATH=\"\"", |
| 357 | "-DPREFIX=\"\"", |
| 358 | "-DEXEC_PREFIX=\"\"", |
| 359 | "-DPYTHONPATH=\"..:\"", |
| 360 | "-DANDROID_SKIP_ZIP_PATH", |
| 361 | "-DANDROID_SKIP_EXEC_PREFIX_PATH", |
| 362 | "-DANDROID_LIB_PYTHON_PATH=\"internal/stdlib\"", |
| 363 | "-DDATE=\"Dec 31 1969\"", |
| 364 | "-DTIME=\"23:59:59\"", |
| 365 | ], |
| 366 | static_libs: [ |
| 367 | "libbase", |
| 368 | "libexpat", |
| 369 | "libz", |
| 370 | ], |
| 371 | target: { |
| 372 | linux_glibc_x86_64: { |
| 373 | host_ldlibs: ["-lutil"], |
| 374 | }, |
Jack He | 5e983f0 | 2019-11-07 17:21:40 -0800 | [diff] [blame] | 375 | linux: { |
| 376 | // Due to test infra limitations, Python native symbols are linked |
| 377 | // statically to py3-launcher(s). Hence, need this flag to export |
| 378 | // these symbols so that runtime imported native extensions can use |
| 379 | // them (e.g. PyBaseObject_Type) |
| 380 | ldflags: ["-Wl,--export-dynamic"], |
| 381 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 382 | darwin: { |
| 383 | host_ldlibs: [ |
| 384 | "-framework SystemConfiguration", |
| 385 | "-framework CoreFoundation", |
| 386 | ], |
| 387 | }, |
| 388 | host: { |
Tom Cherry | ff869db | 2020-01-08 14:13:00 -0800 | [diff] [blame] | 389 | static_libs: [ |
| 390 | "libsqlite", |
| 391 | "liblog", |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 392 | "libopenssl_ssl", |
| 393 | "libopenssl_crypto", |
| 394 | ], |
| 395 | }, |
| 396 | linux_bionic: { |
| 397 | // Linux Bionic doesn't have openssl prebuilts |
| 398 | exclude_static_libs: [ |
| 399 | "libopenssl_ssl", |
| 400 | "libopenssl_crypto", |
Tom Cherry | ff869db | 2020-01-08 14:13:00 -0800 | [diff] [blame] | 401 | ], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 402 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 403 | android: { |
Jack He | 5e983f0 | 2019-11-07 17:21:40 -0800 | [diff] [blame] | 404 | shared_libs: [ |
| 405 | // Use shared libsqlite for device side, otherwise |
| 406 | // the executable size will be really huge. |
| 407 | "libsqlite", |
| 408 | // Dependency from libbase |
| 409 | "liblog", |
| 410 | ], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 411 | }, |
| 412 | }, |
| 413 | } |
| 414 | |
| 415 | cc_library_static { |
| 416 | name: "py3-launcher-lib", |
| 417 | defaults: ["py3-launcher-defaults"], |
| 418 | cflags: ["-DPy_BUILD_CORE"], |
| 419 | srcs: [ |
| 420 | // Makefile.pre.in MODULE_OBJS |
| 421 | "Modules/getpath.c", |
| 422 | "Modules/main.c", |
| 423 | "Modules/gcmodule.c", |
| 424 | |
| 425 | // Makefile.pre.in LIBRARY_OBJS_OMIT_FROZEN |
| 426 | "Modules/getbuildinfo.c", |
| 427 | ], |
| 428 | whole_static_libs: [ |
| 429 | "py3-interp", |
| 430 | "py3-c-modules", |
| 431 | ], |
| 432 | target: { |
| 433 | android: { |
| 434 | srcs: ["android/bionic/config.c"], |
| 435 | }, |
| 436 | linux_bionic: { |
| 437 | srcs: ["android/bionic/config.c"], |
| 438 | }, |
| 439 | linux_glibc_x86_64: { |
| 440 | srcs: ["android/linux_x86_64/config.c"], |
| 441 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 442 | linux_musl_x86_64: { |
| 443 | srcs: ["android/linux_x86_64/config.c"], |
| 444 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 445 | darwin: { |
| 446 | srcs: ["android/darwin_x86_64/config.c"], |
| 447 | }, |
Tom Cherry | ff869db | 2020-01-08 14:13:00 -0800 | [diff] [blame] | 448 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | cc_binary { |
| 452 | name: "py3-launcher", |
| 453 | defaults: ["py3-launcher-defaults"], |
| 454 | srcs: ["android/launcher_main.cpp"], |
| 455 | static_libs: ["py3-launcher-lib"], |
| 456 | } |
| 457 | |
| 458 | cc_binary { |
| 459 | name: "py3-launcher-autorun", |
| 460 | defaults: ["py3-launcher-defaults"], |
| 461 | srcs: ["android/launcher_main.cpp"], |
| 462 | static_libs: ["py3-launcher-lib"], |
| 463 | cflags: ["-DANDROID_AUTORUN"], |
| 464 | } |
| 465 | |
Colin Cross | e134976 | 2022-03-08 13:20:46 -0800 | [diff] [blame] | 466 | cc_binary_host { |
| 467 | name: "py3-launcher-static", |
| 468 | defaults: ["py3-launcher-defaults"], |
| 469 | srcs: ["android/launcher_main.cpp"], |
| 470 | static_libs: ["py3-launcher-lib"], |
| 471 | static_executable: true, |
| 472 | target: { |
| 473 | glibc: { |
| 474 | enabled: false, |
| 475 | }, |
| 476 | }, |
| 477 | } |
| 478 | |
| 479 | cc_binary_host { |
| 480 | name: "py3-launcher-autorun-static", |
| 481 | defaults: ["py3-launcher-defaults"], |
| 482 | srcs: ["android/launcher_main.cpp"], |
| 483 | static_libs: ["py3-launcher-lib"], |
| 484 | static_executable: true, |
| 485 | cflags: ["-DANDROID_AUTORUN"], |
| 486 | target: { |
| 487 | glibc: { |
| 488 | enabled: false, |
| 489 | }, |
| 490 | }, |
| 491 | } |
| 492 | |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 493 | python_binary_host { |
| 494 | name: "py3-cmd", |
| 495 | autorun: false, |
| 496 | version: { |
| 497 | py3: { |
| 498 | embedded_launcher: true, |
| 499 | }, |
| 500 | }, |
| 501 | } |
| 502 | |
| 503 | // Enabled extension py3-c-modules. |
| 504 | |
| 505 | cc_library_static { |
| 506 | name: "py3-c-modules", |
Dan Willemsen | b33c690 | 2020-12-23 16:39:22 -0800 | [diff] [blame] | 507 | defaults: ["py3-interp-defaults", "cpython3-interp-host-prebuilts"], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 508 | cflags: [ |
| 509 | "-DPy_BUILD_CORE_BUILTIN", |
| 510 | "-DUSE_PYEXPAT_CAPI", |
| 511 | ], |
| 512 | static_libs: [ |
| 513 | "libexpat", |
| 514 | "libz", |
| 515 | ], |
| 516 | target: { |
| 517 | android: { |
| 518 | srcs: [":py3-c-modules-bionic"], |
| 519 | }, |
| 520 | linux_bionic: { |
| 521 | srcs: [":py3-c-modules-bionic"], |
| 522 | }, |
| 523 | linux_glibc_x86_64: { |
| 524 | srcs: [":py3-c-modules-linux_x86_64"], |
Dan Willemsen | e6b5c0a | 2020-12-11 14:16:07 -0800 | [diff] [blame] | 525 | static_libs: [ |
| 526 | "libopenssl_ssl", |
| 527 | "libopenssl_crypto", |
| 528 | ], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 529 | }, |
Colin Cross | 7020415 | 2022-03-08 15:12:48 -0800 | [diff] [blame] | 530 | linux_musl_x86_64: { |
| 531 | srcs: [":py3-c-modules-linux_x86_64"], |
| 532 | static_libs: [ |
| 533 | "libopenssl_ssl", |
| 534 | "libopenssl_crypto", |
| 535 | ], |
| 536 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 537 | darwin: { |
| 538 | srcs: [":py3-c-modules-darwin_x86_64"], |
Dan Willemsen | e6b5c0a | 2020-12-11 14:16:07 -0800 | [diff] [blame] | 539 | static_libs: [ |
| 540 | "libopenssl_ssl", |
| 541 | "libopenssl_crypto", |
| 542 | ], |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 543 | }, |
Tom Cherry | ff869db | 2020-01-08 14:13:00 -0800 | [diff] [blame] | 544 | }, |
Dan Willemsen | b3614d2 | 2019-10-07 16:06:34 -0700 | [diff] [blame] | 545 | } |