X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=autogen.sh;h=fd09398694568a1bf3c2f8b48c99b748849f3030;hp=1fce0a455fc75dbe6868fadaace20be4c998bef7;hb=8beee9d0ff74f78fc5b072d1cf98f55d927dcdbe;hpb=147839e23d49551ba61319b0812a3ef7e36cc80a;ds=sidebyside diff --git a/autogen.sh b/autogen.sh index 1fce0a4..fd09398 100644 --- a/autogen.sh +++ b/autogen.sh @@ -1,9 +1,62 @@ #!/bin/sh +# NOTE: Please avoid bashisms (bash specific syntax) in this script + +# die a horrible death. All output goes to stderr. +# +die() +{ + echo "bootstrap failure: $*" + echo Aborting + exit 1 +} 1>&2 + +run_cmd() +{ + echo -n "Running $*" + eval "$@" || die "command exited with code $?" + echo +} + # install Lustre Git commit hooks by default - LU-2083 for HOOK in commit-msg prepare-commit-msg; do - [ -e .git/hooks/$HOOK ] || ln -sf ../build/$HOOK .git/hooks/ + if [ -d .git/hooks -a ! -e .git/hooks/$HOOK ]; then + ln -sf ../../build/$HOOK .git/hooks/ + fi +done + +echo "Checking for a complete tree..." +REQUIRED_DIRS="libcfs lnet lustre" +OPTIONAL_DIRS="snmp portals" +CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs" + +for dir in $REQUIRED_DIRS ; do + test -d "$dir" || \ + die "Your tree seems to be missing $dir. +Please read README.lustrecvs for details." + + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf" +done +# optional directories for Lustre +for dir in $OPTIONAL_DIRS; do + if [ -d "$dir" ] ; then + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf" + fi done -exec bash build/autogen.sh $@ +PWD_SAVE=$PWD +run_cmd "aclocal -I $PWD/config $ACLOCAL_FLAGS" +run_cmd "autoheader" +run_cmd "automake -a -c" +run_cmd autoconf + +# bootstrap in these directories +for dir in $CONFIGURE_DIRS; do + if [ -d $dir ] ; then + cd $dir + echo "bootstrapping in $dir..." + run_cmd "sh autogen.sh" + fi + cd $PWD_SAVE +done