AC_INIT
AC_CANONICAL_SYSTEM
-# Copyright (C) 2001 Cluster File Systems, Inc.
+# Copyright (C) 2001-2003 Cluster File Systems, Inc.
#
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
# Automake variables. Steal the version number from lustre.spec.in.
AM_INIT_AUTOMAKE(lustre, builtin([esyscmd], [sed -ne '/^%define version /{ s/.*version //; p; q; }' scripts/lustre.spec.in]))
#AM_MAINTAINER_MODE
+
AC_PROG_CC
+AC_MSG_CHECKING(for buggy compiler)
+CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"`
+bad_cc() {
+ echo
+ echo " '$CC_VERSION'"
+ echo " has been known to generate bad code, "
+ echo " please get an updated compiler."
+ AC_MSG_ERROR(sorry)
+}
+TMP_VERSION=`echo $CC_VERSION | cut -c 1-16`
+if test "$TMP_VERSION" = "gcc version 2.95"; then
+ bad_cc
+fi
+case "$CC_VERSION" in
+ # ost_pack_niobuf putting 64bit NTOH temporaries on the stack
+ # without "sub $0xc,%esp" to protect the stack from being
+ # stomped on by interrupts (bug 606)
+ "gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)")
+ bad_cc
+ ;;
+ *)
+ AC_MSG_RESULT(no known problems)
+ ;;
+esac
+
AC_PROG_RANLIB
#
AC_SUBST(LIBREADLINE)
AC_SUBST(HAVE_LIBREADLINE)
+# XXX this should be a runtime option
+AC_ARG_ENABLE(ost_recovery, [ --enable-ost-recovery: enable support for ost recovery],,
+ enable_ost_recovery="yes")
+if test "$enable_ost_recovery" = "yes" ; then
+ ENABLE_OST_RECOVERY="-DOST_RECOVERY=1"
+else
+ HAVE_LIBREADLINE=""
+fi
+AC_SUBST(ENABLE_OST_RECOVERY)
+
+
# Kernel build environment.
ac_default_prefix=
bindir='${exec_prefix}/usr/bin'
LINUX=$enable_linuxdir
AC_SUBST(LINUX)
-sinclude(archdep.m4)
-
AC_MSG_CHECKING(if you are running linux 2.5...)
if test -e $LINUX/include/linux/namei.h ; then
- linux25=yes
+ linux25="yes"
AC_MSG_RESULT(yes)
else
- linux25=no
+ linux25="no"
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(LINUX25, test x$linux25 = xyes)
-KINCFLAGS='-I. -I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
-CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
+sinclude(archdep.m4)
+
portalsdir_def='$(top_srcdir)/../portals'
AC_ARG_WITH(portals, [ --with-portals=[path] set path to Portals source (default=../portals)], enable_portalsdir=$withval)
if ! test -z "$enable_portalslib"; then
PORTALSLIB=${enable_portalslib}
fi
+AC_SUBST(PORTALSLIB)
+AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
+AC_MSG_CHECKING(if you are building lib lustre)
+if test "$host_cpu" = "lib"; then
+ AC_MSG_RESULT(yes)
+ libdir='${exec_prefix}/lib/lustre'
+else
+ AC_MSG_RESULT(no)
+fi
-AC_SUBST(PORTALSLIB)
+if test $host_cpu != "lib" ; then
+KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include -I$(LINUX)/include'
+else
+KINCFLAGS='-I$(top_srcdir)/include -I$(PORTALS)/include'
+fi
+CPPFLAGS="$KINCFLAGS $ARCHCPPFLAGS"
-AC_MSG_CHECKING(if make dep has been run in kernel source)
-if test -f $LINUX/include/linux/config.h ; then
+if test $host_cpu != "lib" ; then
+AC_MSG_CHECKING(if make dep has been run in kernel source (host $host_cpu) )
+if test -f $LINUX/include/linux/config.h ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR(** cannot find $LINUX/include/linux/config.h. Run make dep in $LINUX.)
AC_MSG_ERROR(** cannot find $LINUX/include/linux/autoconf.h. Run make config in $LINUX.)
fi
-
AC_MSG_CHECKING(for Linux release)
dnl We need to rid ourselves of the nasty [ ] quotes.
AC_MSG_RESULT($RELEASE)
AC_SUBST(RELEASE)
+fi
# Directories for documentation and demos.
docdir='${prefix}/usr/share/doc/$(PACKAGE)'
AC_SUBST(docdir)
# AM_CONFIG_HEADER(include/config.h)
AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
+ liblustre/Makefile \
lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
cobd/Makefile ptlbd/Makefile conf/Makefile \
utils/Makefile utils/lconf tests/Makefile obdfilter/Makefile \