Commit 3674c1d3 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

configure: fail --with-asan if it's not available

parent 02406e56
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -529,6 +529,33 @@ if [[ "${CONFIG[LOG_BACKTRACE]}" = "y" ]]; then
	fi
fi

if [[ "${CONFIG[ASAN]}" = "y" ]]; then
	if ! echo -e 'int main(void) { return 0; }\n' \
		| $BUILD_CMD -fsanitize=address - 2>/dev/null; then
		echo --enable-asan requires libasan.
		echo Please install then re-run this script.
		exit 1
	fi
fi

if [[ "${CONFIG[UBSAN]}" = "y" ]]; then
	if ! echo -e 'int main(void) { return 0; }\n' \
		| $BUILD_CMD -fsanitize=undefined - 2>/dev/null; then
		echo --enable-ubsan requires libubsan.
		echo Please install then re-run this script.
		exit 1
	fi
fi

if [[ "${CONFIG[TSAN]}" = "y" ]]; then
	if ! echo -e 'int main(void) { return 0; }\n' \
		| $BUILD_CMD -fsanitize=thread - 2>/dev/null; then
		echo --enable-tsan requires libtsan.
		echo Please install then re-run this script.
		exit 1
	fi
fi

if [[ "${CONFIG[OCF]}" = "y" ]]; then
	# If OCF_PATH is a file, assume it is a library and use it to compile with
	if [ -f ${CONFIG[OCF_PATH]} ]; then