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(lustre, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
16 # Check for required packages
18 AC_PATH_PROG([XML2_CONFIG], [xml2-config], [],)
19 if test -z "$XML2_CONFIG"; then
20 AC_MSG_ERROR([xml2-config not found; libxml2-dev libraries must be installed.])
22 XML2_CFLAGS=$($XML2_CONFIG --cflags)
23 XML2_LIBS=$($XML2_CONFIG --libs)
27 AC_CHECK_LIB(readline, readline,,-lncurses)
29 # Kernel build environment.
31 bindir='${exec_prefix}/usr/bin'
32 sbindir='${exec_prefix}/usr/sbin'
34 linuxdir_def=/usr/src/linux
35 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
37 LINUX=$enable_linuxdir
42 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
43 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
45 portalsdir_def='$(top_srcdir)/../portals'
46 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
47 PORTALS=$enable_portalsdir
50 AC_MSG_CHECKING(if make dep has been run in kernel source)
51 if test -f $LINUX/include/linux/config.h ; then
54 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
57 AC_MSG_CHECKING(if autoconf.h is in kernel source)
58 if test -f $LINUX/include/linux/autoconf.h ; then
61 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
65 AC_MSG_CHECKING(for Linux release)
67 dnl We need to rid ourselves of the nasty [ ] quotes.
69 dnl Get release from version.h
70 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
73 moduledir='$(libdir)/modules/'$RELEASE/kernel
76 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
79 AC_MSG_RESULT($RELEASE)
82 # Directories for documentation and demos.
83 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
86 demodir='$(docdir)/demo'
89 AM_CONFIG_HEADER(include/config.h)
91 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile \
92 obdecho/Makefile ptlrpc/Makefile \
93 lov/Makefile 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 \