2003-04-11 22:05:07 +04:00
#!/bin/sh
2003-02-04 13:54:01 +03:00
2008-06-17 12:36:51 +04:00
# Run this script to build samba from GIT.
2003-02-04 13:54:01 +03:00
2008-10-08 22:48:01 +04:00
while true; do
case $1 in
2009-01-01 15:28:38 +03:00
--version-file)
2008-10-08 22:48:01 +04:00
VERSION_FILE = $2
shift 2
; ;
2009-01-01 15:28:38 +03:00
*)
2008-10-08 22:48:01 +04:00
break
; ;
esac
done
2003-04-04 04:12:34 +04:00
## insert all possible names (only works with
2008-06-17 12:36:51 +04:00
## autoconf 2.x)
2006-09-19 02:49:20 +04:00
TESTAUTOHEADER = "autoheader autoheader-2.53 autoheader2.50 autoheader259 autoheader253"
TESTAUTOCONF = "autoconf autoconf-2.53 autoconf2.50 autoconf259 autoconf253"
2003-04-04 04:12:34 +04:00
AUTOHEADERFOUND = "0"
AUTOCONFFOUND = "0"
2003-02-04 13:54:01 +03:00
2003-04-04 04:12:34 +04:00
##
## Look for autoheader
2003-02-10 20:31:25 +03:00
##
2003-04-04 04:12:34 +04:00
for i in $TESTAUTOHEADER ; do
2003-04-11 22:05:07 +04:00
if which $i > /dev/null 2>& 1; then
2007-06-07 17:35:39 +04:00
if test ` $i --version | head -n 1 | cut -d. -f 2 | sed "s/[^0-9]//g" ` -ge 53; then
2003-04-04 04:12:34 +04:00
AUTOHEADER = $i
AUTOHEADERFOUND = "1"
break
fi
fi
done
##
## Look for autoconf
2003-02-10 20:31:25 +03:00
##
2003-04-04 04:12:34 +04:00
for i in $TESTAUTOCONF ; do
2003-04-11 22:05:07 +04:00
if which $i > /dev/null 2>& 1; then
2007-06-07 17:35:39 +04:00
if test ` $i --version | head -n 1 | cut -d. -f 2 | sed "s/[^0-9]//g" ` -ge 53; then
2003-04-04 04:12:34 +04:00
AUTOCONF = $i
AUTOCONFFOUND = "1"
break
fi
fi
done
2003-02-10 20:31:25 +03:00
2003-04-04 04:12:34 +04:00
##
## do we have it?
##
2005-02-08 01:21:49 +03:00
if test " $AUTOCONFFOUND " = "0" -o " $AUTOHEADERFOUND " = "0" ; then
2008-06-17 12:36:51 +04:00
echo " $0 : need autoconf 2.53 or later to build samba from GIT " >& 2
2003-04-04 04:12:34 +04:00
exit 1
2003-02-10 20:31:25 +03:00
fi
2004-04-14 12:47:53 +04:00
echo " $0 : running script/mkversion.sh "
2008-10-08 22:48:01 +04:00
./script/mkversion.sh $VERSION_FILE || exit 1
2003-04-04 04:12:34 +04:00
2004-04-14 12:47:53 +04:00
rm -rf autom4te*.cache
2005-01-06 20:25:34 +03:00
rm -f configure include/config.h*
2003-04-04 04:12:34 +04:00
2011-01-25 14:10:25 +03:00
IPATHS = "-Im4 -I../m4 -I../lib/replace"
2003-02-10 20:31:25 +03:00
2006-09-19 02:49:20 +04:00
echo " $0 : running $AUTOHEADER $IPATHS "
$AUTOHEADER $IPATHS || exit 1
echo " $0 : running $AUTOCONF $IPATHS "
$AUTOCONF $IPATHS || exit 1
2003-02-04 13:54:01 +03:00
2004-04-14 12:47:53 +04:00
rm -rf autom4te*.cache
2003-08-20 21:13:38 +04:00
2012-06-05 17:37:00 +04:00
( cd ../examples/VFS || exit 1
echo " $0 : running $AUTOHEADER in ../examples/VFS/ "
$AUTOHEADER || exit 1
echo " $0 : running $AUTOCONF in ../examples/VFS/ "
$AUTOCONF || exit 1
rm -rf autom4te*.cache
) || exit 1
2011-03-25 12:12:52 +03:00
if gcc -E tests/preproc-dummy.c -o /dev/null ;
then
2012-05-17 05:12:07 +04:00
PIDL_OUTPUTDIR = "autoconf/librpc/gen_ndr" CPP = "gcc -E" PIDL = ../pidl/pidl \
2011-03-25 12:12:52 +03:00
srcdir = . ../librpc/build_idl.sh ../librpc/idl/*.idl
2012-05-17 05:12:07 +04:00
PIDL_OUTPUTDIR = "autoconf/librpc/gen_ndr" CPP = "gcc -E" PIDL = ../pidl/pidl \
2011-03-25 12:12:52 +03:00
srcdir = . script/build_idl.sh librpc/idl/*.idl
else
echo "Warning: Could not compile idl files in autogen, "
echo "some autconf tests might not work properly"
fi
2012-06-15 06:34:28 +04:00
perl ../script/mkparamdefs.pl ../lib/param/param_functions.c --file autoconf/lib/param/param_local.h --generate-scope= LOCAL
perl ../script/mkparamdefs.pl ../lib/param/loadparm.c ../lib/param/param_functions.c --file autoconf/lib/param/param_global.h --generate-scope= GLOBAL
perl ../script/mkparamdefs.pl param/loadparm.c ../lib/param/param_functions.c --file autoconf/source3/param/param_global.h --generate-scope= GLOBAL
2012-06-18 12:31:09 +04:00
perl ../source4/script/mkproto.pl ../lib/param/loadparm.c ../lib/param/param_functions.c --public autoconf/lib/param/param_proto.h --private autoconf/lib/param/param_proto.h
2012-06-15 06:34:28 +04:00
perl ../script/mks3param.pl ../lib/param/loadparm.c ../lib/param/param_functions.c --file autoconf/lib/param/s3_param.h
2011-10-13 15:53:20 +04:00
2009-09-06 14:01:05 +04:00
echo "Now run ./configure (or ./configure.developer) and then make."
2003-02-04 13:54:01 +03:00
exit 0
2003-04-04 04:12:34 +04:00