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 # remove letter suffixes
12 ch_cur=$(echo $1 | sed 's/[^0-9].*$//'); shift
13 if [ -z "$ch_min" ]; then break; fi
14 if [ -z "$ch_cur" ]; then ch_status=1; break; fi
15 if [ $ch_cur -gt $ch_min ]; then break; fi
16 if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
23 echo "$cmd is $1. Version $required (or higher) is"\
24 " required to build Lustre."
26 if [ ! -x /usr/bin/lsb_release ]; then
27 echo "lsb_release could not be found. "\
28 "If it were available more help on how to resolve this"
29 echo "situation would be available."
33 local dist_id="$(lsb_release -is)"
36 echo -e "To install $cmd, you can use the command:\n# $1"
39 Ubuntu|Debian) howto "apt-get install $cmd" ;;
40 CentOS|RedHat*|Fedora*) howto "yum install $cmd" ;;
41 SUSE*) howto "yast -i $cmd" ;;
43 Installation instructions for the package $cmd on $dist_id are not known.
44 If you know how to install the required package, please file a bug at
45 http://bugs.whamcloud.com/ and include your distribution and the output from:
46 "lsb_release -is" is: "$dist_id"
63 echo -n "checking for $cmd >= $required... "
64 if ! $cmd --version >/dev/null ; then
67 version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }")
69 if ! compare_versions "$required" "$version" ; then
74 echo "Checking for a complete tree..."
75 if [ -d kernel_patches ] ; then
80 REQUIRED_DIRS="build libcfs lnet lustre"
81 OPTIONAL_DIRS="snmp portals"
82 CONFIGURE_DIRS="libsysio lustre-iokit ldiskfs"
85 for dir in $REQUIRED_DIRS ; do
86 if [ ! -d "$dir" ] ; then
88 Your tree seems to be missing $dir.
89 Please read README.lustrecvs for details.
93 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
95 # optional directories for Lustre
96 for dir in $OPTIONAL_DIRS; do
97 if [ -d "$dir" ] ; then
98 ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $PWD/$dir/autoconf"
103 for AMVER in 1.9 1.10 1.11; do
104 if which automake-$AMVER 2> /dev/null; then
111 cmd=automake required="1.9" error_msg "not found"
115 [ "${AMVER#1.}" -ge "10" ] && AMOPT="-W no-portability"
117 check_version automake automake-$AMVER "1.9"
118 check_version autoconf autoconf "2.57"
123 echo -n "Running $cmd"
126 if [ $res -ne 0 ]; then
134 export ACLOCAL="aclocal-$AMVER"
135 export AUTOMAKE="automake-$AMVER"
137 run_cmd "$ACLOCAL $ACLOCAL_FLAGS"
139 run_cmd "$AUTOMAKE -a -c $AMOPT"
142 # Run autogen.sh in these directories
143 for dir in $CONFIGURE_DIRS; do
144 if [ -d $dir ] ; then
145 pushd $dir >/dev/null
146 echo "Running autogen for $dir..."
147 run_cmd "sh autogen.sh"