(context, host=None)
| 231 | |
| 232 | |
| 233 | def configure_host_python(context, host=None): |
| 234 | if host is None: |
| 235 | host = context.host |
| 236 | if context.clean: |
| 237 | clean(host) |
| 238 | |
| 239 | host_dir = subdir(host, create=True) |
| 240 | prefix_dir = host_dir / "prefix" |
| 241 | if not prefix_dir.exists(): |
| 242 | prefix_dir.mkdir() |
| 243 | cache_dir = ( |
| 244 | Path(context.cache_dir).resolve() |
| 245 | if context.cache_dir |
| 246 | else CROSS_BUILD_DIR / "downloads" |
| 247 | ) |
| 248 | unpack_deps(host, prefix_dir, cache_dir) |
| 249 | |
| 250 | os.chdir(host_dir) |
| 251 | command = [ |
| 252 | # Basic cross-compiling configuration |
| 253 | relpath(PYTHON_DIR / "configure"), |
| 254 | f"--host={host}", |
| 255 | f"--build={sysconfig.get_config_var('BUILD_GNU_TYPE')}", |
| 256 | f"--with-build-python={build_python_path()}", |
| 257 | "--without-ensurepip", |
| 258 | |
| 259 | # Android always uses a shared libpython. |
| 260 | "--enable-shared", |
| 261 | "--without-static-libpython", |
| 262 | |
| 263 | # Dependent libraries. The others are found using pkg-config: see |
| 264 | # android-env.sh. |
| 265 | f"--with-openssl={prefix_dir}", |
| 266 | ] |
| 267 | |
| 268 | if context.args: |
| 269 | command.extend(context.args) |
| 270 | run(command, host=host) |
| 271 | |
| 272 | |
| 273 | def make_host_python(context, host=None): |
no test coverage detected
searching dependent graphs…