import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunk
[metze/old/v3-2-winbind-ndr.git] / source / autogen.sh
1 #!/bin/sh
2
3 # Run this script to build samba from CVS.
4
5 ## insert all possible names (only works with 
6 ## autoconf 2.x
7 TESTAUTOHEADER="autoheader autoheader-2.53"
8 TESTAUTOCONF="autoconf autoconf-2.53"
9
10 AUTOHEADERFOUND="0"
11 AUTOCONFFOUND="0"
12
13
14 ##
15 ## Look for autoheader 
16 ##
17 for i in $TESTAUTOHEADER; do
18         if which $i > /dev/null 2>&1; then
19                 if [ `$i --version | head -n 1 | cut -d.  -f 2` -ge 53 ]; then
20                         AUTOHEADER=$i
21                         AUTOHEADERFOUND="1"
22                         break
23                 fi
24         fi
25 done
26
27 ## 
28 ## Look for autoconf
29 ##
30
31 for i in $TESTAUTOCONF; do
32         if which $i > /dev/null 2>&1; then
33                 if [ `$i --version | head -n 1 | cut -d.  -f 2` -ge 53 ]; then
34                         AUTOCONF=$i
35                         AUTOCONFFOUND="1"
36                         break
37                 fi
38         fi
39 done
40
41
42 ## 
43 ## do we have it?
44 ##
45 if [ "$AUTOCONFFOUND" = "0" -o "$AUTOHEADERFOUND" = "0" ]; then
46         echo "$0: need autoconf 2.53 or later to build samba from CVS" >&2
47         exit 1
48 fi
49
50
51
52 echo "$0: running $AUTOHEADER"
53 $AUTOHEADER || exit 1
54
55 echo "$0: running $AUTOCONF"
56 $AUTOCONF || exit 1
57
58 echo "$0: running script/mkversion.sh"
59 ./script/mkversion.sh || exit 1
60
61 rm -rf autom4te.cache autom4te-2.53.cache
62
63 echo "Now run ./configure and then make."
64 exit 0
65