3 # taken from gnome-common/macros2/autogen.sh
8 IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
10 for ch_min in $ch_min_version; do
11 ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
12 if [ -z "$ch_min" ]; then break; fi
13 if [ -z "$ch_cur" ]; then ch_status=1; break; fi
14 if [ $ch_cur -gt $ch_min ]; then break; fi
15 if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
22 echo "$cmd is $1. Version $required (or higher) is required to build Lustre."
24 if [ ! -x /usr/bin/lsb_release ]; then
25 echo "lsb_release could not be found. If it were available more help on how to resolve this\nsituation would be available."
29 local dist_id="$(lsb_release -is)"
32 echo -e "To install $cmd, you can use the command:\n# $1"
35 Ubuntu|Debian) howto "apt-get install $cmd" ;;
36 CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;;
37 SUSE*) howto "yast -i $cmd" ;;
38 *) echo -e "\nInstallation instructions for the package $cmd on $dist_id are not known.\nIf you know how to install the required package, please file a bug at\nhttp://bugs.whamcloud.com/ and include your distribution and the output from:\n\"lsb_release -is\" is: \"$dist_id\"" ;;
53 echo -n "checking for $cmd >= $required... "
54 if ! $cmd --version >/dev/null ; then
57 version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }")
59 if ! compare_versions "$required" "$version" ; then
64 echo "Checking for a complete tree..."
65 if [ -d kernel_patches ] ; then
70 REQUIRED_DIRS="build libcfs lnet lustre"
71 OPTIONAL_DIRS="snmp portals"
72 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
75 for dir in $REQUIRED_DIRS ; do
76 if [ ! -d "$dir" ] ; then
78 Your tree seems to be missing $dir.
79 Please read README.lustrecvs for details.
83 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
85 # optional directories for Lustre
86 for dir in $OPTIONAL_DIRS; do
87 if [ -d "$dir" ] ; then
88 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
93 for AMVER in 1.9 1.10 1.11; do
94 if which automake-$AMVER 2> /dev/null; then
101 cmd=automake required="1.9" error_msg "not found"
105 [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability"
107 check_version automake automake-$AMVER "1.9"
108 check_version autoconf autoconf "2.57"
113 echo -n "Running $cmd"
116 if [ $res -ne 0 ]; then
124 export ACLOCAL="aclocal-$AMVER"
125 export AUTOMAKE="automake-$AMVER"
127 run_cmd "$ACLOCAL $ACLOCAL_FLAGS"
129 run_cmd "$AUTOMAKE -a -c $AMOPT"
132 # Run autogen.sh in these directories
133 for dir in $CONFIGURE_DIRS; do
134 if [ -d $dir ] ; then
135 pushd $dir >/dev/null
136 echo "Running autogen for $dir..."
137 run_cmd "sh autogen.sh"