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 # this doesn't seem to work on older autoconf
19 # AC_CHECK_LIB(readline, readline,,)
21 AC_ARG_ENABLE(readline, [ --enable-readline use readline library],,
22 enable_readline="yes")
24 if test "$enable_readline" = "yes" ; then
25 LIBREADLINE="-lreadline -lncurses"
26 HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
32 AC_SUBST(HAVE_LIBREADLINE)
34 # Kernel build environment.
36 bindir='${exec_prefix}/usr/bin'
37 sbindir='${exec_prefix}/usr/sbin'
39 linuxdir_def=/usr/src/linux
40 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
42 LINUX=$enable_linuxdir
47 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
48 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
50 portalsdir_def='$(top_srcdir)/../portals'
51 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] set path to Portals source (default=../portals)],, enable_portalsdir=$portalsdir_def)
52 PORTALS=$enable_portalsdir
55 AC_MSG_CHECKING(if make dep has been run in kernel source)
56 if test -f $LINUX/include/linux/config.h ; then
59 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
62 AC_MSG_CHECKING(if autoconf.h is in kernel source)
63 if test -f $LINUX/include/linux/autoconf.h ; then
66 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
70 AC_MSG_CHECKING(for Linux release)
72 dnl We need to rid ourselves of the nasty [ ] quotes.
74 dnl Get release from version.h
75 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
78 moduledir='$(libdir)/modules/'$RELEASE/kernel
81 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
84 AC_MSG_RESULT($RELEASE)
87 # Directories for documentation and demos.
88 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
91 demodir='$(docdir)/demo'
94 # not needed until the AC_CHECK_LIB(readline) above works
95 # AM_CONFIG_HEADER(include/config.h)
97 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile \
98 obdecho/Makefile ptlrpc/Makefile \
99 lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
100 tests/Makefile obdfilter/Makefile obdclass/Makefile \
101 llite/Makefile obdfs/Makefile demos/Makefile \
102 doc/Makefile scripts/Makefile scripts/lustre.spec \