Whamcloud - gitweb
LU-2752 build: Enhance build for cross compilation for MIC
[fs/lustre-release.git] / config / lustre-build.m4
index 820b8bb..bdc0737 100644 (file)
@@ -488,6 +488,9 @@ LC_PATH_DEFAULTS
 #
 AC_DEFUN([LB_PROG_CC],
 [AC_PROG_RANLIB
+AC_CHECK_TOOL(LD, ld, [no])
+AC_CHECK_TOOL(OBJDUMP, objdump, [no])
+AC_CHECK_TOOL(STRIP, strip, [no])
 
 # ---------  unsigned long long sane? -------
 AC_CHECK_SIZEOF(unsigned long long, 0)
@@ -537,6 +540,16 @@ AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
 AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
 AM_CONDITIONAL(ARCH_x86, test x$target_cpu = "xx86_64" -o x$target_cpu = "xi686")
 
+# Sanity check for PCLMULQDQ instruction availability
+# PCLMULQDQ instruction is a new instruction available beginning with
+# the all new Core processor family based on the 32nm microarchitecture
+# codename Westmere. So, $target_cpu = x86_64 should have this instruction
+# except MIC microarchitecture (k1om).
+AM_CONDITIONAL(HAVE_PCLMULQDQ, test x$target_cpu = "xx86_64" -a x$target_vendor != "xk1om")
+if test x$target_cpu = "xx86_64" -a x$target_vendor != "xk1om" ; then
+       AC_DEFINE(HAVE_PCLMULQDQ, 1, [have PCLMULQDQ instruction])
+fi
+
 # this lets lustre cancel libsysio, per-branch or if liblustre is
 # disabled
 if test "x$LIBSYSIO_SUBDIR" = xlibsysio ; then