From bd222051df1240f77f4b0f24bd809812b9357867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 16 Nov 2015 11:07:18 +0100 Subject: [PATCH] Allow space-separated LDFLAGS arguments Fixes #829, closes #830 --- bin/ruby-build | 13 +++++++++---- test/build.bats | 13 +++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/bin/ruby-build b/bin/ruby-build index 43376d4d..d590f111 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -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 } diff --git a/test/build.bats b/test/build.bats index 76425a71..a3c65e84 100644 --- a/test/build.bats +++ b/test/build.bats @@ -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 <