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.
This commit is contained in:
Mislav Marohnić 2023-10-13 19:21:04 +02:00
parent 4bf2fece5e
commit 47eda17460
No known key found for this signature in database
3 changed files with 6 additions and 21 deletions

View file

@ -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