Created net gpo and new libgpo for samba 4. This adds the init function which finds...
[Samba.git] / source4 / autogen-autotools.sh
blob22e35e0316762511ef1b09df434aebc237ed5223
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*
72 rm -f makefile Makefile
74 IPATHS="-I. -I../lib/replace"
76 echo "$0: running $AUTOHEADER $IPATHS"
77 $AUTOHEADER $IPATHS || exit 1
79 echo "$0: running $AUTOCONF $IPATHS"
80 $AUTOCONF $IPATHS || exit 1
82 rm -rf autom4te*.cache
84 echo "Now run ./configure (or ./configure.developer) and then make."
85 exit 0