3 # NOTE: Please avoid bashisms (bash specific syntax) in this script
5 # taken from gnome-common/macros2/autogen.sh
10 IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
11 set $ch_actual_version
12 for ch_min in $ch_min_version; do
13 # remove letter suffixes
14 ch_cur=$(echo $1 | sed 's/[^0-9].*$//'); shift
15 if [ -z "$ch_min" ]; then break; fi
16 if [ -z "$ch_cur" ]; then ch_status=1; break; fi
17 if [ $ch_cur -gt $ch_min ]; then break; fi
18 if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
25 echo "$cmd is $1. Version $required (or higher) is"\
26 " required to build Lustre."
28 if [ ! -x /usr/bin/lsb_release ]; then
29 echo "lsb_release could not be found. "\
30 "If it were available more help on how to resolve this"
31 echo "situation would be available."
35 local dist_id="$(lsb_release -is)"
38 echo -e "To install $cmd, you can use the command:\n# $1"
41 Ubuntu|Debian) howto "apt-get install $cmd" ;;
42 CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;;
43 SUSE*) howto "yast -i $cmd" ;;
45 Installation instructions for the package $cmd on $dist_id are not known.
46 If you know how to install the required package, please file a bug at
47 http://bugs.whamcloud.com/ and include your distribution and the output from:
48 "lsb_release -is" is: "$dist_id"
65 echo -n "checking for $cmd >= $required... "
66 if ! $cmd --version >/dev/null ; then
69 version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }")
71 if ! compare_versions "$required" "$version" ; then
77 for AMVER in 1.9 1.10 1.11; do
78 if which automake-$AMVER 2> /dev/null; then
85 cmd=automake required="1.9" error_msg "not found"
89 [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability"
91 check_version automake automake-$AMVER "1.9"
92 check_version autoconf autoconf "2.57"
97 echo -n "Running $cmd"
100 if [ $res -ne 0 ]; then
108 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/build/autoconf"
110 export ACLOCAL="aclocal-$AMVER"
111 export AUTOMAKE="automake-$AMVER"
113 run_cmd "$ACLOCAL $ACLOCAL_FLAGS"
115 run_cmd "$AUTOMAKE -a -c $AMOPT"