~ubuntu-branches/ubuntu/raring/ibutils/raring-proposed

« back to all changes in this revision

Viewing changes to autogen.sh

  • Committer: Bazaar Package Importer
  • Author(s): Benoit Mortier
  • Date: 2010-01-11 22:22:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100111222200-53kum2et5nh13rv3
Tags: upstream-1.2-OFED-1.4.2
ImportĀ upstreamĀ versionĀ 1.2-OFED-1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
cd ${0%*/*}
 
3
# get two strings of version numbers
 
4
# parse the two strings and compare
 
5
function compare_versions() {
 
6
   cat <<EOF > /tmp/$$.awk
 
7
/[0-9]+\.[0-9]+(\.[0-9]+)?[    ]+[0-9]+\.[0-9]+(\.[0-9]+)?/{
 
8
  vb = "$2";
 
9
  nb = split(vb,b,"[.]");
 
10
  va = "$1";
 
11
  na = split(va,a,"[.]");
 
12
  for (i = na + 1; i < 4; i++) {
 
13
      a[i] = 0;
 
14
  }
 
15
  for (i = nb + 1; i < 4; i++) {
 
16
      b[i] = 0;
 
17
  }
 
18
  for (i = 1; i <= 3; i++) {
 
19
    if (b[i] < a[i]) {
 
20
#      print "FAIL:" va ">" vb " at index:" i;
 
21
        exit(1);
 
22
    } else if (b[i] > a[i]) {
 
23
#       print "OK:" va "<" vb " at index:" i;
 
24
       exit(0);
 
25
    }
 
26
  }
 
27
#  print "OK:" va "==" vb;
 
28
  exit(0);
 
29
}
 
30
{
 
31
  exit(1);
 
32
}
 
33
EOF
 
34
  echo "$1 $2 " | awk -f /tmp/$$.awk
 
35
  status=$?
 
36
  rm /tmp/$$.awk
 
37
  return $status
 
38
}
 
39
 
 
40
cd ${0%*/*}
 
41
 
 
42
# make sure autoconf is up-to-date
 
43
ac_ver=`autoconf --version | head -n 1 | awk '{print $NF}'`
 
44
compare_versions 2.59 $ac_ver
 
45
if test $? = 1; then
 
46
    echo Min autoconf version is 2.59
 
47
    exit 1
 
48
fi
 
49
 
 
50
# make sure automake is up-to-date
 
51
am_ver=`automake --version | head -n 1 | awk '{print $NF}'`
 
52
compare_versions 1.9.2 $am_ver
 
53
if test $? = 1; then
 
54
    echo Min automake version is 1.9.2
 
55
    exit 1
 
56
fi
 
57
 
 
58
# make sure libtool is up-to-date
 
59
lt_ver=`libtool --version | head -n 1 | awk '{print $4}'`
 
60
compare_versions 1.4.2 $lt_ver
 
61
if test $? = 1; then
 
62
    echo Min libtool version is 1.4.2
 
63
    exit 1
 
64
fi
 
65
 
 
66
# cleanup
 
67
find . \( -name Makefile.in -o -name aclocal.m4 -o -name autom4te.cache -o -name configure -o -name aclocal.m4 \) -exec \rm -rf {} \; -prune
 
68
 
 
69
# handle our own autoconf:
 
70
aclocal -I config 2>&1 |  grep -v "arning: underquoted definition of"
 
71
automake --add-missing --gnu --copy --force
 
72
autoconf
 
73
 
 
74
# visit all sub directories with autogen.sh
 
75
anyErr=0
 
76
for a in `ls */autogen.sh`; do
 
77
    echo Visiting $a
 
78
    $a 2>&1 | sed 's/^/|/'
 
79
    if test $? != 0; then
 
80
        echo $a failed
 
81
        anyErr=1
 
82
    fi
 
83
done
 
84
 
 
85
exit $anyErr