s4-netlogon: implement dcesrv_netr_DsRAddressToSitenamesExW
[Samba/aatanasov.git] / source4 / autogen.sh
blob1936af4351238fcf90731893ceff1c1119e1aadd
1 #!/bin/sh
3 # Run this script to build samba from git.
5 while true; do
6 case $1 in
7 --version-file)
8 VERSION_FILE=$2
9 shift 2
12 break
14 esac
15 done
17 ## insert all possible names (only works with
18 ## autoconf 2.x)
19 TESTAUTOHEADER="autoheader autoheader-2.53 autoheader2.50 autoheader259 autoheader253"
20 TESTAUTOCONF="autoconf autoconf-2.53 autoconf2.50 autoconf259 autoconf253"
22 AUTOHEADERFOUND="0"
23 AUTOCONFFOUND="0"
25 if which which > /dev/null 2>&1; then
26 echo -n
27 else
28 echo "$0: need 'which' to figure out if we have the right autoconf to build samba from git" >&2
29 exit 1
32 ## Look for autoheader
34 for i in $TESTAUTOHEADER; do
35 if which $i > /dev/null 2>&1; then
36 if test `$i --version | head -n 1 | cut -d. -f 2 | sed "s/[^0-9]//g"` -ge 53; then
37 AUTOHEADER=$i
38 AUTOHEADERFOUND="1"
39 break
42 done
45 ## Look for autoconf
48 for i in $TESTAUTOCONF; do
49 if which $i > /dev/null 2>&1; then
50 if test `$i --version | head -n 1 | cut -d. -f 2 | sed "s/[^0-9]//g"` -ge 53; then
51 AUTOCONF=$i
52 AUTOCONFFOUND="1"
53 break
56 done
60 ## do we have it?
62 if test "$AUTOCONFFOUND" = "0" -o "$AUTOHEADERFOUND" = "0"; then
63 echo "$0: need autoconf 2.53 or later to build samba from git" >&2
64 exit 1
67 echo "$0: running script/mkversion.sh"
68 ./script/mkversion.sh $VERSION_FILE || exit 1
70 rm -rf autom4te*.cache
71 rm -f configure include/config_tmp.h*
73 IPATHS="-I. -I../lib/replace"
75 echo "$0: running $AUTOHEADER $IPATHS"
76 $AUTOHEADER $IPATHS || exit 1
78 echo "$0: running $AUTOCONF $IPATHS"
79 $AUTOCONF $IPATHS || exit 1
81 rm -rf autom4te*.cache
83 echo "Now run ./configure (or ./configure.developer) and then make."
84 exit 0