From 47eda17460c4e1e229603082a31d40ae44b1962d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 13 Oct 2023 19:21:04 +0200 Subject: [PATCH] Remove implicit LDFLAGS, CPPFLAGS, and "ldflags_dirs" build step The default settings for LDFLAGS and CPPFLAGS were there since the initial commit to ruby-build: LDFLAGS="-L${PREFIX_PATH}/lib" CPPFLAGS="-I${PREFIX_PATH}/include" However, it's not clear to me what these settings help with. A typical Ruby installation will initialize files in these directories, but it will do so regardless of the environment variables. So, let's remove them and see what breaks. --- bin/ruby-build | 19 ++----------------- script/update-cruby | 2 +- test/build.bats | 6 +++--- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 51fde4bb..229d4b0a 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -1190,21 +1190,9 @@ build_package_verify_openssl() { ' "$(basename "$(type -p yum apt-get | head -1)")" >&4 2>&1 } -# Ensure that directories listed in LDFLAGS exist +# Kept for backward compatibility with 3rd-party definitions. build_package_ldflags_dirs() { - local ldflags - read -d '' -r -a ldflags <<<"$LDFLAGS" || true - local index=0 - local dir - while [ "$index" -lt "${#ldflags[@]}" ]; do - dir="" - case "${ldflags[index]}" in - -L ) dir="${ldflags[index+1]}" ;; - -L* ) dir="${ldflags[index]#-L}" ;; - esac - [ -z "$dir" ] || mkdir -p "$dir" - index=$((index+1)) - done + true } build_package_enable_shared() { @@ -1511,9 +1499,6 @@ else fi fi -export LDFLAGS="-L${PREFIX_PATH}/lib ${LDFLAGS}" -export CPPFLAGS="-I${PREFIX_PATH}/include ${CPPFLAGS}" - unset RUBYOPT unset RUBYLIB diff --git a/script/update-cruby b/script/update-cruby index ad1c18ac..0ce2b224 100755 --- a/script/update-cruby +++ b/script/update-cruby @@ -26,5 +26,5 @@ fi cat > "$file" <