Whamcloud - gitweb
6edec5b0adfe9e9953204e34132fde4cf812da9a
[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 echo "Checking for a complete tree..."
22 REQUIRED_DIRS="libcfs lnet lustre"
23 OPTIONAL_DIRS="snmp portals"
24 CONFIGURE_DIRS="libsysio"
25
26 for dir in $REQUIRED_DIRS ; do
27         test -d "$dir" || \
28                 die "Your tree seems to be missing $dir.
29 Please read README.lustrecvs for details."
30
31         ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
32 done
33 # optional directories for Lustre
34 for dir in $OPTIONAL_DIRS; do
35         if [ -d "$dir" ] ; then
36                 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
37         fi
38 done
39
40 PWD_SAVE=$PWD
41
42 run_cmd "aclocal -I $PWD/config $ACLOCAL_FLAGS"
43 run_cmd "autoheader"
44 run_cmd "automake -a -c"
45 run_cmd autoconf
46
47 # bootstrap in these directories
48 for dir in $CONFIGURE_DIRS; do
49         if [ -d $dir ] ; then
50                 cd $dir
51                 echo "bootstrapping in $dir..."
52                 run_cmd "sh autogen.sh"
53         fi
54         cd $PWD_SAVE
55 done