ui: add QRadioButton to the stylesheet
[git-cola.git] / configure
blob3ff1ec73ca7f3a57ba0712ee4ab1fc9a386945e0
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[1m"
16 RED="\033[91m"
17 YELLOW="\033[01;93m"
18 GREEN="\033[92m"
21 EXIT_SUCCESS=0
22 EXIT_FAILURE=1
23 EXIT_ERROR=2
24 EXIT_BUG=10
26 cd $(dirname $0)
28 # Get the absolute path
29 WORKINGDIR="$PWD"
31 # We store waf under build/
32 PATH="$WORKINGDIR"/build:"$PATH"
33 export PATH
35 # Checks for Python interpreter. Honours $PYTHON if set. Stores path to
36 # interpreter in $PYTHON.
38 checkPython()
40 if [ -z "$PYTHON" ] ; then
41 PYTHON=$(which python 2>/dev/null)
43 printf "Checking for Python\t\t\t: "
44 if [ ! -x "$PYTHON" ] ; then
45 printf $RED"not found!"$NORMAL"\n"
46 echo "Please make sure that the Python interpreter is available in your PATH"
47 echo "or invoke configure using the PYTHON flag, e.g."
48 echo "$ PYTHON=/usr/local/bin/python configure"
49 exit $EXIT_FAILURE
51 printf $GREEN"$PYTHON"$NORMAL"\n"
54 # Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
55 # Requires that $PYTHON is set.
57 checkWAF()
59 #installed miniwaf in sourcedir
60 if test -z "$WAF"; then
61 if test -f "$WORKINGDIR"/build/waf; then
62 WAF="$WORKINGDIR"/build/waf
65 #global installed waf with waf->waf.py link
66 if test -z "$WAF"; then
67 WAF=$(which waf 2>/dev/null)
69 # neither waf nor miniwaf could be found
70 if [ ! -x "$WAF" ] ; then
71 printf $RED"not found"$NORMAL"\n"
72 echo "Goto http://code.google.com/p/waf/"
73 echo "and download a waf version"
74 exit $EXIT_FAILURE
75 else
76 printf $GREEN"$WAF"$NORMAL"\n"
78 # Simplify the Makefile
79 WAFPATH="$WAF"
80 if [ "$WAFPATH" = "$WORKINGDIR"/build/waf ]; then
81 WAFPATH="\$(CURDIR)/build/waf"
85 # Generates a Makefile. Requires that $WAFPATH is set.
87 generateMakefile()
89 cat > Makefile << EOF
90 #!/usr/bin/make -f
92 # Waf Makefile wrapper
93 # http://code.google.com/p/waf/
94 PYTHON=$PYTHON
95 WAF=$WAFPATH
97 all:
98 @\$(PYTHON) \$(WAF) build
100 all_debug:
101 @\$(PYTHON) \$(WAF) -v build
103 all_progress:
104 @\$(PYTHON) \$(WAF) -p build
106 install:
107 @\$(PYTHON) \$(WAF) install
109 uninstall:
110 @\$(PYTHON) \$(WAF) uninstall
112 clean:
113 @\$(PYTHON) \$(WAF) clean
115 distclean:
116 @\$(PYTHON) \$(WAF) distclean
117 @-rm -rf cache/
118 @-rm -rf _build_
119 @-rm -f Makefile
121 check:
122 @\$(PYTHON) \$(WAF) check
124 dist:
125 @\$(PYTHON) \$(WAF) dist
127 test:
128 @\$(CURDIR)/t/run_tests
133 checkPython
134 checkWAF
136 echo "calling waf configure with parameters"
137 $WAF configure $* || exit $EXIT_ERROR
139 #create a Makefile if waf configure succeeds
140 if test -f "$WORKINGDIR"/.lock-wscript; then
141 generateMakefile
143 exit $EXIT_SUCCESS