From 11a5716da373ab74fd651814c752c7f4e937e1d4 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 26 Apr 2022 21:22:18 +0200 Subject: [PATCH] configure: Treat ~ literal in long options as user's $HOME Also, fix the way how fio's src dir is looked up and make sure check_dir() is called before resolving the path. Fixes issue #2487 Signed-off-by: Michal Berger Change-Id: Ifb418abf8c51fdb469a3ba52c77c71c56d708142 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12388 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Reviewed-by: Tomasz Zawadzki Reviewed-by: Konrad Sztyber Reviewed-by: Ben Walker --- configure | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 08600178f..c5a45239f 100755 --- a/configure +++ b/configure @@ -128,6 +128,9 @@ declare -A CONFIG source $rootdir/CONFIG.sh rm $rootdir/CONFIG.sh +# Try to expand literal ~ that might have been passed as an option via --long-opt=~/dir. +set -- "${@//\~/~}" + for i in "$@"; do case "$i" in --cross-prefix=*) @@ -535,9 +538,10 @@ for i in "$@"; do --with-fio) ;& --with-fio=*) if [[ ${i#*=} != "$i" ]]; then - CONFIG[FIO_SOURCE_DIR]=$(readlink -f "${i#*=}") + CONFIG[FIO_SOURCE_DIR]=${i#*=} fi check_dir "--with-fio=${CONFIG[FIO_SOURCE_DIR]}" + CONFIG[FIO_SOURCE_DIR]=$(readlink -f "${CONFIG[FIO_SOURCE_DIR]}") CONFIG[FIO_PLUGIN]=y ;; --without-fio)