CMake: Rename the cache variable POSIX_SHELL to XZ_POSIX_SHELL

We still need the variable POSIX_SHELL for configure_file()
but it doesn't need to be a cache variable.
This commit is contained in:
Lasse Collin 2024-06-15 18:07:04 +03:00
parent e5c0eb2e50
commit 679500ffe0
1 changed files with 4 additions and 3 deletions

View File

@ -1978,14 +1978,14 @@ if(UNIX)
set(POSIX_SHELL_DEFAULT "/bin/sh") set(POSIX_SHELL_DEFAULT "/bin/sh")
endif() endif()
set(POSIX_SHELL "${POSIX_SHELL_DEFAULT}" CACHE STRING set(XZ_POSIX_SHELL "${POSIX_SHELL_DEFAULT}" CACHE STRING
"Shell to use for scripts (xzgrep and others)") "Shell to use for scripts (xzgrep and others)")
# Guess the extra path to add from POSIX_SHELL. Autotools-based build # Guess the extra path to add from XZ_POSIX_SHELL. Autotools-based build
# has a separate option --enable-path-for-scripts=PREFIX but this is # has a separate option --enable-path-for-scripts=PREFIX but this is
# enough for Solaris. # enough for Solaris.
set(enable_path_for_scripts) set(enable_path_for_scripts)
get_filename_component(POSIX_SHELL_DIR "${POSIX_SHELL}" DIRECTORY) get_filename_component(POSIX_SHELL_DIR "${XZ_POSIX_SHELL}" DIRECTORY)
if(NOT POSIX_SHELL_DIR STREQUAL "/bin" AND if(NOT POSIX_SHELL_DIR STREQUAL "/bin" AND
NOT POSIX_SHELL_DIR STREQUAL "/usr/bin") NOT POSIX_SHELL_DIR STREQUAL "/usr/bin")
@ -2005,6 +2005,7 @@ if(UNIX)
endif() endif()
set(xz "xz") set(xz "xz")
set(POSIX_SHELL "${XZ_POSIX_SHELL}")
foreach(S xzdiff xzgrep xzmore xzless) foreach(S xzdiff xzgrep xzmore xzless)
configure_file("src/scripts/${S}.in" "${S}" configure_file("src/scripts/${S}.in" "${S}"