From 2ec4f8cc2c890edcd2199c92113438c8584b78b7 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 2 Dec 2004 16:34:59 +0000 Subject: [PATCH] blah blah blah --- .cvsignore | 32 ++++ ChangeLog | 1 + README | 0 README.lustrecvs | 5 + autoMakefile.am | 57 ++++++ autogen.sh | 98 ++++++++++ build/.cvsignore | 8 + build/Makefile | 47 +++++ build/Rules.in | 46 +++++ build/autoMakefile.am | 1 + build/build.ac | 437 ++++++++++++++++++++++++++++++++++++++++++ configure.ac | 45 +++++ lustrecvs | 83 ++++++++ 13 files changed, 860 insertions(+) create mode 100644 .cvsignore create mode 100644 ChangeLog create mode 100644 README create mode 100644 README.lustrecvs create mode 100644 autoMakefile.am create mode 100644 autogen.sh create mode 100644 build/.cvsignore create mode 100644 build/Makefile create mode 100644 build/Rules.in create mode 100644 build/autoMakefile.am create mode 100644 build/build.ac create mode 100644 configure.ac create mode 100755 lustrecvs diff --git a/.cvsignore b/.cvsignore new file mode 100644 index 0000000000..bb3bc999b9 --- /dev/null +++ b/.cvsignore @@ -0,0 +1,32 @@ +.Xrefs +.Xrefs-2.5 +aclocal.m4 +config.log +config.status +config.cache +config.guess +config.sub +configure +Makefile +autoMakefile +autoMakefile.in +.deps +tags +TAGS +lustre*.tar.gz +cscope.files +cscope.out +autom4te-2.53.cache +autom4te.cache +depcomp +compile +.*.cmd +.mergeinfo-* +Rules +missing +mkinstalldirs +install-sh +.depend +.tmp_versions +config.h +config.h.in diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000000..e50f1e3937 --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +Please see portals/ChangeLog and lustre/ChangeLog. diff --git a/README b/README new file mode 100644 index 0000000000..e69de29bb2 diff --git a/README.lustrecvs b/README.lustrecvs new file mode 100644 index 0000000000..88dcc12697 --- /dev/null +++ b/README.lustrecvs @@ -0,0 +1,5 @@ +To check out Lustre: + +./lustrecvs co + +For a list of branches, please see the branch table in lustrecvs. diff --git a/autoMakefile.am b/autoMakefile.am new file mode 100644 index 0000000000..884b636b2c --- /dev/null +++ b/autoMakefile.am @@ -0,0 +1,57 @@ +SUBDIRS := . build portals lustre + +# these empty rules are needed so that automake doesn't add its own +# recursive rules +etags-recursive: + +ctags-recursive: + +tags-recursive: + +TAGS: + +tags: + rm -f $(top_srcdir)/TAGS + ETAGSF=`etags --version | grep -iq exuberant && \ + echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \ + find $(top_srcdir) -name '*.[hc]' | xargs etags $$ETAGSF -a + + rm -f $(top_srcdir)/tags + CTAGSF=`ctags --version | grep -iq exuberant && \ + echo "-I __initdata,__exitdata,EXPORT_SYMBOL"`; \ + find $(top_srcdir) -name '*.[hc]' | xargs ctags $$CTAGSF -a + +if MODULES +all-am: modules + +all-sources: + $(MAKE) sources -C portals + $(MAKE) sources -C lustre + +if !LINUX25 +DEP = dep +dep: .depend + +.depend: all-sources + $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \ + -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \ + -o scripts -o include/config/MARKER _sfdep_$(PWD) \ + _FASTDEP_ALL_SUB_DIRS="$(PWD)" + +CLEANFILES = .depend +endif + +modules: $(DEP) all-sources + $(MAKE) $(ARCH_UM) CC="$(CC)" -C $(LINUX_OBJ) \ + -f $(PWD)/build/Makefile LUSTRE_LINUX_CONFIG=$(LINUX_CONFIG) \ + $(MODULE_TARGET)=$(PWD) -o tmp_include_depends -o scripts -o \ + include/config/MARKER $@ + +endif # MODULES + +dist-hook: + find $(distdir) -name .deps | xargs rm -rf + find $(distdir) -name CVS | xargs rm -rf + +rpms: dist Makefile + rpmbuild -ta $(distdir).tar.gz diff --git a/autogen.sh b/autogen.sh new file mode 100644 index 0000000000..d8ccf52fe4 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# taken from gnome-common/macros2/autogen.sh +compare_versions() { + ch_min_version=$1 + ch_actual_version=$2 + ch_status=0 + IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." + set $ch_actual_version + for ch_min in $ch_min_version; do + ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes + if [ -z "$ch_min" ]; then break; fi + if [ -z "$ch_cur" ]; then ch_status=1; break; fi + if [ $ch_cur -gt $ch_min ]; then break; fi + if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi + done + IFS="$ch_save_IFS" + return $ch_status +} + +error_msg() { + echo "$cmd is $1. version $required is required to build Lustre." + + if [ -e /usr/lib/autolustre/bin/$cmd ]; then + cat >&2 <<-EOF + You apparently already have Lustre-specific autoconf/make RPMs + installed on your system at /usr/lib/autolustre/share/$cmd. + Please set your PATH to point to those versions: + + export PATH="/usr/lib/autolustre/bin:\$PATH" + EOF + else + cat >&2 <<-EOF + CFS provides RPMs which can be installed alongside your + existing autoconf/make RPMs, if you are nervous about + upgrading. See + + ftp://ftp.lustre.org/pub/other/autolustre/README.autolustre + + You may be able to download newer version from: + + http://ftp.gnu.org/gnu/$cmd/$cmd-$required.tar.gz + EOF + fi + [ "$cmd" = "autoconf" -a "$required" = "2.57" ] && cat >&2 <&2 </dev/null ; then + error_msg "missing" + fi + version=$($cmd --version | awk "BEGIN { IGNORECASE=1 } /$tool \(GNU $tool\)/ { print \$4 }") + echo "found $version" + if ! compare_versions "$required" "$version" ; then + error_msg "too old" + fi +} + +echo "Checking for a complete tree..." +if ! [ -d build -a -d portals -a -d lustre ] ; then + cat >&2 < +# -objs := file1.o file2.o file3.o +# @INCLUDE_RULES@ +# +# and autoMakefile.am: +# +# if LIBLUSTRE +# +# endif +# +# if MODULES +# modulefs_DATA = $(KMODEXT) +# endif +# +# DIST_SOURCES = $(-objs:.o=.c) +# MOSTLYCLEANFILES = *.o *.ko *.mod.c + +ifeq ($(PATCHLEVEL),) + +include autoMakefile + +else + +include @LINUX_CONFIG@ + +EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS) +EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @UML_CFLAGS@ +EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS) + +obj-m := $(patsubst %,%.o,$(MODULES)) + +ifeq ($(PATCHLEVEL),4) +# 2.4 rules +O_TARGET := $(firstword $(obj-m)) +obj-y := $($(firstword $(MODULES))-objs) +export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m)) +include $(TOPDIR)/Rules.make +$(MODINCL)/%.ver: %.c + @true +endif # PATCHLEVEL + +endif # KERNELRELEASE diff --git a/build/autoMakefile.am b/build/autoMakefile.am new file mode 100644 index 0000000000..97b8d0788c --- /dev/null +++ b/build/autoMakefile.am @@ -0,0 +1 @@ +EXTRA_DIST := Makefile diff --git a/build/build.ac b/build/build.ac new file mode 100644 index 0000000000..1412ef19f1 --- /dev/null +++ b/build/build.ac @@ -0,0 +1,437 @@ +# Four main targets: lustre kernel modules, utilities, tests, and liblustre +AC_MSG_CHECKING([whether to build kernel modules]) +AC_ARG_ENABLE([modules], + AC_HELP_STRING([--disable-modules], + [disable building of Lustre kernel modules]), + [],[enable_modules='yes']) +AC_MSG_RESULT([$enable_modules]) +AM_CONDITIONAL(MODULES, test x$enable_modules = xyes) + +AC_MSG_CHECKING([whether to build utilities]) +AC_ARG_ENABLE([utils], + AC_HELP_STRING([--disable-utils], + [disable building of Lustre utility programs]), + [],[enable_utils='yes']) +AC_MSG_RESULT([$enable_utils]) + +AC_MSG_CHECKING([whether to build Lustre tests]) +AC_ARG_ENABLE([tests], + AC_HELP_STRING([--disable-tests], + [disable building of Lustre tests]), + [],[enable_tests='yes']) +AC_MSG_RESULT([$enable_tests]) + +# specify wether to build doc or not +AC_MSG_CHECKING([whether to build docs]) +AC_ARG_ENABLE(doc, + AC_HELP_STRING([--disable-doc], + [skip creation of pdf documentation]), + [ + if test x$enable_doc = xyes ; then + ENABLE_DOC=1 + else + ENABLE_DOC=0 + fi + ],[ + ENABLE_DOC=0 + enable_doc='no' + ]) +AC_MSG_RESULT([$enable_doc]) +AM_CONDITIONAL(DOC, test x$ENABLE_DOC = x1) +AC_SUBST(ENABLE_DOC) + +# we need to pass a full path here for kernel makefiles +INCLUDE_RULES="include $PWD/build/Rules" +AC_SUBST(INCLUDE_RULES) + +# directories for binaries +AC_PREFIX_DEFAULT([/usr]) + +sysconfdir='/etc' +AC_SUBST(sysconfdir) + +# Directories for documentation and demos. +docdir='${datadir}/doc/$(PACKAGE)' +AC_SUBST(docdir) + +# ---------- BAD gcc? ------------ +AC_PROG_RANLIB +AC_PROG_CC +AC_MSG_CHECKING([for buggy compiler]) +CC_VERSION=`$CC -v 2>&1 | grep "^gcc version"` +bad_cc() { + AC_MSG_RESULT([buggy compiler found!]) + 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 + ;; + # mandrake's similar sub 0xc compiler bug + # http://marc.theaimsgroup.com/?l=linux-kernel&m=104748366226348&w=2 + "gcc version 2.96 20000731 (Mandrake Linux 8.1 2.96-0.62mdk)") + bad_cc + ;; + *) + AC_MSG_RESULT([no known problems]) + ;; +esac +# end ------ BAD gcc? ------------ + +# --------- unsigned long long sane? ------- + +AC_CHECK_SIZEOF(unsigned long long, 0) +echo "---> size SIZEOF $SIZEOF_unsigned_long_long" +echo "---> size SIZEOF $ac_cv_sizeof_unsigned_long_long" +if test $ac_cv_sizeof_unsigned_long_long != 8 ; then + AC_MSG_ERROR([** we assume that sizeof(long long) == 8. Tell phil@clusterfs.com]) +fi + +# -------- we can't build modules unless srcdir = builddir +if test x$enable_modules != xno ; then + AC_CHECK_FILE([autoMakefile.am],[], + [AC_MSG_ERROR([At this time, Lustre does not support building kernel modules with srcdir != buildir.])]) +fi + +# -------- in kernel compilation? (2.5 only) ------------- +AC_MSG_CHECKING([if inkernel build support is requested]) +AC_ARG_ENABLE([inkernel], + AC_HELP_STRING([--enable-inkernel], + [set up 2.5 kernel makefiles]), + [],[enable_inkernel=no]) +AC_MSG_RESULT([$enable_inkernel]) +AM_CONDITIONAL(INKERNEL, test x$enable_inkernel = xyes) + +if test x$enable_inkernel = xyes ; then + find portals lustre -name Makefile.mk | sed 's/.mk$//' | xargs -n 1 \ + sh -e -x -c '(cp -f $0.mk $0.in)' +fi + +if test x$enable_modules != xno ; then + # -------- set linuxdir ------------ + AC_MSG_CHECKING([for Linux sources]) + AC_ARG_WITH([linux], + AC_HELP_STRING([--with-linux=path], + [set path to Linux source (default=/usr/src/linux)]), + [LINUX=$with_linux], + [LINUX=/usr/src/linux]) + AC_MSG_RESULT([$LINUX]) + AC_SUBST(LINUX) + if test x$enable_inkernel = xyes ; then + echo ln -s `pwd` $LINUX/fs/lustre + rm $LINUX/fs/lustre + ln -s `pwd` $LINUX/fs/lustre + fi + + # -------- linux objects (for 2.6) -- + AC_MSG_CHECKING([for Linux objects dir]) + AC_ARG_WITH([linux-obj], + AC_HELP_STRING([--with-linux-obj=path], + [set path to Linux objects dir (default=\$LINUX)]), + [LINUX_OBJ=$with_linux_obj], + [LINUX_OBJ=$LINUX]) + AC_MSG_RESULT([$LINUX_OBJ]) + AC_SUBST(LINUX_OBJ) + + # -------- check for .confg -------- + AC_ARG_WITH([linux-config], + [AC_HELP_STRING([--with-linux-config=path], + [set path to Linux .conf (default=\$LINUX_OBJ/.config)])], + [LINUX_CONFIG=$with_linux_config], + [LINUX_CONFIG=$LINUX_OBJ/.config]) + AC_SUBST(LINUX_CONFIG) + + AC_CHECK_FILE([/boot/kernel.h], + [KERNEL_SOURCE_HEADER='/boot/kernel.h'], + [AC_CHECK_FILE([/var/adm/running-kernel.h]), + [KERNEL_SOURCE_HEADER='/var/adm/running-kernel.h']]) + + AC_ARG_WITH([kernel-source-header], + AC_HELP_STRING([--with-kernel-source-header=path], + [Use a different kernel version header. Consult README.kernel-source for details.]), + [KERNEL_SOURCE_HEADER=$with_kernel_source_header]) + + # -------------------- + ARCH_UM= + UML_CFLAGS= + + AC_MSG_CHECKING([if you are running user mode linux for $host_cpu]) + if test -e $LINUX/include/asm-um ; then + if test X`ls -id $LINUX/include/asm/ | awk '{print $1}'` = X`ls -id $LINUX/include/asm-um | awk '{print $1}'` ; then + ARCH_UM='ARCH=um' + # see notes in Rules.in + UML_CFLAGS='-O0' + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT([no (asm doesn't point at asm-um)]) + fi + else + AC_MSG_RESULT([no (asm-um missing)]) + fi + + AC_SUBST(ARCH_UM) + AC_SUBST(UML_CFLAGS) + + # --------- Linux 25 ------------------ + AC_CHECK_FILE([$LINUX/include/linux/namei.h], + [ + linux25="yes" + KMODEXT=".ko" + ],[ + KMODEXT=".o" + linux25="no" + ]) + AC_MSG_CHECKING([if you are using Linux 2.6]) + AC_MSG_RESULT([$linux25]) + + AC_SUBST(LINUX25) + AC_SUBST(KMODEXT) +fi +AM_CONDITIONAL(LINUX25, test x$linux25 = xyes) + + +# ------- Makeflags ------------------ + +CPPFLAGS="$CPPFLAGS $CRAY_PORTALS_INCLUDES -I\$(top_srcdir)/lustre/include -I\$(top_srcdir)/portals/include" + +# liblustre are all the same +LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1" +AC_SUBST(LLCPPFLAGS) + +LLCFLAGS="-g -Wall -fPIC" +AC_SUBST(LLCFLAGS) + +# everyone builds against portals and lustre + +EXTRA_KCFLAGS="-g $CRAY_PORTALS_INCLUDES -I$PWD/portals/include -I$PWD/lustre/include" + +# these are like AC_TRY_COMPILE, but try to build modules against the +# kernel, inside the kernel-tests directory + +AC_DEFUN([LUSTRE_MODULE_CONFTEST], +[cat >conftest.c <<_ACEOF +$1 +_ACEOF +]) + +AC_DEFUN([LUSTRE_MODULE_COMPILE_IFELSE], +[m4_ifvaln([$1], [LUSTRE_MODULE_CONFTEST([$1])])dnl +rm -f build/conftest.o build/conftest.mod.c build/conftest.ko +AS_IF([AC_TRY_COMMAND(cp conftest.c build && make [$2] CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [$4], + [_AC_MSG_LOG_CONFTEST +m4_ifvaln([$5],[$5])dnl])dnl +rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl +]) + +AC_DEFUN([LUSTRE_MODULE_TRY_COMPILE], +[LUSTRE_MODULE_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[$1]], [[$2]])], + [modules], + [test -s build/conftest.o], + [$3], [$4])]) + +AC_DEFUN([LUSTRE_MODULE_TRY_MAKE], +[LUSTRE_MODULE_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4], [$5], [$6])]) + +# ------------ include paths ------------------ + +if test x$enable_modules != xno ; then + # ------------ .config exists ---------------- + AC_CHECK_FILE([$LINUX_CONFIG],[], + [AC_MSG_ERROR([Kernel config could not be found. If you are building from a kernel-source rpm consult README.kernel-source])]) + + # ----------- make dep run? ------------------ + AC_CHECK_FILES([$LINUX_OBJ/include/linux/autoconf.h + $LINUX_OBJ/include/linux/version.h + $LINUX/include/linux/config.h],[], + [AC_MSG_ERROR([Run make config in $LINUX.])]) + + # ------------ rhconfig.h includes runtime-generated bits -- + # red hat kernel-source checks + + # we know this exists after the check above. if the user + # tarred up the tree and ran make dep etc. in it, then + # version.h gets overwritten with a standard linux one. + + if grep rhconfig $LINUX_OBJ/include/linux/version.h >/dev/null ; then + # This is a clean kernel-source tree, we need to + # enable extensive workarounds to get this to build + # modules + AC_CHECK_FILE([$KERNEL_SOURCE_HEADER], + [if test $KERNEL_SOURCE_HEADER = '/boot/kernel.h' ; then + AC_MSG_WARN([Using /boot/kernel.h from RUNNING kernel.]) + AC_MSG_WARN([If this is not what you want, use --with-kernel-source-header.]) + AC_MSG_WARN([Consult README.kernel-source for details.]) + fi], + [AC_MSG_ERROR([$KERNEL_SOURCE_HEADER not found. Consult README.kernel-source for details.])]) + EXTRA_KCFLAGS="-include $KERNEL_SOURCE_HEADER $EXTRA_KCFLAGS" + fi + + # ------------ external module support --------------------- + MODULE_TARGET="SUBDIRS" + if test $linux25 = 'yes' ; then + makerule="$PWD/build" + AC_MSG_CHECKING([for external module build support]) + rm -f build/conftest.i + LUSTRE_MODULE_TRY_MAKE([],[], + [$makerule LUSTRE_KERNEL_TEST=conftest.i], + [test -s build/conftest.i], + [ + AC_MSG_RESULT([no]) + ],[ + AC_MSG_RESULT([yes]) + makerule="_module_$makerule" + MODULE_TARGET="M" + ]) + else + makerule="_dir_$PWD/build" + fi + AC_SUBST(MODULE_TARGET) + + # --- check that we can build modules at all + AC_MSG_CHECKING([that modules can be built]) + LUSTRE_MODULE_TRY_COMPILE([],[], + [ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_WARN([Consult config.log for details.]) + AC_MSG_WARN([If you are trying to build with a kernel-source rpm, consult README.kernel-source]) + AC_MSG_ERROR([Kernel modules could not be built.]) + ]) + + # ------------ LINUXRELEASE and moduledir ------------------ + LINUXRELEASE= + rm -f build/conftest.i + AC_MSG_CHECKING([for Linux release]) + LUSTRE_MODULE_TRY_MAKE( + [#include ], + [char *LINUXRELEASE; + LINUXRELEASE=UTS_RELEASE;], + [$makerule LUSTRE_KERNEL_TEST=conftest.i], + [test -s build/conftest.i], + [ + # LINUXRELEASE="UTS_RELEASE" + eval $(grep "LINUXRELEASE=" build/conftest.i) + ],[ + AC_MSG_RESULT([unknown]) + AC_MSG_ERROR([Could not preprocess test program. Consult config.log for details.]) + ]) + rm -f build/conftest.i + if test x$LINUXRELEASE = x ; then + AC_MSG_RESULT([unknown]) + AC_MSG_ERROR([Could not determine Linux release version from linux/version.h.]) + fi + AC_MSG_RESULT([$LINUXRELEASE]) + AC_SUBST(LINUXRELEASE) + + moduledir='/lib/modules/'$LINUXRELEASE/kernel + modulefsdir='$(moduledir)/fs/$(PACKAGE)' + modulenetdir='$(moduledir)/net/$(PACKAGE)' + + AC_SUBST(moduledir) + AC_SUBST(modulefsdir) + AC_SUBST(modulenetdir) + + # ------------ RELEASE -------------------------------- + AC_MSG_CHECKING([for Lustre release]) + RELEASE="`echo ${LINUXRELEASE} | tr '-' '_'`_`date +%Y%m%d%H%M`" + AC_MSG_RESULT($RELEASE) + AC_SUBST(RELEASE) + + # ---------- modules? ------------------------ + AC_MSG_CHECKING([for module support]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + #ifndef CONFIG_MODULES + #error CONFIG_MODULES not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + AC_MSG_ERROR([module support is required to build Lustre kernel modules.]) + ]) + + # ---------- modversions? -------------------- + AC_MSG_CHECKING([for MODVERSIONS]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + #ifndef CONFIG_MODVERSIONS + #error CONFIG_MODVERSIONS not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + ]) + + # ------------ preempt ----------------------- + AC_MSG_CHECKING([if preempt is enabled]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + #ifndef CONFIG_PREEMPT + #error CONFIG_PREEMPT is not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + AC_MSG_ERROR([Lustre does not support kernels with preempt enabled.]) + ],[ + AC_MSG_RESULT([no]) + ]) + + # ------------ kallsyms (so software watchdogs produce useful stacks) + AC_MSG_CHECKING([if kallsyms is enabled]) + LUSTRE_MODULE_TRY_COMPILE( + [ + #include + ],[ + #ifndef CONFIG_KALLSYMS + #error CONFIG_KALLSYMS is not #defined + #endif + ],[ + AC_MSG_RESULT([yes]) + ],[ + AC_MSG_RESULT([no]) + if test "x$ARCH_UM" = "x" ; then + AC_MSG_ERROR([Lustre requires that CONFIG_KALLSYMS is enabled in your kernel.]) + fi + ]) +fi + +ENABLE_INIT_SCRIPTS=0 +if test x$enable_utils = xyes ; then + AC_MSG_CHECKING([whether to install init scripts]) + # our scripts only work on red hat systems + if test -f /etc/init.d/functions -a -f /etc/sysconfig/network ; then + ENABLE_INIT_SCRIPTS=1 + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +fi +AM_CONDITIONAL(INIT_SCRIPTS, test x$ENABLE_INIT_SCRIPTS = "x1") +AC_SUBST(ENABLE_INIT_SCRIPTS) + +AC_CONFIG_FILES([ +build/autoMakefile +build/Rules +]) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000000..ce1df2a829 --- /dev/null +++ b/configure.ac @@ -0,0 +1,45 @@ +sinclude(lustre/version.m4) + +AC_INIT([Lustre], [LUSTRE_VERSION], [http://bugzilla.lustre.org/], [lustre]) + +if test "LUSTRE_VERSION" = "LUSTRE""_VERSION" ; then + cat >&2 <<-EOF + This script was not built with a version number. + + This is likely due to an incorrect checkout, or a broken + tarball. + + Please see README.lustrecvs, or contact your Lustre vendor. + EOF + exit 1 +fi + +AC_CONFIG_SRCDIR(lustre/obdclass/obdo.c) +AM_INIT_AUTOMAKE +# AM_MAINTAINER_MODE + +sinclude(build/build.ac) +sinclude(portals/portals.ac) +sinclude(lustre/lustre.ac) + +AC_CONFIG_HEADERS([config.h]) + +CPPFLAGS="-include \$(top_builddir)/config.h $CPPFLAGS" +EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS" +AC_SUBST(EXTRA_KCFLAGS) + +AC_OUTPUT([ +Makefile +autoMakefile +]) + +cat <&2 + [ "$1" ] && echo "$progname: $1" >&2 + [ "$1" ] && echo >&2 +} + +fatal () +{ + warn "$2" + exit "$1" +} + +usage () +{ + cat <&2 + exit 1 + ;; + --help | -h) + usage + exit 0 + ;; + checkout | co | get | rtag | rt | rfreeze | tag | ta | freeze | update | up | upd) + cvscommand="$1" + ;; + *) + usage >&2 + exit 1 + ;; +esac + +case "$2" in + '') + warn "a lustretag is required." + usage >&2 + exit 1 + ;; + --help | -h) + usage + exit 0 + ;; + + # this is the branch table + # keep this list sorted alphabetically! + + b1_4) + portalstag="HEAD" + lustretag="b1_4" + ;; + b1_4_bgl) + portalstag="b1_4_bgl" + lustretag="b1_4_bgl" + ;; + b_cray) + portalstag="HEAD" + lustretag="b_cray" + ;; + HEAD) + portalstag="HEAD" + lustretag="HEAD" + ;; + + *) + fatal 1 "This script does not contain branch information for $2. Please update the branch table if necessary." + ;; +esac + +cvs $cvscommand -r $portalstag portals +cvs $cvscommand -r $lustretag -d lustre lustre-core