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."
28 local dist_id="$(lsb_release -is)"
31 echo -e "To install $cmd, you can use the command:\n# $1"
34 Ubuntu) howto "apt-get install $cmd" ;;
35 CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;;
36 SUSE*) howto "yast -i $cmd" ;;
37 *) 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\"" ;;
52 echo -n "checking for $cmd >= $required... "
53 if ! $cmd --version >/dev/null ; then
56 version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }")
58 if ! compare_versions "$required" "$version" ; then
63 echo "Checking for a complete tree..."
64 if [ -d kernel_patches ] ; then
69 REQUIRED_DIRS="build lnet lustre"
70 OPTIONAL_DIRS="snmp portals"
71 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs spl zfs"
74 for dir in $REQUIRED_DIRS ; do
75 if [ ! -d "$dir" ] ; then
77 Your tree seems to be missing $dir.
78 Please read README.lustrecvs for details.
82 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
84 # optional directories for Lustre
85 for dir in $OPTIONAL_DIRS; do
86 if [ -d "$dir" ] ; then
87 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
92 for AMVER in 1.9 1.10 1.11; do
93 if [ "$(which automake-$AMVER 2> /dev/null)" ]; then
100 cmd=automake required="1.9" error_msg "not found"
104 [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability"
106 check_version automake automake-$AMVER "1.9"
107 check_version autoconf autoconf "2.57"
109 export ACLOCAL="aclocal-$AMVER"
110 export AUTOMAKE="automake-$AMVER"
115 echo -n "Running $cmd... "
118 if [ $res -ne 0 ]; then
126 run_cmd "$ACLOCAL $ACLOCAL_FLAGS"
128 run_cmd "$AUTOMAKE -a -c $AMOPT"
131 # Run autogen.sh in these directories
132 for dir in $CONFIGURE_DIRS; do
133 if [ -d $dir ] ; then
134 pushd $dir >/dev/null
135 echo "Running autogen for $dir..."
136 run_cmd "sh autogen.sh"