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]))
15 # Kernel build environment.
17 bindir='${exec_prefix}/usr/bin'
18 sbindir='${exec_prefix}/usr/sbin'
20 linuxdir_def=/usr/src/linux
21 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
23 LINUX=$enable_linuxdir
28 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
29 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
31 portalsdir_def='$(top_srcdir)/../portals'
32 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
33 PORTALS=$enable_portalsdir
36 AC_MSG_CHECKING(if make dep has been run in kernel source)
37 if test -f $LINUX/include/linux/config.h ; then
40 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
43 AC_MSG_CHECKING(if autoconf.h is in kernel source)
44 if test -f $LINUX/include/linux/autoconf.h ; then
47 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
51 AC_MSG_CHECKING(for Linux release)
53 dnl We need to rid ourselves of the nasty [ ] quotes.
55 LVERSION="`sed -ne 's/^VERSION[ ]*=[ ]*//gp' $LINUX/Makefile`"
56 PATCHLEVEL="`sed -ne 's/^PATCHLEVEL[ ]*=[ ]*//gp' $LINUX/Makefile`"
57 SUBLEVEL="`sed -ne 's/^SUBLEVEL[ ]*=[ ]*//gp' $LINUX/Makefile`"
58 EXTRAVERSION="`sed -ne 's/^EXTRAVERSION[ ]*=[ ]*//gp' $LINUX/Makefile`"
61 RELEASE="$LVERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
62 moduledir='$(libdir)/modules/'$RELEASE
64 AC_SUBST(EXTRAVERSION)
66 modulefsdir='$(moduledir)/fs'
69 AC_MSG_RESULT($RELEASE)
72 # Directories for documentation and demos.
73 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
76 demodir='$(docdir)/demo'
79 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
80 osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
81 tests/Makefile obdfilter/Makefile obdclass/Makefile obdext2/Makefile \
82 llite/Makefile obdfs/Makefile demos/Makefile \
83 doc/Makefile scripts/Makefile scripts/lustre.spec \