Whamcloud - gitweb
LU-10886 build: fix WARNING: modpost: missing MODULE_LICENSE()
[fs/lustre-release.git] / config / lustre-build-linux.m4
index dcee98c..8967c01 100644 (file)
@@ -210,7 +210,7 @@ AC_DEFUN([LB_ARG_CANON_PATH], [
 # Find paths for linux, handling kernel-source rpms
 #
 AC_DEFUN([LB_LINUX_PATH], [
-for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux; do
+for DEFAULT_LINUX in /lib/modules/$(uname -r)/{source,build} /usr/src/linux $(find /usr/src/kernels/ -maxdepth 1 -name @<:@0-9@:>@\* | xargs -r ls -d | tail -n 1); do
        AS_IF([readlink -q -e $DEFAULT_LINUX >/dev/null], [break])
 done
 if test "$DEFAULT_LINUX" = "/lib/modules/$(uname -r)/source"; then
@@ -501,6 +501,7 @@ config_im_$1, [
 m4_define([LB_LANG_PROGRAM],
 [
 #include <linux/kernel.h>
+#include <linux/module.h>
 $1
 int
 main (void)
@@ -510,7 +511,8 @@ dnl Don't move the `;' right after for the same reason.
 $2
   ;
   return 0;
-}])
+};
+MODULE_LICENSE("GPL");])
 
 #
 # LB_LINUX_COMPILE_IFELSE