From: Shaun Tancheff Date: Wed, 25 May 2022 16:46:50 +0000 (+0700) Subject: LU-15652 build: On Debian detect -common kernel headers X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=151f807d0ea970c63e7f23bd44535eb2da1d8ca1;p=fs%2Flustre-release.git LU-15652 build: On Debian detect -common kernel headers Check for a matching /usr/src/linux-headers--common/ and update the --with-linux argument accordingly. Also move LC_GLIBC_SUPPORT_COPY_FILE_RANGE outside of utils as this also breaks the dkms build on Debian with 'static' follows 'non static' declairation of copy_file_range. HPE-bug-id: LUS-10826 Test-Parameters: trivial Signed-off-by: Shaun Tancheff Change-Id: I6e4f0b27eba6c5b07cda14f064e57aa9c93ae3cc --- diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index e8122fe..c02fe4c 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -267,7 +267,6 @@ AC_ARG_WITH([linux], DEFAULT_LINUX_OBJ=$LINUX], [LINUX=$DEFAULT_LINUX]) AC_MSG_RESULT([$LINUX]) -AC_SUBST(LINUX) # -------- check for linux -------- LB_CHECK_FILE([$LINUX], [], @@ -281,8 +280,21 @@ AC_ARG_WITH([linux-obj], [LB_ARG_CANON_PATH([linux-obj], [LINUX_OBJ])], [LINUX_OBJ=$DEFAULT_LINUX_OBJ]) AC_MSG_RESULT([$LINUX_OBJ]) -AC_SUBST(LINUX_OBJ) +## -------- with linux should point to -common on Debian +AS_IF([test ${LINUX} == ${LINUX_OBJ} -a ${LINUX} == $(realpath ${LINUX})],[ + this_arch=$(realpath ${LINUX} | sed 's/-/\n/g' | tail -1) + linux_headers_common=$(realpath ${LINUX}|sed "s/-${this_arch}\$/-common/g") + AS_IF([test "${this_arch}" != common],[ + _cah="${linux_headers_common}/include/linux/compiler_attributes.h" + _cgh="${linux_headers_common}/include/linux/compiler-gcc.h" + AS_IF([test -f "${_cah}" -o -f "${_cgh}"],[ + AC_MSG_WARN([Setting LINUX to ${linux_headers_common} was ${LINUX}]) + LINUX=${linux_headers_common}]) + ]) + ]) +AC_SUBST(LINUX) +AC_SUBST(LINUX_OBJ) # -------- check for .config -------- AC_ARG_WITH([linux-config], [AC_HELP_STRING([--with-linux-config=path], diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index a643fc0..0f70cdc 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -674,12 +674,12 @@ LC_CONFIG_CLIENT LB_CONFIG_MPITESTS LB_CONFIG_SERVERS LC_CONFIG_CRYPTO +LC_GLIBC_SUPPORT_COPY_FILE_RANGE # Tests depends from utils (multiop from liblustreapi) AS_IF([test "x$enable_utils" = xno], [enable_tests="no"]) AS_IF([test "x$enable_utils" = xyes], [ - LC_GLIBC_SUPPORT_COPY_FILE_RANGE LC_OPENSSL_SSK LC_OPENSSL_GETSEPOL LC_FID2PATH_ANON_UNION