4 # Copyright (C) 2001-2003 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]))
14 AC_MSG_CHECKING(for buggy compiler)
15 CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
19 echo " has been known to generate bad code, "
20 echo " please get an updated compiler."
24 # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
25 # without "sub $0xc,%esp" to protect the stack from being
26 # stomped on by interrupts (bug 606)
27 "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
31 AC_MSG_RESULT(no known problems)
38 # Check for required packages
40 # this doesn't seem to work on older autoconf
41 # AC_CHECK_LIB(readline, readline,,)
43 AC_ARG_ENABLE(readline, [ --enable-readline use readline library],,
44 enable_readline="yes")
46 if test "$enable_readline" = "yes" ; then
47 LIBREADLINE="-lreadline -lncurses"
48 HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
54 AC_SUBST(HAVE_LIBREADLINE)
56 # Kernel build environment.
58 bindir='${exec_prefix}/usr/bin'
59 sbindir='${exec_prefix}/usr/sbin'
61 linuxdir_def=/usr/src/linux
62 AC_ARG_WITH(linux, [ --with-linux=[path] set path to Linux source (default=/usr/src/linux)], enable_linuxdir=$withval)
63 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] (deprecated) set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
65 LINUX=$enable_linuxdir
70 AC_MSG_CHECKING(if you are running linux 2.5...)
71 if test -e $LINUX/include/linux/namei.h ; then
78 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
80 # Changed by Amrut Joshi on 01/13/2003
81 #KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
82 KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
83 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
85 portalsdir_def='$(top_srcdir)/../portals'
86 AC_ARG_WITH(portals, [ --with-portals=[path] set path to Portals source (default=../portals)], enable_portalsdir=$withval)
87 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] (deprecated) set path to Portals source (default=$portalsdir_def],, enable_portalsdir=$portalsdir_def)
88 PORTALS=$enable_portalsdir
90 if test $PORTALS = $portalsdir_def; then
91 PORTALSLOC='../portals'
99 portalslib_def=$enable_portalsdir/linux/utils
100 AC_ARG_WITH(portalslib, [ --with-portalslib=[path] set path to Portals library (default=../portals/linux/utils)], enable_portalslib=$withval)
101 AC_ARG_ENABLE(portalslib, [ --enable-portalslib=[path] (deprecated) set path to Portals lib (default=../portals/linux/utils)],, enable_portalslib=$portalslib_def)
104 if ! test -z "$enable_portalslib"; then
105 PORTALSLIB=${enable_portalslib}
111 AC_MSG_CHECKING(if make dep has been run in kernel source)
112 if test -f $LINUX/include/linux/config.h ; then
115 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
118 AC_MSG_CHECKING(if autoconf.h is in kernel source)
119 if test -f $LINUX/include/linux/autoconf.h ; then
122 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
126 AC_MSG_CHECKING(for Linux release)
128 dnl We need to rid ourselves of the nasty [ ] quotes.
130 dnl Get release from version.h
131 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z-]*\).*/\1/p' $LINUX/include/linux/version.h`"
134 moduledir='$(libdir)/modules/'$RELEASE/kernel
137 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
138 AC_SUBST(modulefsdir)
140 AC_MSG_RESULT($RELEASE)
143 # Directories for documentation and demos.
144 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
147 demodir='$(docdir)/demo'
150 # not needed until the AC_CHECK_LIB(readline) above works
151 # AM_CONFIG_HEADER(include/config.h)
153 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
154 lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
155 cobd/Makefile ptlbd/Makefile conf/Makefile \
156 utils/Makefile utils/lconf tests/Makefile obdfilter/Makefile \
157 obdclass/Makefile llite/Makefile doc/Makefile scripts/Makefile \
158 scripts/lustre.spec extN/Makefile, chmod +x utils/lconf)