Commit 11a5716d authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal Berger <michallinuxstuff@gmail.com>
Change-Id: Ifb418abf8c51fdb469a3ba52c77c71c56d708142
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12388


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1e6db5fb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)