Whamcloud - gitweb
Distribute obdfs, put modules in /lib/modules//kernel/fs/lustre.
[fs/lustre-release.git] / lustre / configure.in
index 413c67c..98ebb06 100644 (file)
@@ -7,11 +7,25 @@ AC_CANONICAL_SYSTEM
 # See the file COPYING in this distribution
 
 # Automake variables.  Steal the version number from lustre.spec.in.
-AM_INIT_AUTOMAKE(obd, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
+AM_INIT_AUTOMAKE(lustre, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
 #AM_MAINTAINER_MODE
 AC_PROG_CC
 AC_PROG_RANLIB
 
+# 
+# Check for required packages
+
+AC_PATH_PROG([XML2_CONFIG], [xml2-config], [],)
+if test -z "$XML2_CONFIG"; then
+       AC_MSG_ERROR([xml2-config not found; libxml2-dev libraries must be installed.])
+fi
+XML2_CFLAGS=$($XML2_CONFIG --cflags)
+XML2_LIBS=$($XML2_CONFIG --libs)
+AC_SUBST(XML2_CFLAGS)
+AC_SUBST(XML2_LIBS)
+
+AC_CHECK_LIB(readline, readline)
+
 # Kernel build environment.
 ac_default_prefix=
 bindir='${exec_prefix}/usr/bin'
@@ -52,18 +66,14 @@ AC_MSG_CHECKING(for Linux release)
 
 dnl We need to rid ourselves of the nasty [ ] quotes.
 changequote(, )
-LVERSION="`sed -ne 's/^VERSION[        ]*=[    ]*//gp' $LINUX/Makefile`"
-PATCHLEVEL="`sed -ne 's/^PATCHLEVEL[   ]*=[    ]*//gp' $LINUX/Makefile`"
-SUBLEVEL="`sed -ne 's/^SUBLEVEL[       ]*=[    ]*//gp' $LINUX/Makefile`"
-EXTRAVERSION="`sed -ne 's/^EXTRAVERSION[       ]*=[    ]*//gp' $LINUX/Makefile`"
+dnl Get release from version.h
+RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
 changequote([, ])
 
-RELEASE="$LVERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
-moduledir='$(libdir)/modules/'$RELEASE
+moduledir='$(libdir)/modules/'$RELEASE/kernel
 AC_SUBST(moduledir)
-AC_SUBST(EXTRAVERSION)
 
-modulefsdir='$(moduledir)/fs'
+modulefsdir='$(moduledir)/fs/$(PACKAGE)'
 AC_SUBST(modulefsdir)
 
 AC_MSG_RESULT($RELEASE)
@@ -76,8 +86,11 @@ AC_SUBST(docdir)
 demodir='$(docdir)/demo'
 AC_SUBST(demodir)
 
-AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
-       osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
+AM_CONFIG_HEADER(include/config.h)
+
+AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile \
+         obdecho/Makefile ptlrpc/Makefile \
+       lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
        tests/Makefile obdfilter/Makefile obdclass/Makefile \
        llite/Makefile obdfs/Makefile demos/Makefile \
        doc/Makefile scripts/Makefile scripts/lustre.spec \