cpplint: fixed import. The version on pypi is now up to date and works with Python3.
[waf.git] / configure
blob03fab4b16aa6d091d8c79bd0795995f9e9e7fa39
1 #! /bin/sh
3 # waf configure wrapper
5 # Fancy colors used to beautify the output a bit.
7 if [ "$NOCOLOR" ] ; then
8 NORMAL=""
9 BOLD=""
10 RED=""
11 YELLOW=""
12 GREEN=""
13 else
14 NORMAL='\033[0m'
15 BOLD='\033[01;1m'
16 RED='\033[01;91m'
17 YELLOW='\033[00;33m'
18 GREEN='\033[01;92m'
21 EXIT_SUCCESS=0
22 EXIT_FAILURE=1
23 EXIT_ERROR=2
24 EXIT_BUG=10
26 CUR_DIR=$PWD
28 #possible relative path
29 WORKINGDIR=`dirname $0`
30 cd $WORKINGDIR
31 #abs path
32 WORKINGDIR=`pwd`
33 cd $CUR_DIR
36 # Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
37 # Requires that $PYTHON is set.
39 checkWAF()
41 printf "Checking for WAF\t\t\t: "
42 #installed miniwaf in sourcedir
43 if [ -z "$WAF" ] ; then
44 if [ -f "${WORKINGDIR}/waf" ] ; then
45 WAF="${WORKINGDIR}/waf"
46 if [ ! -x "$WAF" ] ; then
47 chmod +x $WAF
51 if [ -z "$WAF" ] ; then
52 if [ -f "${WORKINGDIR}/waf-light" ] ; then
53 ${WORKINGDIR}/waf-light --make-waf
54 WAF="${WORKINGDIR}/waf"
57 #global installed waf with waf->waf.py link
58 if [ -z "$WAF" ] ; then
59 WAF=`which waf 2>/dev/null`
61 # neither waf nor miniwaf could be found
62 if [ ! -x "$WAF" ] ; then
63 printf "$RED""not found""$NORMAL""\n"
64 echo "Go to http://code.google.com/p/waf/"
65 echo "and download a waf version"
66 exit $EXIT_FAILURE
67 else
68 printf "$GREEN""$WAF""$NORMAL""\n"
72 # Generates a Makefile. Requires that $WAF is set.
74 generateMakefile()
76 cat > Makefile << EOF
77 #!/usr/bin/make -f
78 # Waf Makefile wrapper
79 WAF_HOME=$CUR_DIR
81 all:
82 #@$WAF build
84 all-debug:
85 @$WAF -v build
87 all-progress:
88 @$WAF -p build
90 install:
91 $WAF install --yes;
93 uninstall:
94 $WAF uninstall
96 clean:
97 @$WAF clean
99 distclean:
100 @$WAF distclean
101 @-rm -rf build
102 @-rm -f Makefile
104 check:
105 @$WAF check
107 dist:
108 @$WAF dist
110 .PHONY: clean dist distclean check uninstall install all
115 checkWAF
116 generateMakefile
118 "${WAF}" configure $*
119 exit $?