Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 1 | // Copyright 2017 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 | 84389f6 | 2021-03-08 11:43:30 -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_cpython2_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_cpython2_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-GPL-2.0", |
| 46 | "SPDX-license-identifier-GPL-3.0", |
| 47 | "SPDX-license-identifier-LGPL-2.1", |
| 48 | "SPDX-license-identifier-MIT", |
| 49 | "SPDX-license-identifier-MPL", |
| 50 | "SPDX-license-identifier-PSF-2.0", |
| 51 | "SPDX-license-identifier-Zlib", |
| 52 | "legacy_by_exception_only", // by exception only |
| 53 | "legacy_notice", |
| 54 | "legacy_unencumbered", |
| 55 | ], |
| 56 | license_text: [ |
| 57 | "LICENSE", |
| 58 | ], |
| 59 | } |
| 60 | |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 61 | subdirs = [ |
| 62 | "Lib", |
| 63 | ] |
| 64 | |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 65 | cc_defaults { |
| 66 | name: "py2-interp-defaults", |
| 67 | cflags: [ |
| 68 | "-fwrapv", |
| 69 | "-O3", |
| 70 | "-Wall", |
| 71 | "-Wstrict-prototypes", |
| 72 | "-DPy_BUILD_CORE", |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 73 | "-Werror", |
Dan Willemsen | 04e3910 | 2019-02-14 21:00:06 -0800 | [diff] [blame] | 74 | "-Wno-invalid-source-encoding", |
Tri Vo | 0b5cc4f | 2017-12-11 13:29:15 -0800 | [diff] [blame] | 75 | "-Wno-int-conversion", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 76 | "-Wno-missing-field-initializers", |
Yi Kong | 892b1a8 | 2018-12-12 11:58:51 -0800 | [diff] [blame] | 77 | "-Wno-null-pointer-arithmetic", |
Elliott Hughes | e42a596 | 2018-10-26 13:18:00 -0700 | [diff] [blame] | 78 | "-Wno-register", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 79 | "-Wno-shift-count-overflow", |
| 80 | "-Wno-sign-compare", |
Stephen Hines | cec0239 | 2020-07-15 17:42:06 -0700 | [diff] [blame] | 81 | "-Wno-strict-prototypes", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 82 | "-Wno-tautological-compare", |
| 83 | "-Wno-tautological-constant-out-of-range-compare", |
| 84 | "-Wno-unused-parameter", |
| 85 | "-Wno-unused-result", |
| 86 | ], |
| 87 | local_include_dirs: ["Include"], |
| 88 | target: { |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 89 | android_arm: { |
| 90 | local_include_dirs: ["android_arm/pyconfig"], |
| 91 | }, |
| 92 | android_arm64: { |
| 93 | local_include_dirs: ["android_arm64/pyconfig"], |
| 94 | }, |
| 95 | android_x86: { |
| 96 | local_include_dirs: ["android_x86/pyconfig"], |
| 97 | }, |
Alex Light | 6f3263d | 2019-02-27 14:37:14 -0800 | [diff] [blame] | 98 | linux_bionic: { |
| 99 | // NB linux_bionic is a 'host' architecture but it uses the bionic libc like 'android' |
| 100 | // targets so use the android pyconfig. |
| 101 | local_include_dirs: ["android_x86_64/pyconfig"], |
| 102 | }, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 103 | android_x86_64: { |
| 104 | local_include_dirs: ["android_x86_64/pyconfig"], |
| 105 | }, |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 106 | // Regenerate include dirs with android_regen.sh |
| 107 | darwin_x86_64: { |
| 108 | local_include_dirs: ["darwin_x86_64/pyconfig"], |
Stephen Hines | b788eb5 | 2017-11-20 17:31:30 -0800 | [diff] [blame] | 109 | cflags: [ |
| 110 | "-Wno-deprecated-declarations", |
| 111 | "-Wno-pointer-arith", |
| 112 | ], |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 113 | }, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 114 | linux_glibc_x86: { |
| 115 | enabled: false, |
| 116 | }, |
Colin Cross | fc6603b | 2022-03-08 15:12:47 -0800 | [diff] [blame] | 117 | linux_musl_x86: { |
| 118 | enabled: false, |
| 119 | }, |
Dan Willemsen | e41d4ce | 2017-10-02 10:41:09 -0700 | [diff] [blame] | 120 | linux_glibc_x86_64: { |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 121 | local_include_dirs: ["linux_x86_64/pyconfig"], |
Chih-Hung Hsieh | 6eebfa0 | 2017-10-13 14:40:05 -0700 | [diff] [blame] | 122 | cflags: ["-Werror"], |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 123 | }, |
Colin Cross | fc6603b | 2022-03-08 15:12:47 -0800 | [diff] [blame] | 124 | linux_musl_x86_64: { |
| 125 | local_include_dirs: ["linux_x86_64/pyconfig"], |
| 126 | cflags: ["-Werror"], |
| 127 | }, |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 128 | windows: { |
| 129 | enabled: false, |
| 130 | }, |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 131 | }, |
| 132 | host_supported: true, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 133 | compile_multilib: "both", |
| 134 | multilib: { |
| 135 | lib32: { |
| 136 | suffix: "32", |
| 137 | }, |
| 138 | lib64: { |
| 139 | suffix: "64", |
| 140 | }, |
| 141 | }, |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | cc_library_static { |
| 145 | name: "py2-interp-parser", |
| 146 | defaults: ["py2-interp-defaults"], |
| 147 | srcs: [ |
| 148 | "Parser/acceler.c", |
| 149 | "Parser/bitset.c", |
| 150 | "Parser/firstsets.c", |
| 151 | "Parser/grammar.c", |
| 152 | "Parser/grammar1.c", |
| 153 | "Parser/listnode.c", |
| 154 | "Parser/metagrammar.c", |
| 155 | "Parser/myreadline.c", |
| 156 | "Parser/node.c", |
| 157 | "Parser/parser.c", |
| 158 | "Parser/parsetok.c", |
| 159 | "Parser/pgen.c", |
| 160 | "Parser/tokenizer.c", |
| 161 | ], |
| 162 | } |
| 163 | |
| 164 | cc_library_static { |
| 165 | name: "py2-interp-object", |
| 166 | defaults: ["py2-interp-defaults"], |
| 167 | srcs: [ |
| 168 | "Objects/abstract.c", |
| 169 | "Objects/boolobject.c", |
| 170 | "Objects/bufferobject.c", |
| 171 | "Objects/bytes_methods.c", |
| 172 | "Objects/bytearrayobject.c", |
| 173 | "Objects/capsule.c", |
| 174 | "Objects/cellobject.c", |
| 175 | "Objects/classobject.c", |
| 176 | "Objects/cobject.c", |
| 177 | "Objects/codeobject.c", |
| 178 | "Objects/complexobject.c", |
| 179 | "Objects/descrobject.c", |
| 180 | "Objects/enumobject.c", |
| 181 | "Objects/exceptions.c", |
| 182 | "Objects/genobject.c", |
| 183 | "Objects/fileobject.c", |
| 184 | "Objects/floatobject.c", |
| 185 | "Objects/frameobject.c", |
| 186 | "Objects/funcobject.c", |
| 187 | "Objects/intobject.c", |
| 188 | "Objects/iterobject.c", |
| 189 | "Objects/listobject.c", |
| 190 | "Objects/longobject.c", |
| 191 | "Objects/dictobject.c", |
| 192 | "Objects/memoryobject.c", |
| 193 | "Objects/methodobject.c", |
| 194 | "Objects/moduleobject.c", |
| 195 | "Objects/object.c", |
| 196 | "Objects/obmalloc.c", |
| 197 | "Objects/rangeobject.c", |
| 198 | "Objects/setobject.c", |
| 199 | "Objects/sliceobject.c", |
| 200 | "Objects/stringobject.c", |
| 201 | "Objects/structseq.c", |
| 202 | "Objects/tupleobject.c", |
| 203 | "Objects/typeobject.c", |
| 204 | "Objects/weakrefobject.c", |
| 205 | "Objects/unicodeobject.c", |
| 206 | "Objects/unicodectype.c", |
| 207 | ], |
| 208 | } |
| 209 | |
| 210 | cc_library_static { |
| 211 | name: "py2-interp-python", |
| 212 | defaults: ["py2-interp-defaults"], |
Nan Zhang | 04b6dca | 2017-12-05 13:34:52 -0800 | [diff] [blame] | 213 | target: { |
| 214 | linux: { |
| 215 | cflags: [ |
| 216 | "-DPLATFORM=\"linux2\"", |
| 217 | ], |
| 218 | }, |
| 219 | darwin_x86_64: { |
| 220 | cflags: [ |
| 221 | "-DPLATFORM=\"darwin\"", |
| 222 | ], |
| 223 | }, |
| 224 | }, |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 225 | srcs: [ |
| 226 | "Python/_warnings.c", |
| 227 | "Python/Python-ast.c", |
| 228 | "Python/asdl.c", |
| 229 | "Python/ast.c", |
| 230 | "Python/bltinmodule.c", |
| 231 | "Python/ceval.c", |
| 232 | "Python/compile.c", |
| 233 | "Python/codecs.c", |
| 234 | "Python/errors.c", |
| 235 | "Python/frozen.c", |
| 236 | "Python/frozenmain.c", |
| 237 | "Python/future.c", |
| 238 | "Python/getargs.c", |
| 239 | "Python/getcompiler.c", |
| 240 | "Python/getcopyright.c", |
| 241 | "Python/getplatform.c", |
| 242 | "Python/getversion.c", |
| 243 | "Python/graminit.c", |
| 244 | "Python/import.c", |
| 245 | "Python/importdl.c", |
| 246 | "Python/marshal.c", |
| 247 | "Python/modsupport.c", |
| 248 | "Python/mystrtoul.c", |
| 249 | "Python/mysnprintf.c", |
| 250 | "Python/peephole.c", |
| 251 | "Python/pyarena.c", |
| 252 | "Python/pyctype.c", |
| 253 | "Python/pyfpe.c", |
| 254 | "Python/pymath.c", |
| 255 | "Python/pystate.c", |
| 256 | "Python/pythonrun.c", |
| 257 | "Python/random.c", |
| 258 | "Python/structmember.c", |
| 259 | "Python/symtable.c", |
| 260 | "Python/sysmodule.c", |
| 261 | "Python/traceback.c", |
| 262 | "Python/getopt.c", |
| 263 | "Python/pystrcmp.c", |
| 264 | "Python/pystrtod.c", |
| 265 | "Python/dtoa.c", |
| 266 | "Python/formatter_unicode.c", |
| 267 | "Python/formatter_string.c", |
| 268 | "Python/dynload_shlib.c", |
| 269 | "Python/thread.c", |
| 270 | ], |
| 271 | } |
| 272 | |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 273 | cc_defaults { |
| 274 | name: "py2-launcher-defaults", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 275 | defaults: ["py2-interp-defaults"], |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 276 | cflags: [ |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 277 | "-DVERSION=\"2.7\"", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 278 | "-DVPATH=\"\"", |
| 279 | "-DPREFIX=\"\"", |
| 280 | "-DEXEC_PREFIX=\"\"", |
Dan Willemsen | 99f2754 | 2019-02-14 21:21:48 -0800 | [diff] [blame] | 281 | "-DPYTHONPATH=\"..:\"", |
| 282 | "-DANDROID_SKIP_ZIP_PATH", |
| 283 | "-DANDROID_SKIP_EXEC_PREFIX_PATH", |
| 284 | "-DANDROID_LIB_PYTHON_PATH=\"internal/stdlib\"", |
Igor Murashkin | ec37d4a | 2018-08-01 14:30:55 -0700 | [diff] [blame] | 285 | "-DDATE=\"Dec 31 1969\"", |
| 286 | "-DTIME=\"23:59:59\"", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 287 | ], |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 288 | static_libs: [ |
| 289 | "libbase", |
Colin Cross | f67325c | 2019-09-18 11:05:54 -0700 | [diff] [blame] | 290 | "libcrypto_static", |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 291 | "libexpat", |
Tom Cherry | 9645932 | 2020-01-08 14:11:54 -0800 | [diff] [blame] | 292 | "liblog", |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 293 | "libssl", |
| 294 | "libz", |
| 295 | ], |
| 296 | target: { |
| 297 | linux_glibc_x86_64: { |
| 298 | host_ldlibs: ["-lutil"], |
| 299 | }, |
Dan Willemsen | a7c6b23 | 2019-02-20 10:43:11 -0800 | [diff] [blame] | 300 | darwin: { |
| 301 | host_ldlibs: [ |
| 302 | "-framework SystemConfiguration", |
| 303 | "-framework CoreFoundation", |
| 304 | ], |
| 305 | }, |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 306 | host: { |
| 307 | static_libs: ["libsqlite"], |
| 308 | }, |
| 309 | // Use shared libsqlite for device side, otherwise |
| 310 | // the executable size will be really huge. |
| 311 | android: { |
| 312 | shared_libs: ["libsqlite"], |
| 313 | }, |
| 314 | }, |
| 315 | } |
| 316 | |
| 317 | cc_library_static { |
| 318 | name: "py2-launcher-lib", |
| 319 | defaults: ["py2-launcher-defaults"], |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 320 | srcs: [ |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 321 | "Modules/gcmodule.c", |
| 322 | "Modules/getpath.c", |
| 323 | "Modules/config.c", |
| 324 | "Modules/getbuildinfo.c", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 325 | // Default built-in extension py2-c-modules. |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 326 | "Modules/threadmodule.c", |
| 327 | "Modules/signalmodule.c", |
| 328 | "Modules/posixmodule.c", |
| 329 | "Modules/errnomodule.c", |
| 330 | "Modules/pwdmodule.c", |
| 331 | "Modules/_sre.c", |
| 332 | "Modules/_codecsmodule.c", |
| 333 | "Modules/_weakref.c", |
| 334 | "Modules/zipimport.c", |
| 335 | "Modules/symtablemodule.c", |
Dan Willemsen | eba50a5 | 2018-11-16 17:27:26 -0800 | [diff] [blame] | 336 | "Modules/main.c", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 337 | ], |
| 338 | // NOTE: Please update Modules/config.c if new lib get added in the static_libs. |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 339 | whole_static_libs: [ |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 340 | // Be careful the order of these three static libraries below due to |
| 341 | // missing symbols issues. |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 342 | "py2-interp-object", |
| 343 | "py2-interp-python", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 344 | "py2-interp-parser", |
| 345 | "py2-c-module-array", |
| 346 | "py2-c-module-cmath", |
| 347 | "py2-c-module-math", |
| 348 | "py2-c-module-_struct", |
| 349 | "py2-c-module-time", |
| 350 | "py2-c-module-operator", |
| 351 | "py2-c-module-_testcapi", |
| 352 | "py2-c-module-_random", |
| 353 | "py2-c-module-_collections", |
| 354 | "py2-c-module-_heapq", |
| 355 | "py2-c-module-itertools", |
| 356 | "py2-c-module-strop", |
| 357 | "py2-c-module-_functools", |
| 358 | "py2-c-module-datetime", |
| 359 | "py2-c-module-_bisect", |
| 360 | "py2-c-module-unicodedata", |
| 361 | "py2-c-module-_io", |
| 362 | "py2-c-module-fcntl", |
| 363 | "py2-c-module-select", |
| 364 | "py2-c-module-mmap", |
| 365 | "py2-c-module-_csv", |
| 366 | "py2-c-module-_socket", |
| 367 | "py2-c-module-termios", |
Dan Willemsen | dbcebe0 | 2019-01-07 18:07:24 -0800 | [diff] [blame] | 368 | "py2-c-module-_ssl", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 369 | "py2-c-module-_md5", |
| 370 | "py2-c-module-_sha", |
| 371 | "py2-c-module-_sha256", |
| 372 | "py2-c-module-_sha512", |
| 373 | "py2-c-module-binascii", |
| 374 | "py2-c-module-parser", |
| 375 | "py2-c-module-cStringIO", |
| 376 | "py2-c-module-cPickle", |
| 377 | "py2-c-module-xxsubtype", |
| 378 | "py2-c-module-future_builtins", |
| 379 | "py2-c-module-_json", |
| 380 | "py2-c-module-_hotshot", |
| 381 | "py2-c-module-_lsprof", |
| 382 | "py2-c-module-grp", |
| 383 | "py2-c-module-syslog", |
| 384 | "py2-c-module-audioop", |
| 385 | "py2-c-module-resource", |
| 386 | "py2-c-module-_multibytecodec", |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 387 | "py2-c-module-_codecs_kr", |
| 388 | "py2-c-module-_codecs_jp", |
| 389 | "py2-c-module-_codecs_cn", |
| 390 | "py2-c-module-_codecs_tw", |
| 391 | "py2-c-module-_codecs_hk", |
| 392 | "py2-c-module-_codecs_iso2022", |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 393 | "py2-c-module-_multiprocessing", |
| 394 | "py2-c-module-zlib", |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 395 | "py2-c-module-pyexpat", |
| 396 | "py2-c-module-_sqlite3", |
| 397 | "py2-c-module-_ctypes_test", |
| 398 | "py2-c-module-_ctypes", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 399 | ], |
Dan Willemsen | a7c6b23 | 2019-02-20 10:43:11 -0800 | [diff] [blame] | 400 | target: { |
| 401 | darwin: { |
| 402 | whole_static_libs: ["py2-c-module-_scproxy"], |
| 403 | }, |
| 404 | }, |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 405 | } |
| 406 | |
| 407 | cc_binary { |
| 408 | name: "py2-launcher", |
| 409 | defaults: ["py2-launcher-defaults"], |
| 410 | srcs: ["Launcher/launcher_main.cpp"], |
| 411 | static_libs: ["py2-launcher-lib"], |
| 412 | } |
| 413 | |
| 414 | cc_binary { |
| 415 | name: "py2-launcher-autorun", |
| 416 | defaults: ["py2-launcher-defaults"], |
| 417 | srcs: ["Launcher/launcher_main.cpp"], |
| 418 | static_libs: ["py2-launcher-lib"], |
| 419 | cflags: ["-DANDROID_AUTORUN"], |
| 420 | } |
| 421 | |
| 422 | python_binary_host { |
| 423 | name: "py2-cmd", |
| 424 | autorun: false, |
| 425 | version: { |
| 426 | py2: { |
| 427 | enabled: true, |
| 428 | embedded_launcher: true, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 429 | }, |
Dan Willemsen | cd28285 | 2019-02-14 21:41:18 -0800 | [diff] [blame] | 430 | py3: { |
| 431 | enabled: false, |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 432 | }, |
| 433 | }, |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 434 | } |
| 435 | |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 436 | // Enabled extension py2-c-modules. |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 437 | |
| 438 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 439 | name: "py2-c-module-array", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 440 | defaults: ["py2-interp-defaults"], |
| 441 | srcs: [ |
| 442 | "Modules/arraymodule.c", |
| 443 | ], |
| 444 | } |
| 445 | |
| 446 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 447 | name: "py2-c-module-cmath", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 448 | defaults: ["py2-interp-defaults"], |
| 449 | srcs: [ |
| 450 | "Modules/cmathmodule.c", |
| 451 | "Modules/_math.c", |
| 452 | ], |
| 453 | } |
| 454 | |
| 455 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 456 | name: "py2-c-module-math", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 457 | defaults: ["py2-interp-defaults"], |
| 458 | srcs: [ |
| 459 | "Modules/mathmodule.c", |
| 460 | "Modules/_math.c", |
| 461 | ], |
| 462 | } |
| 463 | |
| 464 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 465 | name: "py2-c-module-_struct", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 466 | defaults: ["py2-interp-defaults"], |
| 467 | srcs: [ |
| 468 | "Modules/_struct.c", |
| 469 | ], |
| 470 | } |
| 471 | |
| 472 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 473 | name: "py2-c-module-time", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 474 | defaults: ["py2-interp-defaults"], |
| 475 | srcs: [ |
| 476 | "Modules/timemodule.c", |
| 477 | ], |
| 478 | } |
| 479 | |
| 480 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 481 | name: "py2-c-module-operator", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 482 | defaults: ["py2-interp-defaults"], |
| 483 | srcs: [ |
| 484 | "Modules/operator.c", |
| 485 | ], |
| 486 | } |
| 487 | |
| 488 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 489 | name: "py2-c-module-_testcapi", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 490 | defaults: ["py2-interp-defaults"], |
| 491 | srcs: [ |
| 492 | "Modules/_testcapimodule.c", |
| 493 | ], |
| 494 | } |
| 495 | |
| 496 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 497 | name: "py2-c-module-_random", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 498 | defaults: ["py2-interp-defaults"], |
| 499 | srcs: [ |
| 500 | "Modules/_randommodule.c", |
| 501 | ], |
| 502 | } |
| 503 | |
| 504 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 505 | name: "py2-c-module-_collections", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 506 | defaults: ["py2-interp-defaults"], |
| 507 | srcs: [ |
| 508 | "Modules/_collectionsmodule.c", |
| 509 | ], |
| 510 | } |
| 511 | |
| 512 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 513 | name: "py2-c-module-_heapq", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 514 | defaults: ["py2-interp-defaults"], |
| 515 | srcs: [ |
| 516 | "Modules/_heapqmodule.c", |
| 517 | ], |
| 518 | } |
| 519 | |
| 520 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 521 | name: "py2-c-module-itertools", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 522 | defaults: ["py2-interp-defaults"], |
| 523 | srcs: [ |
| 524 | "Modules/itertoolsmodule.c", |
| 525 | ], |
| 526 | } |
| 527 | |
| 528 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 529 | name: "py2-c-module-strop", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 530 | defaults: ["py2-interp-defaults"], |
| 531 | srcs: [ |
| 532 | "Modules/stropmodule.c", |
| 533 | ], |
| 534 | } |
| 535 | |
| 536 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 537 | name: "py2-c-module-_functools", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 538 | defaults: ["py2-interp-defaults"], |
| 539 | srcs: [ |
| 540 | "Modules/_functoolsmodule.c", |
| 541 | ], |
| 542 | } |
| 543 | |
| 544 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 545 | name: "py2-c-module-datetime", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 546 | defaults: ["py2-interp-defaults"], |
| 547 | srcs: [ |
| 548 | "Modules/datetimemodule.c", |
| 549 | ], |
| 550 | } |
| 551 | |
| 552 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 553 | name: "py2-c-module-_bisect", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 554 | defaults: ["py2-interp-defaults"], |
| 555 | srcs: [ |
| 556 | "Modules/_bisectmodule.c", |
| 557 | ], |
| 558 | } |
| 559 | |
| 560 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 561 | name: "py2-c-module-unicodedata", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 562 | defaults: ["py2-interp-defaults"], |
| 563 | srcs: [ |
| 564 | "Modules/unicodedata.c", |
| 565 | ], |
| 566 | } |
| 567 | |
| 568 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 569 | name: "py2-c-module-_io", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 570 | defaults: ["py2-interp-defaults"], |
| 571 | srcs: [ |
| 572 | "Modules/_io/bufferedio.c", |
| 573 | "Modules/_io/bytesio.c", |
| 574 | "Modules/_io/fileio.c", |
| 575 | "Modules/_io/iobase.c", |
| 576 | "Modules/_io/_iomodule.c", |
| 577 | "Modules/_io/stringio.c", |
| 578 | "Modules/_io/textio.c", |
| 579 | ], |
| 580 | local_include_dirs: [ |
| 581 | "Modules/_io", |
| 582 | ], |
| 583 | } |
| 584 | |
| 585 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 586 | name: "py2-c-module-fcntl", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 587 | defaults: ["py2-interp-defaults"], |
| 588 | srcs: [ |
| 589 | "Modules/fcntlmodule.c", |
| 590 | ], |
| 591 | } |
| 592 | |
| 593 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 594 | name: "py2-c-module-select", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 595 | defaults: ["py2-interp-defaults"], |
| 596 | srcs: [ |
| 597 | "Modules/selectmodule.c", |
| 598 | ], |
| 599 | } |
| 600 | |
| 601 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 602 | name: "py2-c-module-mmap", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 603 | defaults: ["py2-interp-defaults"], |
| 604 | srcs: [ |
| 605 | "Modules/mmapmodule.c", |
| 606 | ], |
| 607 | } |
| 608 | |
| 609 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 610 | name: "py2-c-module-_csv", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 611 | defaults: ["py2-interp-defaults"], |
| 612 | srcs: [ |
| 613 | "Modules/_csv.c", |
| 614 | ], |
| 615 | } |
| 616 | |
| 617 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 618 | name: "py2-c-module-_socket", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 619 | defaults: ["py2-interp-defaults"], |
| 620 | srcs: [ |
| 621 | "Modules/socketmodule.c", |
| 622 | "Modules/timemodule.c", |
| 623 | ], |
| 624 | } |
| 625 | |
| 626 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 627 | name: "py2-c-module-termios", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 628 | defaults: ["py2-interp-defaults"], |
| 629 | srcs: [ |
| 630 | "Modules/termios.c", |
| 631 | ], |
| 632 | } |
| 633 | |
| 634 | cc_library_static { |
Dan Willemsen | dbcebe0 | 2019-01-07 18:07:24 -0800 | [diff] [blame] | 635 | name: "py2-c-module-_ssl", |
| 636 | defaults: ["py2-interp-defaults"], |
| 637 | srcs: ["Modules/_ssl.c"], |
| 638 | cflags: ["-Wno-incompatible-pointer-types-discards-qualifiers"], |
| 639 | static_libs: [ |
| 640 | "libssl", |
Colin Cross | f67325c | 2019-09-18 11:05:54 -0700 | [diff] [blame] | 641 | "libcrypto_static", |
Dan Willemsen | dbcebe0 | 2019-01-07 18:07:24 -0800 | [diff] [blame] | 642 | ], |
| 643 | } |
| 644 | |
| 645 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 646 | name: "py2-c-module-_md5", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 647 | defaults: ["py2-interp-defaults"], |
| 648 | srcs: [ |
| 649 | "Modules/md5module.c", |
| 650 | "Modules/md5.c", |
| 651 | ], |
| 652 | } |
| 653 | |
| 654 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 655 | name: "py2-c-module-_sha", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 656 | defaults: ["py2-interp-defaults"], |
| 657 | srcs: [ |
| 658 | "Modules/shamodule.c", |
| 659 | ], |
| 660 | } |
| 661 | |
| 662 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 663 | name: "py2-c-module-_sha256", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 664 | defaults: ["py2-interp-defaults"], |
| 665 | srcs: [ |
| 666 | "Modules/sha256module.c", |
| 667 | ], |
| 668 | } |
| 669 | |
| 670 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 671 | name: "py2-c-module-_sha512", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 672 | defaults: ["py2-interp-defaults"], |
| 673 | srcs: [ |
| 674 | "Modules/sha512module.c", |
| 675 | ], |
| 676 | } |
| 677 | |
| 678 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 679 | name: "py2-c-module-binascii", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 680 | defaults: ["py2-interp-defaults"], |
| 681 | srcs: [ |
| 682 | "Modules/binascii.c", |
| 683 | ], |
| 684 | } |
| 685 | |
| 686 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 687 | name: "py2-c-module-parser", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 688 | defaults: ["py2-interp-defaults"], |
| 689 | srcs: [ |
| 690 | "Modules/parsermodule.c", |
| 691 | ], |
| 692 | } |
| 693 | |
| 694 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 695 | name: "py2-c-module-cStringIO", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 696 | defaults: ["py2-interp-defaults"], |
| 697 | srcs: [ |
| 698 | "Modules/cStringIO.c", |
| 699 | ], |
| 700 | } |
| 701 | |
| 702 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 703 | name: "py2-c-module-cPickle", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 704 | defaults: ["py2-interp-defaults"], |
| 705 | srcs: [ |
| 706 | "Modules/cPickle.c", |
| 707 | ], |
| 708 | } |
| 709 | |
| 710 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 711 | name: "py2-c-module-xxsubtype", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 712 | defaults: ["py2-interp-defaults"], |
| 713 | srcs: [ |
| 714 | "Modules/xxsubtype.c", |
| 715 | ], |
| 716 | } |
| 717 | |
| 718 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 719 | name: "py2-c-module-future_builtins", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 720 | defaults: ["py2-interp-defaults"], |
| 721 | srcs: [ |
| 722 | "Modules/future_builtins.c", |
| 723 | ], |
| 724 | } |
| 725 | |
| 726 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 727 | name: "py2-c-module-_json", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 728 | defaults: ["py2-interp-defaults"], |
| 729 | srcs: [ |
| 730 | "Modules/_json.c", |
| 731 | ], |
| 732 | } |
| 733 | |
| 734 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 735 | name: "py2-c-module-_hotshot", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 736 | defaults: ["py2-interp-defaults"], |
| 737 | srcs: [ |
| 738 | "Modules/_hotshot.c", |
| 739 | ], |
| 740 | } |
| 741 | |
| 742 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 743 | name: "py2-c-module-_lsprof", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 744 | defaults: ["py2-interp-defaults"], |
| 745 | srcs: [ |
| 746 | "Modules/_lsprof.c", |
| 747 | "Modules/rotatingtree.c", |
| 748 | ], |
| 749 | } |
| 750 | |
| 751 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 752 | name: "py2-c-module-grp", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 753 | defaults: ["py2-interp-defaults"], |
| 754 | srcs: [ |
| 755 | "Modules/grpmodule.c", |
| 756 | "Modules/rotatingtree.c", |
| 757 | ], |
| 758 | } |
| 759 | |
| 760 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 761 | name: "py2-c-module-syslog", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 762 | defaults: ["py2-interp-defaults"], |
| 763 | srcs: [ |
| 764 | "Modules/syslogmodule.c", |
| 765 | ], |
| 766 | } |
| 767 | |
| 768 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 769 | name: "py2-c-module-audioop", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 770 | defaults: ["py2-interp-defaults"], |
| 771 | srcs: [ |
| 772 | "Modules/audioop.c", |
| 773 | ], |
| 774 | } |
| 775 | |
| 776 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 777 | name: "py2-c-module-resource", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 778 | defaults: ["py2-interp-defaults"], |
| 779 | srcs: [ |
| 780 | "Modules/resource.c", |
| 781 | ], |
| 782 | } |
| 783 | |
| 784 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 785 | name: "py2-c-module-_multibytecodec", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 786 | defaults: ["py2-interp-defaults"], |
| 787 | srcs: [ |
| 788 | "Modules/cjkcodecs/multibytecodec.c", |
| 789 | ], |
| 790 | } |
| 791 | |
| 792 | cc_library_static { |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 793 | name: "py2-c-module-_codecs_kr", |
| 794 | defaults: ["py2-interp-defaults"], |
| 795 | srcs: ["Modules/cjkcodecs/_codecs_kr.c"], |
| 796 | } |
| 797 | |
| 798 | cc_library_static { |
| 799 | name: "py2-c-module-_codecs_jp", |
| 800 | defaults: ["py2-interp-defaults"], |
| 801 | srcs: ["Modules/cjkcodecs/_codecs_jp.c"], |
| 802 | } |
| 803 | |
| 804 | cc_library_static { |
| 805 | name: "py2-c-module-_codecs_cn", |
| 806 | defaults: ["py2-interp-defaults"], |
| 807 | srcs: ["Modules/cjkcodecs/_codecs_cn.c"], |
| 808 | } |
| 809 | |
| 810 | cc_library_static { |
| 811 | name: "py2-c-module-_codecs_tw", |
| 812 | defaults: ["py2-interp-defaults"], |
| 813 | srcs: ["Modules/cjkcodecs/_codecs_tw.c"], |
| 814 | } |
| 815 | |
| 816 | cc_library_static { |
| 817 | name: "py2-c-module-_codecs_hk", |
| 818 | defaults: ["py2-interp-defaults"], |
| 819 | srcs: ["Modules/cjkcodecs/_codecs_hk.c"], |
| 820 | } |
| 821 | |
| 822 | cc_library_static { |
| 823 | name: "py2-c-module-_codecs_iso2022", |
| 824 | defaults: ["py2-interp-defaults"], |
| 825 | srcs: ["Modules/cjkcodecs/_codecs_iso2022.c"], |
| 826 | } |
| 827 | |
| 828 | cc_library_static { |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 829 | name: "py2-c-module-_multiprocessing", |
Nan Zhang | c393914 | 2017-05-25 23:21:27 -0700 | [diff] [blame] | 830 | defaults: ["py2-interp-defaults"], |
| 831 | srcs: [ |
| 832 | "Modules/_multiprocessing/multiprocessing.c", |
| 833 | "Modules/_multiprocessing/semaphore.c", |
| 834 | "Modules/_multiprocessing/socket_connection.c", |
| 835 | ], |
| 836 | } |
Nan Zhang | ced2751 | 2017-06-19 18:01:34 -0700 | [diff] [blame] | 837 | |
| 838 | cc_library_static { |
| 839 | name: "py2-c-module-zlib", |
| 840 | defaults: [ |
| 841 | "py2-interp-defaults", |
| 842 | ], |
| 843 | cflags: [ |
| 844 | "-DUSE_ZLIB_CRC32", |
| 845 | ], |
| 846 | srcs: [ |
| 847 | "Modules/zlibmodule.c", |
| 848 | ], |
| 849 | static_libs: [ |
| 850 | "libz", |
| 851 | ], |
| 852 | } |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 853 | |
| 854 | cc_library_static { |
| 855 | name: "py2-c-module-pyexpat", |
| 856 | defaults: [ |
| 857 | "py2-interp-defaults", |
| 858 | ], |
| 859 | cflags: [ |
| 860 | "-DUSE_PYEXPAT_CAPI", |
| 861 | ], |
| 862 | srcs: [ |
| 863 | "Modules/pyexpat.c", |
| 864 | ], |
| 865 | static_libs: [ |
| 866 | "libexpat", |
| 867 | ], |
| 868 | } |
| 869 | |
| 870 | cc_library_static { |
| 871 | name: "py2-c-module-_sqlite3", |
| 872 | defaults: [ |
| 873 | "py2-interp-defaults", |
| 874 | ], |
| 875 | cflags: [ |
| 876 | "-DMODULE_NAME=\"sqlite3\"", |
| 877 | "-DSQLITE_OMIT_LOAD_EXTENSION", |
| 878 | "-Wno-format-security", |
| 879 | "-Wno-type-limits", |
| 880 | "-Wno-char-subscripts", |
| 881 | ], |
| 882 | local_include_dirs: [ |
| 883 | "Modules/_sqlite", |
| 884 | ], |
| 885 | srcs: [ |
| 886 | "Modules/_sqlite/cache.c", |
| 887 | "Modules/_sqlite/connection.c", |
| 888 | "Modules/_sqlite/cursor.c", |
| 889 | "Modules/_sqlite/microprotocols.c", |
| 890 | "Modules/_sqlite/module.c", |
| 891 | "Modules/_sqlite/prepare_protocol.c", |
| 892 | "Modules/_sqlite/row.c", |
| 893 | "Modules/_sqlite/statement.c", |
| 894 | "Modules/_sqlite/util.c", |
| 895 | ], |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 896 | target: { |
Alex Light | 6f3263d | 2019-02-27 14:37:14 -0800 | [diff] [blame] | 897 | host: { |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 898 | static_libs: [ |
| 899 | "libsqlite", |
| 900 | ], |
| 901 | }, |
| 902 | android: { |
| 903 | shared_libs: [ |
| 904 | "libsqlite", |
Dan Willemsen | 04e3910 | 2019-02-14 21:00:06 -0800 | [diff] [blame] | 905 | ], |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 906 | }, |
| 907 | }, |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 908 | } |
| 909 | |
| 910 | cc_library_static { |
| 911 | name: "py2-c-module-_ctypes_test", |
| 912 | defaults: ["py2-interp-defaults"], |
| 913 | srcs: ["Modules/_ctypes/_ctypes_test.c"], |
| 914 | } |
| 915 | |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 916 | cc_library_static { |
| 917 | name: "py2-c-module-_ctypes", |
| 918 | defaults: [ |
| 919 | "py2-interp-defaults", |
| 920 | ], |
| 921 | local_include_dirs: [ |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 922 | "Modules/_ctypes/libffi/include", |
| 923 | ], |
| 924 | srcs: [ |
| 925 | "Modules/_ctypes/_ctypes.c", |
| 926 | "Modules/_ctypes/callbacks.c", |
| 927 | "Modules/_ctypes/callproc.c", |
| 928 | "Modules/_ctypes/stgdict.c", |
| 929 | "Modules/_ctypes/cfield.c", |
| 930 | "Modules/_ctypes/libffi/src/prep_cif.c", |
| 931 | "Modules/_ctypes/libffi/src/closures.c", |
| 932 | ], |
| 933 | arch: { |
| 934 | x86_64: { |
| 935 | local_include_dirs: [ |
| 936 | "Modules/_ctypes/libffi/src/x86", |
| 937 | ], |
| 938 | srcs: [ |
| 939 | "Modules/_ctypes/libffi/src/x86/ffi64.c", |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 940 | "Modules/_ctypes/libffi/src/x86/ffi.c", |
| 941 | "Modules/_ctypes/libffi/src/x86/sysv.S", |
| 942 | ], |
| 943 | }, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 944 | x86: { |
| 945 | local_include_dirs: [ |
| 946 | "Modules/_ctypes/libffi/src/x86", |
| 947 | ], |
| 948 | srcs: [ |
| 949 | "Modules/_ctypes/libffi/src/x86/ffi.c", |
| 950 | "Modules/_ctypes/libffi/src/x86/sysv.S", |
| 951 | ], |
| 952 | }, |
| 953 | arm: { |
| 954 | local_include_dirs: [ |
| 955 | "android_arm/libffi", |
| 956 | "Modules/_ctypes/libffi/src/arm", |
| 957 | ], |
| 958 | srcs: [ |
| 959 | "Modules/_ctypes/libffi/src/arm/ffi.c", |
| 960 | "Modules/_ctypes/libffi/src/arm/sysv.S", |
| 961 | "Modules/_ctypes/libffi/src/arm/trampoline.S", |
Dan Willemsen | 04e3910 | 2019-02-14 21:00:06 -0800 | [diff] [blame] | 962 | ], |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 963 | }, |
| 964 | arm64: { |
| 965 | // arithmetic on a pointer in _ctypes/libffi/src/aarch64/ffi.c |
| 966 | cflags: ["-Wno-pointer-arith"], |
| 967 | local_include_dirs: [ |
| 968 | "android_arm64/libffi", |
| 969 | "Modules/_ctypes/libffi/src/aarch64", |
| 970 | ], |
| 971 | srcs: [ |
| 972 | "Modules/_ctypes/libffi/src/aarch64/ffi.c", |
| 973 | "Modules/_ctypes/libffi/src/aarch64/sysv.S", |
Dan Willemsen | 04e3910 | 2019-02-14 21:00:06 -0800 | [diff] [blame] | 974 | ], |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 975 | }, |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 976 | }, |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 977 | target: { |
| 978 | // Regenerate include dirs with android_regen.sh |
| 979 | darwin_x86_64: { |
| 980 | local_include_dirs: ["darwin_x86_64/libffi"], |
| 981 | srcs: [ |
| 982 | "Modules/_ctypes/libffi/src/x86/darwin.S", |
| 983 | "Modules/_ctypes/libffi/src/x86/darwin64.S", |
| 984 | ], |
| 985 | }, |
Colin Cross | fc6603b | 2022-03-08 15:12:47 -0800 | [diff] [blame] | 986 | host_linux: { |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 987 | local_include_dirs: ["linux_x86_64/libffi"], |
| 988 | srcs: [ |
| 989 | "Modules/_ctypes/libffi/src/x86/unix64.S", |
| 990 | ], |
| 991 | }, |
Nan Zhang | 33bb4bb | 2017-12-01 20:00:54 +0000 | [diff] [blame] | 992 | android_x86: { |
| 993 | local_include_dirs: ["android_x86/libffi"], |
| 994 | srcs: [ |
| 995 | "Modules/_ctypes/libffi/src/x86/win32.S", |
| 996 | ], |
| 997 | }, |
| 998 | android_x86_64: { |
| 999 | local_include_dirs: ["android_x86_64/libffi"], |
| 1000 | srcs: [ |
| 1001 | "Modules/_ctypes/libffi/src/x86/unix64.S", |
| 1002 | ], |
| 1003 | }, |
Dan Willemsen | c88c080 | 2017-09-25 14:33:27 -0700 | [diff] [blame] | 1004 | }, |
Nan Zhang | d5c4d4a | 2017-07-19 16:22:00 -0700 | [diff] [blame] | 1005 | } |
Dan Willemsen | a7c6b23 | 2019-02-20 10:43:11 -0800 | [diff] [blame] | 1006 | |
| 1007 | cc_library_host_static { |
| 1008 | name: "py2-c-module-_scproxy", |
| 1009 | defaults: ["py2-interp-defaults"], |
| 1010 | srcs: ["Mac/Modules/_scproxy.c"], |
| 1011 | target: { |
| 1012 | linux: { |
| 1013 | enabled: false, |
| 1014 | }, |
| 1015 | }, |
| 1016 | } |