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

configure: don't assume /usr/include/ is the header location



It doesn't have to be. In order to check if the system
header is available we'll now to try to compile a C program
that includes it.

Change-Id: Ie46c20dab5e96da746650bba1d5dbd0fc32ecec9
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453561


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 788c1677
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ declare -A CONFIG
source CONFIG.sh
rm CONFIG.sh

BUILD_CMD="${CC:-cc} -o /dev/null -x c $CPPFLAGS $CFLAGS $LDFLAGS"

function check_dir() {
	arg="$1"
@@ -471,7 +472,8 @@ if [[ "${CONFIG[ISAL]}" = "y" ]]; then
fi

if [[ "${CONFIG[REDUCE]}" = "y" ]]; then
	if [ ! -f /usr/include/libpmem.h ]; then
	if ! echo -e '#include <libpmem.h>\nint main(void) { return 0; }\n' \
		| $BUILD_CMD -lpmem - 2>/dev/null; then
		echo --with-reduce requires libpmem.
		echo Please install then re-run this script.
		exit 1