Whamcloud - gitweb
LU-3474 mdd: mdd_links_read() to return linkea_init() errors
[fs/lustre-release.git] / autogen.sh
1 #!/bin/sh
2
3 # NOTE: Please avoid bashisms (bash specific syntax) in this script
4
5 # die a horrible death.  All output goes to stderr.
6 #
7 die()
8 {
9         echo "bootstrap failure:  $*"
10         echo Aborting
11         exit 1
12 } 1>&2
13
14 run_cmd()
15 {
16         echo -n "Running $*"
17         eval "$@" || die "command exited with code $?"
18         echo
19 }
20
21 # install Lustre Git commit hooks by default - LU-2083
22 for HOOK in commit-msg prepare-commit-msg; do
23         if [ -d .git/hooks -a ! -e .git/hooks/$HOOK ]; then
24                 ln -sf ../../build/$HOOK .git/hooks/
25         fi
26 done
27
28 echo "Checking for a complete tree..."
29 REQUIRED_DIRS="libcfs lnet lustre"
30 OPTIONAL_DIRS="snmp portals"
31 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
32
33 for dir in $REQUIRED_DIRS ; do
34         test -d "$dir" || \
35                 die "Your tree seems to be missing $dir.
36 Please read README.lustrecvs for details."
37
38         ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
39 done
40 # optional directories for Lustre
41 for dir in $OPTIONAL_DIRS; do
42         if [ -d "$dir" ] ; then
43                 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
44         fi
45 done
46
47 PWD_SAVE=$PWD
48
49 run_cmd "aclocal -I $PWD/config $ACLOCAL_FLAGS"
50 run_cmd "autoheader"
51 run_cmd "automake -a -c"
52 run_cmd autoconf
53
54 # bootstrap in these directories
55 for dir in $CONFIGURE_DIRS; do
56         if [ -d $dir ] ; then
57                 cd $dir
58                 echo "bootstrapping in $dir..."
59                 run_cmd "sh autogen.sh"
60         fi
61         cd $PWD_SAVE
62 done