Whamcloud - gitweb
LU-3131 tests: fix sanity 56u/102k for single OST.
[fs/lustre-release.git] / autogen.sh
1 #!/bin/sh
2
3 # NOTE: Please avoid bashisms (bash specific syntax) in this script
4
5 # install Lustre Git commit hooks by default - LU-2083
6 for HOOK in commit-msg prepare-commit-msg; do
7         [ -e .git/hooks/$HOOK ] || ln -sf ../../build/$HOOK .git/hooks/
8 done
9
10 echo "Checking for a complete tree..."
11 REQUIRED_DIRS="libcfs lnet lustre"
12 OPTIONAL_DIRS="snmp portals"
13 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
14
15 for dir in $REQUIRED_DIRS ; do
16         if [ ! -d "$dir" ] ; then
17                 cat >&2 <<EOF
18 Your tree seems to be missing $dir.
19 Please read README.lustrecvs for details.
20 EOF
21                 exit 1
22         fi
23         ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
24 done
25 # optional directories for Lustre
26 for dir in $OPTIONAL_DIRS; do
27         if [ -d "$dir" ] ; then
28                 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
29         fi
30 done
31
32 run_cmd()
33 {
34         cmd="$@"
35         echo -n "Running $cmd"
36         eval $cmd
37         res=$?
38         if [ $res -ne 0 ]; then
39                 echo " failed: $res"
40                 echo "Aborting"
41                 exit 1
42         fi
43         echo
44 }
45
46 run_cmd "aclocal -I $PWD/config $ACLOCAL_FLAGS"
47 run_cmd "autoheader"
48 run_cmd "automake -a -c"
49 run_cmd autoconf
50
51 # Run autogen.sh in these directories
52 PWD_SAVE=$PWD
53 for dir in $CONFIGURE_DIRS; do
54         if [ -d $dir ] ; then
55                 cd $dir
56                 echo "Running autogen for $dir..."
57                 run_cmd "sh autogen.sh"
58         fi
59         cd $PWD_SAVE
60 done