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_WITH(linux, [ --with-linux=[path] set path to Linux source (default=/usr/src/linux)], enable_linuxdir=$withval)
41 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] (deprecated) set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
43 LINUX=$enable_linuxdir
48 AC_MSG_CHECKING(if you are running linux 2.5...)
49 if test -e $LINUX/include/linux/namei.h ; then
56 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
58 KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
59 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
61 portalsdir_def='$(top_srcdir)/../portals'
62 AC_ARG_WITH(portals, [ --with-portals=[path] set path to Portals source (default=../portals)], enable_portalsdir=$withval)
63 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] (deprecated) set path to Portals source (default=$(top_srcdir)/../portals)],, enable_portalsdir=$portalsdir_def)
64 PORTALS=$enable_portalsdir
66 if test $PORTALS = $portalsdir_def; then
67 PORTALSLOC='../portals'
75 portalslib_def=$enable_portalsdir/linux/utils
76 AC_ARG_WITH(portalslib, [ --with-portalslib=[path] set path to Portals library (default=../portals/linux/utils)], enable_portalslib=$withval)
77 AC_ARG_ENABLE(portalslib, [ --enable-portalslib=[path] (deprecated) set path to Portals lib (default=../portals/linux/utils)],, enable_portalslib=$portalslib_def)
80 if ! test -z "$enable_portalslib"; then
81 PORTALSLIB=${enable_portalslib}
87 AC_MSG_CHECKING(if make dep has been run in kernel source)
88 if test -f $LINUX/include/linux/config.h ; then
91 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
94 AC_MSG_CHECKING(if autoconf.h is in kernel source)
95 if test -f $LINUX/include/linux/autoconf.h ; then
98 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
102 AC_MSG_CHECKING(for Linux release)
104 dnl We need to rid ourselves of the nasty [ ] quotes.
106 dnl Get release from version.h
107 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
110 moduledir='$(libdir)/modules/'$RELEASE/kernel
113 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
114 AC_SUBST(modulefsdir)
116 AC_MSG_RESULT($RELEASE)
119 # Directories for documentation and demos.
120 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
123 demodir='$(docdir)/demo'
126 # not needed until the AC_CHECK_LIB(readline) above works
127 # AM_CONFIG_HEADER(include/config.h)
129 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
130 lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
131 utils/Makefile utils/lconf tests/Makefile obdfilter/Makefile \
132 obdclass/Makefile llite/Makefile doc/Makefile scripts/Makefile \
133 scripts/lustre.spec extN/Makefile, chmod +x utils/lconf)