Allow space-separated LDFLAGS arguments

Fixes #829, closes #830
This commit is contained in:
Mislav Marohnić 2015-11-16 11:07:18 +01:00
parent f174d58c04
commit bd222051df
2 changed files with 22 additions and 4 deletions

View file

@ -969,11 +969,16 @@ build_package_verify_openssl() {
# Ensure that directories listed in LDFLAGS exist
build_package_ldflags_dirs() {
local arg
for arg in $LDFLAGS; do
case "$arg" in
-L* ) mkdir -p "${arg#-L}" ;;
local arg dir
set - $LDFLAGS
while [ $# -gt 0 ]; do
dir=""
case "$1" in
-L ) dir="$2" ;;
-L* ) dir="${1#-L}" ;;
esac
[ -z "$dir" ] || mkdir -p "$dir"
shift 1
done
}

View file

@ -630,3 +630,16 @@ DEF
run ruby-build "${TMP}/build-definition" "$INSTALL_ROOT"
assert_failure "ruby-build: TMPDIR=$TMPDIR is set to a non-accessible location"
}
@test "initializes LDFLAGS directories" {
cached_tarball "ruby-2.0.0"
export LDFLAGS="-L ${BATS_TEST_DIRNAME}/what/evs"
run_inline_definition <<DEF
install_package "ruby-2.0.0" "http://ruby-lang.org/ruby/2.0/ruby-2.0.0.tar.gz" ldflags_dirs
DEF
assert_success
assert [ -d "${INSTALL_ROOT}/lib" ]
assert [ -d "${BATS_TEST_DIRNAME}/what/evs" ]
}