diff options
| -rw-r--r-- | tools/cross_compile_android/main.py | 10 | ||||
| -rw-r--r-- | tools/cross_compile_android/templates/cross_compile.tmpl.sh | 6 |
2 files changed, 5 insertions, 11 deletions
diff --git a/tools/cross_compile_android/main.py b/tools/cross_compile_android/main.py index bda438cca..a1cc82876 100644 --- a/tools/cross_compile_android/main.py +++ b/tools/cross_compile_android/main.py @@ -221,7 +221,8 @@ if __name__ == "__main__": ndk_path=ndk_path, api_level=platform_data.api_level, android_py_install_path_prefix=pyside6_deploy_cache, - host_python_path=sys.executable + host_python_path=sys.executable, + python_version=PYTHON_VERSION ) logging.info(f"Writing Python cross compile script into {python_ccompile_script}") @@ -240,13 +241,6 @@ if __name__ == "__main__": run_command([f"./{python_ccompile_script.name}"], cwd=cpython_dir, dry_run=dry_run, show_stdout=True) - # run patchelf to change the SONAME of libpython from libpython3.x.so.1.0 to - # libpython3.x.so, to match with python_for_android's Python library. Otherwise, - # the Qfp binaries won't be able to link to Python - run_command(["patchelf", "--set-soname", f"libpython{PYTHON_VERSION}.so", - f"libpython{PYTHON_VERSION}.so.1.0"], cwd=Path(python_path) / "lib", - dry_run=dry_run) - logging.info( f"Cross compile Python for Android platform {platform_data.plat_name}. " f"Final installation in {python_path}" diff --git a/tools/cross_compile_android/templates/cross_compile.tmpl.sh b/tools/cross_compile_android/templates/cross_compile.tmpl.sh index a68907591..6c17e077c 100644 --- a/tools/cross_compile_android/templates/cross_compile.tmpl.sh +++ b/tools/cross_compile_android/templates/cross_compile.tmpl.sh @@ -24,6 +24,6 @@ export CFLAGS='-fPIC -DANDROID' --with-build-python={{ host_python_path }} --enable-shared \ --enable-ipv6 ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no --without-ensurepip \ ac_cv_little_endian_double=yes -make BLDSHARED="$CC -shared" CROSS-COMPILE=$TOOL_PREFIX- CROSS_COMPILE_TARGET=yes -make install BLDSHARED="$CC -shared" CROSS-COMPILE=$TOOL_PREFIX- \ -CROSS_COMPILE_TARGET=yes prefix={{ android_py_install_path_prefix }}/Python-$HOST_ARCH/_install +make BLDSHARED="$CC -shared" CROSS-COMPILE=$TOOL_PREFIX- CROSS_COMPILE_TARGET=yes \ +INSTSONAME=libpython{{ python_version }}.so +make install prefix={{ android_py_install_path_prefix }}/Python-$HOST_ARCH/_install |
