Commit 9d2f6f86 authored by Jim Harris's avatar Jim Harris
Browse files

configure: wait to configure ISA-L until all deps are checked



Configuring ISA-L takes a bit of time, so it is better
to check dependencies early and bail, rather than
waiting 10-15 seconds to configure ISA-L, only to then
fail because some dependency isn't found.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I864a941df6517381761c9d4db58e2364c1776e4d

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7541


Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent e04da24c
Loading
Loading
Loading
Loading
+21 −21
Original line number Diff line number Diff line
@@ -678,27 +678,6 @@ if [[ "${CONFIG[ISAL]}" = "y" ]] || [[ "${CONFIG[CRYPTO]}" = "y" ]]; then
	fi
fi

if [[ "${CONFIG[ISAL]}" = "y" ]]; then
	if [ ! -f "$rootdir"/isa-l/autogen.sh ]; then
		echo "ISA-L was not found; To install ISA-L run:"
		echo "  git submodule update --init"
		exit 1
	fi

	cd $rootdir/isa-l
	ISAL_LOG=$rootdir/isa-l/spdk-isal.log
	if [[ -n "${CONFIG[CROSS_PREFIX]}" ]]; then
		ISAL_OPTS=("--host=${CONFIG[CROSS_PREFIX]}")
	else
		ISAL_OPTS=()
	fi
	echo -n "Configuring ISA-L (logfile: $ISAL_LOG)..."
	./autogen.sh &> $ISAL_LOG
	./configure CFLAGS="-fPIC -g -O2" "${ISAL_OPTS[@]}" --enable-shared=no >> $ISAL_LOG 2>&1
	echo "done."
	cd $rootdir
fi

if [[ "${CONFIG[PMDK]}" = "y" ]]; then
	if ! echo -e '#include <libpmemblk.h>\nint main(void) { return 0; }\n' \
		| "${BUILD_CMD[@]}" -lpmemblk - 2> /dev/null; then
@@ -825,6 +804,27 @@ if [ "${CONFIG[CET]}" = "y" ]; then
	fi
fi

if [[ "${CONFIG[ISAL]}" = "y" ]]; then
	if [ ! -f "$rootdir"/isa-l/autogen.sh ]; then
		echo "ISA-L was not found; To install ISA-L run:"
		echo "  git submodule update --init"
		exit 1
	fi

	cd $rootdir/isa-l
	ISAL_LOG=$rootdir/isa-l/spdk-isal.log
	if [[ -n "${CONFIG[CROSS_PREFIX]}" ]]; then
		ISAL_OPTS=("--host=${CONFIG[CROSS_PREFIX]}")
	else
		ISAL_OPTS=()
	fi
	echo -n "Configuring ISA-L (logfile: $ISAL_LOG)..."
	./autogen.sh &> $ISAL_LOG
	./configure CFLAGS="-fPIC -g -O2" "${ISAL_OPTS[@]}" --enable-shared=no >> $ISAL_LOG 2>&1
	echo "done."
	cd $rootdir
fi

# We are now ready to generate final configuration. But first do sanity
# check to see if all keys in CONFIG array have its reflection in CONFIG file.
if (($(grep -cE "^\s*CONFIG_[[:alnum:]_]+=" "$rootdir/CONFIG") != ${#CONFIG[@]})); then