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."
23 TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
24 if test "$TMP_VERSION" = "gcc version 2.95"; then
28 # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
29 # without "sub $0xc,%esp" to protect the stack from being
30 # stomped on by interrupts (bug 606)
31 "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
35 AC_MSG_RESULT(no known problems)
42 # Check for required packages
44 # this doesn't seem to work on older autoconf
45 # AC_CHECK_LIB(readline, readline,,)
47 AC_ARG_ENABLE(readline, [ --enable-readline use readline library],,
48 enable_readline="yes")
50 if test "$enable_readline" = "yes" ; then
51 LIBREADLINE="-lreadline -lncurses"
52 HAVE_LIBREADLINE="-DHAVE_LIBREADLINE=1"
58 AC_SUBST(HAVE_LIBREADLINE)
60 AC_ARG_ENABLE(efence, [ --enable-efence use efence library],,
63 if test "$enable_efence" = "yes" ; then
65 HAVE_LIBEFENCE="-DHAVE_LIBEFENCE=1"
71 AC_SUBST(HAVE_LIBEFENCE)
73 # XXX this should be a runtime option
74 AC_MSG_CHECKING(if you are enabling OST recovery...)
75 AC_ARG_ENABLE(ost_recovery, [ --enable-ost-recovery: enable support for ost recovery],,
76 enable_ost_recovery="no")
77 if test "$enable_ost_recovery" = "yes" ; then
78 ENABLE_OST_RECOVERY="-DOST_RECOVERY=1"
81 ENABLE_OST_RECOVERY=""
84 AC_SUBST(ENABLE_OST_RECOVERY)
87 # Kernel build environment.
89 bindir='${exec_prefix}/usr/bin'
90 sbindir='${exec_prefix}/usr/sbin'
92 linuxdir_def=/usr/src/linux
93 AC_ARG_WITH(linux, [ --with-linux=[path] set path to Linux source (default=/usr/src/linux)], enable_linuxdir=$withval)
94 AC_ARG_ENABLE(linuxdir, [ --enable-linuxdir=[path] (deprecated) set path to Linux source (default=/usr/src/linux)],, enable_linuxdir=$linuxdir_def)
96 LINUX=$enable_linuxdir
99 AC_MSG_CHECKING(if you are running linux 2.5...)
100 if test -e $LINUX/include/linux/namei.h ; then
107 AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
112 portalsdir_def='$(top_srcdir)/../portals'
113 AC_ARG_WITH(portals, [ --with-portals=[path] set path to Portals source (default=../portals)], enable_portalsdir=$withval)
114 AC_ARG_ENABLE(portalsdir, [ --enable-portalsdir=[path] (deprecated) set path to Portals source (default=$portalsdir_def],, enable_portalsdir=$portalsdir_def)
115 PORTALS=$enable_portalsdir
117 if test $PORTALS = $portalsdir_def; then
118 PORTALSLOC='../portals'
126 portalslib_def=$enable_portalsdir/linux/utils
127 AC_ARG_WITH(portalslib, [ --with-portalslib=[path] set path to Portals library (default=../portals/linux/utils)], enable_portalslib=$withval)
128 AC_ARG_ENABLE(portalslib, [ --enable-portalslib=[path] (deprecated) set path to Portals lib (default=../portals/linux/utils)],, enable_portalslib=$portalslib_def)
131 if ! test -z "$enable_portalslib"; then
132 PORTALSLIB=${enable_portalslib}
136 AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
137 AC_MSG_CHECKING(if you are building lib lustre)
138 if test "$host_cpu" = "lib"; then
140 libdir='${exec_prefix}/lib/lustre'
145 if test $host_cpu != "lib" ; then
146 KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
148 KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include'
150 CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS $ENABLE_OST_RECOVERY"
152 if test $host_cpu != "lib" ; then
153 AC_MSG_CHECKING(if make dep has been run in kernel source (host $host_cpu) )
154 if test -f $LINUX/include/linux/config.h ; then
157 AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
160 AC_MSG_CHECKING(if autoconf.h is in kernel source)
161 if test -f $LINUX/include/linux/autoconf.h ; then
164 AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
167 AC_MSG_CHECKING(for Linux release)
169 dnl We need to rid ourselves of the nasty [ ] quotes.
171 dnl Get release from version.h
172 RELEASE="`sed -ne 's/.*UTS_RELEASE[ \"]*\([0-9.a-zA-Z_-]*\).*/\1/p' $LINUX/include/linux/version.h`"
175 moduledir='$(libdir)/modules/'$RELEASE/kernel
178 modulefsdir='$(moduledir)/fs/$(PACKAGE)'
179 AC_SUBST(modulefsdir)
181 AC_MSG_RESULT($RELEASE)
185 # Directories for documentation and demos.
186 docdir='${prefix}/usr/share/doc/$(PACKAGE)'
189 demodir='$(docdir)/demo'
192 # not needed until the AC_CHECK_LIB(readline) above works
193 # AM_CONFIG_HEADER(include/config.h)
195 AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
197 lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
198 cobd/Makefile ptlbd/Makefile conf/Makefile \
199 utils/Makefile utils/lconf tests/Makefile obdfilter/Makefile \
200 obdclass/Makefile llite/Makefile doc/Makefile scripts/Makefile \
201 scripts/lustre.spec extN/Makefile, chmod +x utils/lconf)