Whamcloud - gitweb
LU-2784 build: Provide RPMs build for Xeon Phi(TM) card
[fs/lustre-release.git] / config / lustre-build-linux.m4
index b08ae65..59609da 100644 (file)
@@ -70,7 +70,7 @@ fi
 AC_MSG_RESULT([$LINUXRELEASE])
 AC_SUBST(LINUXRELEASE)
 
-moduledir='/lib/modules/'$LINUXRELEASE/updates/kernel
+moduledir='$(CROSS_PATH)/lib/modules/$(LINUXRELEASE)/updates/kernel'
 AC_SUBST(moduledir)
 
 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
@@ -294,6 +294,7 @@ AC_DEFUN([LB_LINUX_SYMVERFILE],
 AC_DEFUN([LB_LINUX_CROSS],
        [AC_MSG_CHECKING([for cross compilation])
 CROSS_VARS=
+CROSS_PATH=
 case $target_vendor in
        # The K1OM architecture is an extension of the x86 architecture.
        # So, the $target_arch is x86_64.
@@ -304,7 +305,11 @@ case $target_vendor in
                        AC_MSG_ERROR([Cross compiler not found in PATH.])
                fi
                CROSS_VARS="ARCH=$target_vendor CROSS_COMPILE=x86_64-$target_vendor-linux-"
+               CROSS_PATH=${CROSS_PATH:=/opt/intel/mic/lustre/device-k1om}
                CCAS=$CC
+               # need to produce special section for debuginfo extraction
+               LDFLAGS="${LDFLAGS} -Wl,--build-id"
+               EXTRA_KLDFLAGS="${EXTRA_KLDFLAGS} -Wl,--build-id"
                if test x$enable_server = xyes ; then
                        AC_MSG_WARN([Disabling server (not supported for x86_64-$target_vendor-linux).])
                        enable_server='no'
@@ -315,6 +320,7 @@ case $target_vendor in
                ;;
 esac
 AC_SUBST(CROSS_VARS)
+AC_SUBST(CROSS_PATH)
 ])
 
 # these are like AC_TRY_COMPILE, but try to build modules against the