Whamcloud - gitweb
LU-5614 build: use %kernel_module_package in rpm spec
[fs/lustre-release.git] / config / lustre-build-linux.m4
index a780455..cde8aaf 100644 (file)
@@ -107,19 +107,19 @@ AC_MSG_CHECKING([for Linux kernel module package directory])
 AC_ARG_WITH([kmp-moddir],
        AC_HELP_STRING([--with-kmp-moddir=string],
                [set the kmod updates or extra directory]),
-       [KMP_MODDIR=$withval],[
-       AS_IF([test x$RHEL_KERNEL = xyes], [KMP_MODDIR="extra"],
-             [test x$SUSE_KERNEL = xyes], [KMP_MODDIR="updates"])])
+       [KMP_MODDIR=$withval
+        IN_KERNEL=''],[
+       AS_IF([test x$RHEL_KERNEL = xyes], [KMP_MODDIR="extra/kernel"],
+             [test x$SUSE_KERNEL = xyes], [KMP_MODDIR="updates/kernel"])
+       IN_KERNEL="${PACKAGE}"])
 AC_MSG_RESULT($KMP_MODDIR)
-AC_SUBST(KMP_MODDIR)
 
-moduledir='/lib/modules/$(LINUXRELEASE)/$(KMP_MODDIR)/kernel'
-AC_SUBST(moduledir)
+moduledir="/lib/modules/${LINUXRELEASE}/${KMP_MODDIR}"
 
-modulefsdir='$(moduledir)/fs/$(PACKAGE)'
+modulefsdir="${moduledir}/fs/${IN_KERNEL}"
 AC_SUBST(modulefsdir)
 
-modulenetdir='$(moduledir)/net/$(PACKAGE)'
+modulenetdir="${moduledir}/net/${IN_KERNEL}"
 AC_SUBST(modulenetdir)
 ])