From a699a430d920eb68a0634260b387ca91eafcf3df Mon Sep 17 00:00:00 2001
From: manoj <manoj>
Date: Mon, 20 Aug 2007 19:40:32 +0000
Subject: [PATCH] b=11879 r=alex

New switch --with-dmu added to accomodate linking to a zfs dmu
---
 build/autoconf/lustre-build.m4 | 48 +++++++++++++++++++++++++++++++++-
 ldiskfs/configure.ac           | 24 ++++++++++++++++-
 2 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4
index 37634e2750..2edc236c8a 100644
--- a/build/autoconf/lustre-build.m4
+++ b/build/autoconf/lustre-build.m4
@@ -22,7 +22,9 @@ AC_DEFUN([LB_CANONICAL_SYSTEM],
 	darwin*)
 		lb_target_os="darwin"
 		;;
-esac
+	solaris2.11*)
+		lb_target_os="SunOS"
+		;;esac
 AC_SUBST(lb_target_os)
 ])
 
@@ -110,6 +112,26 @@ fi
 ])
 ])
 
+#
+# LB_PATH_DMU
+# Support for --with-dmu
+#
+AC_DEFUN([LB_PATH_DMU],
+[AC_ARG_WITH([dmu],
+	AC_HELP_STRING([--with-dmu=path],
+		       [set path to a built dmu]),
+	[
+		DMU_SRC=$with_dmu
+		dmu=true
+	],
+	[
+		dmu=false
+		DMU_SRC=""
+	])
+AM_CONDITIONAL([ENABLE_DMU], [test x$dmu = xtrue])
+AC_SUBST(DMU_SRC)
+])
+
 #
 # LB_PATH_LIBSYSIO
 #
@@ -254,6 +276,26 @@ if test x$enable_bgl != xno; then
 fi
 ])
 
+
+#
+# LB_CONFIG_UOSS
+#
+#
+AC_DEFUN([LB_CONFIG_UOSS],
+[AC_MSG_CHECKING([whether to build user-level oss])
+AC_ARG_ENABLE([uoss],
+	AC_HELP_STRING([--enable-uoss],
+			[enable building of user-level oss]),
+	[enable_uoss='yes'],[enable_uoss='no'])
+if test x$enable_uoss != xno; then
+        AC_DEFINE(UOSS_SUPPORT, 1, Enable user-level OSS)
+        AC_DEFINE(LUSTRE_ULEVEL_MT, 1, Multi-threaded user-level lustre port)
+	enable_ulevel_mt='yes'
+        enable_modules='no'
+fi
+])
+
+
 #
 # LB_PATH_SNMP
 #
@@ -512,6 +554,7 @@ AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1")
 AM_CONDITIONAL(LINUX, test x$lb_target_os = "xlinux")
 AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin")
 AM_CONDITIONAL(CRAY_XT3, test x$enable_cray_xt3 = "xyes")
+AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
 
 # this lets lustre cancel libsysio, per-branch or if liblustre is
 # disabled
@@ -575,6 +618,9 @@ LN_CONFIG_CDEBUG
 
 LB_CONFIG_MODULES
 
+LB_PATH_DMU
+LB_CONFIG_UOSS
+
 LB_PATH_LIBSYSIO
 LB_PATH_SNMP
 LB_PATH_LDISKFS
diff --git a/ldiskfs/configure.ac b/ldiskfs/configure.ac
index 7adc1446de..b004238316 100644
--- a/ldiskfs/configure.ac
+++ b/ldiskfs/configure.ac
@@ -16,12 +16,34 @@ LB_CANONICAL_SYSTEM
 LB_INCLUDE_RULES
 LB_PROG_CC
 
+
+#
+# LC_TARGET_SUPPORTED
+#
+# is the target os supported?
+#
+AC_DEFUN([LC_TARGET_SUPPORTED],
+[case $target_os in
+	linux* | darwin*)
+$1
+		;;
+	*)
+$2
+		;;
+esac
+])
+
+
 AC_MSG_CHECKING([whether to build kernel modules])
 AC_ARG_ENABLE([modules],
 	AC_HELP_STRING([--disable-modules],
 			[disable building of Lustre kernel modules]),
 	[],[
-		enable_modules='yes'
+		LC_TARGET_SUPPORTED([
+			enable_modules='yes'
+		],[
+			enable_modules='no'
+		])
 	])
 AC_MSG_RESULT([$enable_modules])
 
-- 
GitLab