Remove unnecessary code
[jelmer/openchange.git] / autogen.sh
1 #!/bin/sh
2
3 # Run this script to build openchange from SVN
4
5 ## insert all possible names (only works with
6 ## autoconf 2.x
7 TESTAUTOHEADER="autoheader autoheader-2.53 autoheader2.50 autoheader259 autoheader253"
8 TESTAUTOCONF="autoconf autoconf-2.53 autoconf2.50 autoconf259 autoconf253"
9 TESTACLOCAL="aclocal aclocal19"
10
11 AUTOHEADERFOUND="0"
12 AUTOCONFFOUND="0"
13 ACLOCALFOUND="0"
14
15 ##
16 ## Look for autoheader
17 ##
18 for i in $TESTAUTOHEADER; do
19         if which $i > /dev/null 2>&1; then
20                 if test `$i --version | head -n 1 | cut -d.  -f 2 | tr -d [:alpha:]` -ge 53; then
21                         AUTOHEADER=$i
22                         AUTOHEADERFOUND="1"
23                         break
24                 fi
25         fi
26 done
27
28 ##
29 ## Look for autoconf
30 ##
31
32 for i in $TESTAUTOCONF; do
33         if which $i > /dev/null 2>&1; then
34                 if test `$i --version | head -n 1 | cut -d.  -f 2 | tr -d [:alpha:]` -ge 53; then
35                         AUTOCONF=$i
36                         AUTOCONFFOUND="1"
37                         break
38                 fi
39         fi
40 done
41
42 ##
43 ## Look for aclocal
44 ##
45 for i in $TESTACLOCAL; do
46         if which $i > /dev/null 2>&1; then
47                 ACLOCAL=$i              
48                 ACLOCALFOUND="1"
49                 break
50         fi
51 done
52
53
54 ##
55 ## do we have it?
56 ##
57 if test "$AUTOCONFFOUND" = "0" -o "$AUTOHEADERFOUND" = "0"; then
58         echo "$0: need autoconf 2.53 or later to build openchange from SVN" >&2
59         exit 1
60 fi
61
62 if test "$ACLOCALFOUND" = "0"; then
63         echo "$0: aclocal not found" >&2
64         exit 1
65 fi
66
67
68 rm -rf autom4te*.cache
69 rm -f configure include/config.h*
70
71 echo "$0: running $ACLOCAL"
72 $ACLOCAL || exit 1
73
74 echo "$0: running $AUTOHEADER"
75 $AUTOHEADER || exit 1
76
77 echo "$0: running $AUTOCONF"
78 $AUTOCONF || exit 1
79
80
81 rm -rf autom4te*.cache
82
83 echo "Now run ./configure and gmake"
84 exit 0