Whamcloud - gitweb
add autoconf dirs to build
authorjacob <jacob>
Thu, 9 Dec 2004 22:14:36 +0000 (22:14 +0000)
committerjacob <jacob>
Thu, 9 Dec 2004 22:14:36 +0000 (22:14 +0000)
build/autoconf/Makefile.am [new file with mode: 0644]
build/autoconf/lustre-build-linux.m4
build/autoconf/lustre-build.m4

diff --git a/build/autoconf/Makefile.am b/build/autoconf/Makefile.am
new file mode 100644 (file)
index 0000000..d3fd6c4
--- /dev/null
@@ -0,0 +1,2 @@
+EXTRA_DIST := lustre-build.mv lustre-build-darwin.mv lustre-build-linux.m4
+
index 4cea9d6..301babd 100644 (file)
@@ -66,6 +66,55 @@ AC_SUBST(KMODEXT)
 ])
 
 #
+# LB_LINUX_RELEASE
+#
+# get the release version of linux
+#
+AC_DEFUN([LB_LINUX_RELEASE],
+[LINUXRELEASE=
+rm -f build/conftest.i
+AC_MSG_CHECKING([for Linux release])
+LB_LINUX_TRY_MAKE([
+       #include <linux/version.h>
+],[
+       char *LINUXRELEASE;
+       LINUXRELEASE=UTS_RELEASE;
+],[
+       $makerule LUSTRE_KERNEL_TEST=conftest.i
+],[
+       test -s build/conftest.i
+],[
+       # LINUXRELEASE="UTS_RELEASE"
+       eval $(grep "LINUXRELEASE=" build/conftest.i)
+],[
+       AC_MSG_RESULT([unknown])
+       AC_MSG_ERROR([Could not preprocess test program.  Consult config.log for details.])
+])
+rm -f build/conftest.i
+if test x$LINUXRELEASE = x ; then
+       AC_MSG_RESULT([unknown])
+       AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.])
+fi
+AC_MSG_RESULT([$LINUXRELEASE])
+AC_SUBST(LINUXRELEASE)
+
+moduledir='/lib/modules/'$LINUXRELEASE/kernel
+AC_SUBST(moduledir)
+
+modulefsdir='$(moduledir)/fs/$(PACKAGE)'
+AC_SUBST(modulefsdir)
+
+modulenetdir='$(moduledir)/net/$(PACKAGE)'
+AC_SUBST(modulenetdir)
+
+# ------------ RELEASE --------------------------------
+AC_MSG_CHECKING([for Lustre release])
+RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`"
+AC_MSG_RESULT($RELEASE)
+AC_SUBST(RELEASE)
+])
+
+#
 # LB_LINUX_PATH
 #
 # Find paths for linux, handling kernel-source rpms
@@ -152,6 +201,8 @@ LB_LINUX_TRY_COMPILE([],[],[
        AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult README.kernel-source])
        AC_MSG_ERROR([Kernel modules could not be built.])
 ])
+
+LB_LINUX_RELEASE
 ])
 
 #
index fefa9d8..3d9afdd 100644 (file)
@@ -264,6 +264,9 @@ AC_SUBST(sysconfdir)
 # Directories for documentation and demos.
 docdir='${datadir}/doc/$(PACKAGE)'
 AC_SUBST(docdir)
+
+LP_PATH_DEFAULTS
+LC_PATH_DEFAULTS
 ])
 
 #
@@ -366,7 +369,10 @@ LB_CONFIG_TESTS
 
 LB_CONFIG_MODULES
 
-LB_CONFIG_LIBLUSTRE
+LC_CONFIG_LIBLUSTRE
+
+LP_CONFIGURE
+LC_CONFIGURE
 
 LB_CONDITIONALS
 LB_CONFIG_HEADERS
@@ -375,6 +381,7 @@ AC_CONFIG_FILES(
 [Makefile:build/Makefile.in.toplevel]
 [autoMakefile
 build/autoMakefile
+build/autoconf/Makefile
 build/Rules
 build/lustre.spec
 ])