Commit c9b4654b authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

configure: use check_dir for FC and uring



check_dir verifies if the directory exists,
if not then exits the script printing an error.

Replaced two instances where same steps were done
explicitly.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1179bdea0630ecb1cf2f5d4cde076308145006fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15712


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 1f59abae
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -858,10 +858,7 @@ fi

if [[ "${CONFIG[FC]}" = "y" ]]; then
	if [[ -n "${CONFIG[FC_PATH]}" ]]; then
		if [ ! -d "${CONFIG[FC_PATH]}" ]; then
			echo "${CONFIG[FC_PATH]}: directory not found"
			exit 1
		fi
		check_dir "${CONFIG[FC_PATH]}"
	fi
fi

@@ -1077,10 +1074,7 @@ fi

if [[ "${CONFIG[URING]}" = "y" ]]; then
	if [[ -n "${CONFIG[URING_PATH]}" ]]; then
		if [ ! -d "${CONFIG[URING_PATH]}" ]; then
			echo "${CONFIG[URING_PATH]}: directory not found"
			exit 1
		fi
		check_dir "${CONFIG[URING_PATH]}"
	elif ! echo -e '#include <liburing.h>\nint main(void) { return 0; }\n' \
		| "${BUILD_CMD[@]}" -luring - 2> /dev/null; then
		echo "--with-uring requires liburing."