From 24f825e2934a40811c651e8943f843a80b70f97d Mon Sep 17 00:00:00 2001 From: James Simmons Date: Sun, 26 Apr 2020 13:33:31 -0400 Subject: [PATCH] LU-12511 build: don't use OpenSFS UAPI headers with --disable-modules If we configure Lustre with --disable-modules that means we want to use the native Linux Lustre / LNet UAPI headers instead. To do this only include OpenSFS UAPI header path when Lustre modules are enabled. Change-Id: Id0f4d960d51bf02a6e24d2e3ad2544df10384533 Test-Parameters: trivial Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/38370 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Nathaniel Clark Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- config/lustre-build.m4 | 8 +++++--- lustre/utils/obd.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 947b632..4b9f9d1 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -165,8 +165,10 @@ AS_IF([test "x$enable_modules" = xyes], [ ], [*], [ # This is strange - Lustre supports a target we don't AC_MSG_ERROR([Modules are not supported on $target_os]) - ]) ]) + # Use OpenSFS UAPI header path instead of linux kernel + CPPFLAGS="-I$PWD/lnet/include/uapi -I$PWD/lustre/include/uapi $CPPFLAGS" +]) ]) # LB_CONFIG_MODULES # @@ -316,8 +318,8 @@ AS_IF([test $target_cpu = powerpc64], [ CC="$CC -m64" ]) -# UAPI headers, libcfs/include for util headers, lustre/include for liblustreapi and friends -CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/include/uapi -I$PWD/lustre/include -I$PWD/lustre/include/uapi $CPPFLAGS" +# libcfs/include for util headers, lnetconfig headers, lustre/include for liblustreapi and friends +CPPFLAGS="-I$PWD/libcfs/include -I$PWD/lnet/utils -I$PWD/lustre/include $CPPFLAGS" CCASFLAGS="-Wall -fPIC -D_GNU_SOURCE" AC_SUBST(CCASFLAGS) diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index c810f55..b57d904 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -68,7 +68,9 @@ #include #include +#ifdef HAVE_SERVER_SUPPPORT #include +#endif #include #include #include -- 1.8.3.1