4 # Copyright (C) 2001 Cluster File Systems, Inc.
6 # This code is issued under the GNU General Public License.
7 # See the file COPYING in this distribution
9 # Automake variables. Steal the version number from lustre.spec.in.
10 AM_INIT_AUTOMAKE(obd, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
16 # Check for required packages
19 AC_PATH_PROG([XML2_CONFIG], [xml2-config], [],)
20 if test -z "$XML2_CONFIG"; then
21 AC_MSG_ERROR([xml2-config not found; libxml2-dev libraries must be installed.])
23 XML2_CFLAGS=$($XML2_CONFIG --cflags)
24 XML2_LIBS=$($XML2_CONFIG --libs)
28 # Kernel build environment.
30 bindir='${exec_prefix}/usr/bin'
31 sbindir='${exec_prefix}/usr/sbin'
33 linuxdir_def=/usr/src/linux
34 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
36 LINUX=$enable_linuxdir
41 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
42 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
44 portalsdir_def='$(top_srcdir)/../portals'
45 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
46 PORTALS=$enable_portalsdir
49 AC_MSG_CHECKING(if make dep has been run in kernel source)
50 if test -f $LINUX/include/linux/config.h ; then
53 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
56 AC_MSG_CHECKING(if autoconf.h is in kernel source)
57 if test -f $LINUX/include/linux/autoconf.h ; then
60 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
64 AC_MSG_CHECKING(for Linux release)
66 dnl We need to rid ourselves of the nasty [ ] quotes.
68 LVERSION="`sed -ne 's/^VERSION[ ]*=[ ]*//gp' $LINUX/Makefile`"
69 PATCHLEVEL="`sed -ne 's/^PATCHLEVEL[ ]*=[ ]*//gp' $LINUX/Makefile`"
70 SUBLEVEL="`sed -ne 's/^SUBLEVEL[ ]*=[ ]*//gp' $LINUX/Makefile`"
71 EXTRAVERSION="`sed -ne 's/^EXTRAVERSION[ ]*=[ ]*//gp' $LINUX/Makefile`"
74 RELEASE="$LVERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
75 moduledir='$(libdir)/modules/'$RELEASE
77 AC_SUBST(EXTRAVERSION)
79 modulefsdir='$(moduledir)/fs'
82 AC_MSG_RESULT($RELEASE)
85 # Directories for documentation and demos.
86 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
89 demodir='$(docdir)/demo'
92 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
93 osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
94 tests/Makefile obdfilter/Makefile obdclass/Makefile \
95 llite/Makefile obdfs/Makefile demos/Makefile \
96 doc/Makefile scripts/Makefile scripts/lustre.spec \