3 # NOTE: Please avoid bashisms (bash specific syntax) in this script
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/
10 # taken from gnome-common/macros2/autogen.sh
15 IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
16 set $ch_actual_version
17 for ch_min in $ch_min_version; do
18 # remove letter suffixes
19 ch_cur=$(echo $1 | sed 's/[^0-9].*$//'); shift
20 if [ -z "$ch_min" ]; then break; fi
21 if [ -z "$ch_cur" ]; then ch_status=1; break; fi
22 if [ $ch_cur -gt $ch_min ]; then break; fi
23 if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
30 echo "$cmd is $1. Version $required (or higher) is"\
31 " required to build Lustre."
33 if [ ! -x /usr/bin/lsb_release ]; then
34 echo "lsb_release could not be found. "\
35 "If it were available more help on how to resolve this"
36 echo "situation would be available."
40 local dist_id="$(lsb_release -is)"
43 echo -e "To install $cmd, you can use the command:\n# $1"
46 Ubuntu|Debian) howto "apt-get install $cmd" ;;
47 CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;;
48 SUSE*) howto "yast -i $cmd" ;;
50 Installation instructions for the package $cmd on $dist_id are not known.
51 If you know how to install the required package, please file a bug at
52 http://bugs.whamcloud.com/ and include your distribution and the output from:
53 "lsb_release -is" is: "$dist_id"
70 echo -n "checking for $cmd >= $required... "
71 if ! $cmd --version >/dev/null ; then
74 version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }")
76 if ! compare_versions "$required" "$version" ; then
81 echo "Checking for a complete tree..."
82 REQUIRED_DIRS="build libcfs lnet lustre"
83 OPTIONAL_DIRS="snmp portals"
84 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
86 for dir in $REQUIRED_DIRS ; do
87 if [ ! -d "$dir" ] ; then
89 Your tree seems to be missing $dir.
90 Please read README.lustrecvs for details.
94 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
96 # optional directories for Lustre
97 for dir in $OPTIONAL_DIRS; do
98 if [ -d "$dir" ] ; then
99 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
104 for AMVER in 1.9 1.10 1.11; do
105 if which automake-$AMVER 2> /dev/null; then
112 cmd=automake required="1.9" error_msg "not found"
116 [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability"
118 check_version automake automake-$AMVER "1.9"
119 check_version autoconf autoconf "2.57"
124 echo -n "Running $cmd"
127 if [ $res -ne 0 ]; then
135 export ACLOCAL="aclocal-$AMVER"
136 export AUTOMAKE="automake-$AMVER"
138 run_cmd "$ACLOCAL $ACLOCAL_FLAGS"
140 run_cmd "$AUTOMAKE -a -c $AMOPT"
143 # Run autogen.sh in these directories
145 for dir in $CONFIGURE_DIRS; do
146 if [ -d $dir ] ; then
148 echo "Running autogen for $dir..."
149 run_cmd "sh autogen.sh"