Commit 1723a800 authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

configure: handle the assignment of non-existent and specified DIR



Change-Id: I13e270cb12c8f2796928c72338e50d30b5c8b08e
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/403260


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 7f2ff992
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -47,6 +47,15 @@ function usage()
	echo ""
}

function check_dir() {
	arg="$1"
	dir="${arg#*=}"
	if [ ! -d "$dir" ]; then
		echo "$arg: directory not found"
		exit 1
	fi
}

for i in "$@"; do
	case "$i" in
		-h|--help)
@@ -114,6 +123,7 @@ for i in "$@"; do
			CONFIG_RDMA=n
			;;
		--with-dpdk=*)
			check_dir "$i"
			CONFIG_DPDK_DIR=$(readlink -f ${i#*=})
			;;
		--without-dpdk)
@@ -130,12 +140,14 @@ for i in "$@"; do
			;;
		--with-nvml=*)
			CONFIG_NVML=y
			check_dir "$i"
			CONFIG_NVML_DIR=$(readlink -f ${i#*=})
			;;
		--without-nvml)
			CONFIG_NVML=n
			;;
		--with-fio=*)
			check_dir "$i"
			FIO_SOURCE_DIR="${i#*=}"
			CONFIG_FIO_PLUGIN=y
			;;
@@ -144,6 +156,7 @@ for i in "$@"; do
			CONFIG_FIO_PLUGIN=n
			;;
		--with-vtune=*)
			check_dir "$i"
			VTUNE_SOURCE_DIR="${i#*=}"
			CONFIG_VTUNE=y
			;;