diff options
author | Hood Chatham <roberthoodchatham@gmail.com> | 2024-10-29 21:45:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-29 21:45:49 (GMT) |
commit | b1f13bce62ff666f59286e8325011d8e9e0ddca7 (patch) | |
tree | 6d5752201a8fa93b483ab6958e7a1b525782728b /configure.ac | |
parent | 6742f14dfd3fa8ba8a245efa21a4f723160d93d4 (diff) | |
download | cpython-b1f13bce62ff666f59286e8325011d8e9e0ddca7.zip cpython-b1f13bce62ff666f59286e8325011d8e9e0ddca7.tar.gz cpython-b1f13bce62ff666f59286e8325011d8e9e0ddca7.tar.bz2 |
gh-124932: Distinguish build prefix from host prefix in cross builds (#124933)
In Emscripten and other cross builds, the build file system and the host file
system look different. For instance, we may want to install into
`cross-build/$TARGET/lib`, and then mount that as `/lib` in the host file
system. This change adds a distinction between:
* `prefix` -- the path in the build file system where we want to install the files
* `host_prefix` -- the path in the host file system where getpath.c will look for the files
And similarly for `exec_prefix` and `host_exec_prefix`. At present, this is only
used for Emscripten.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a470fd4..42daf1c 100644 --- a/configure.ac +++ b/configure.ac @@ -379,6 +379,25 @@ then fi AC_MSG_RESULT(["$MACHDEP"]) +dnl For cross compilation, we distinguish between "prefix" (where we install the +dnl files) and "host_prefix" (where we expect to find the files at runtime) + +if test -z "$host_prefix"; then + AS_CASE([$ac_sys_system], + [Emscripten], [host_prefix=/], + [host_prefix='${prefix}'] + ) +fi +AC_SUBST([host_prefix]) + +if test -z "$host_exec_prefix"; then + AS_CASE([$ac_sys_system], + [Emscripten], [host_exec_prefix=$host_prefix], + [host_exec_prefix='${exec_prefix}'] + ) +fi +AC_SUBST([host_exec_prefix]) + # On cross-compile builds, configure will look for a host-specific compiler by # prepending the user-provided host triple to the required binary name. # |