s4:WAF buildsystem - support out of "source4" directory builds
[samba.git] / source4 / autogen-waf.sh
1 #!/bin/sh
2
3 p=`dirname $0`
4
5 echo "Setting up for waf build"
6
7 echo "Looking for the buildtools directory"
8
9 d="buildtools"
10 while test \! -d "$p/$d"; do d="../$d"; done
11
12 echo "Found buildtools in $p/$d"
13
14 echo "Setting up configure"
15 rm -f $p/configure
16 sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure
17 chmod +x $p/configure
18
19 echo "Setting up makefile"
20 # this relies on the fact that make looks for 'makefile' before 'Makefile'
21 rm -f $p/makefile
22 sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/makefile
23
24 echo "done. Now run $p/configure or $p/configure.developer then make."
25 if [ $p != "." ]; then
26         echo "Notice: The build invoke path is not 'source4'! Use make with the parameter"
27         echo "-C <'source4' path>. Example: make -C source4 all"
28 fi