The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.
Please select the desired protocol below to get the URL.
This URL has Read-Only access.
main_repo / configure @ e368571f
History | View | Annotate | Download (2.06 KB)
1 |
#! /bin/sh |
---|---|
2 |
|
3 |
# waf configure wrapper |
4 |
|
5 |
# Fancy colors used to beautify the output a bit. |
6 |
# |
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' |
19 |
fi |
20 |
|
21 |
EXIT_SUCCESS=0 |
22 |
EXIT_FAILURE=1 |
23 |
EXIT_ERROR=2 |
24 |
EXIT_BUG=10 |
25 |
|
26 |
CUR_DIR=$PWD |
27 |
|
28 |
#possible relative path |
29 |
WORKINGDIR=`dirname $0` |
30 |
cd $WORKINGDIR |
31 |
#abs path |
32 |
WORKINGDIR=`pwd` |
33 |
cd $CUR_DIR |
34 |
|
35 |
# Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF. |
36 |
# Requires that $PYTHON is set. |
37 |
# |
38 |
checkWAF() |
39 |
{ |
40 |
printf "Checking for WAF\t\t\t: " |
41 |
#installed miniwaf in sourcedir |
42 |
if [ -z "$WAF" ] ; then |
43 |
if [ -f "${WORKINGDIR}/waf" ] ; then |
44 |
WAF="${WORKINGDIR}/waf" |
45 |
if [ ! -x "$WAF" ] ; then |
46 |
chmod +x $WAF |
47 |
fi |
48 |
fi |
49 |
fi |
50 |
if [ -z "$WAF" ] ; then |
51 |
if [ -f "${WORKINGDIR}/waf-light" ] ; then |
52 |
${WORKINGDIR}/waf-light --make-waf |
53 |
WAF="${WORKINGDIR}/waf" |
54 |
fi |
55 |
fi |
56 |
#global installed waf with waf->waf.py link |
57 |
if [ -z "$WAF" ] ; then |
58 |
WAF=`which waf 2>/dev/null` |
59 |
fi |
60 |
# neither waf nor miniwaf could be found |
61 |
if [ ! -x "$WAF" ] ; then |
62 |
printf $RED"not found"$NORMAL"\n" |
63 |
echo "Go to http://code.google.com/p/waf/" |
64 |
echo "and download a waf version" |
65 |
exit $EXIT_FAILURE |
66 |
else |
67 |
printf $GREEN"$WAF"$NORMAL"\n" |
68 |
fi |
69 |
} |
70 |
|
71 |
# Generates a Makefile. Requires that $WAF is set. |
72 |
# |
73 |
generateMakefile() |
74 |
{ |
75 |
cat > Makefile << EOF |
76 |
#!/usr/bin/make -f |
77 |
# Waf Makefile wrapper |
78 |
WAF_HOME=$CUR_DIR |
79 |
|
80 |
all: |
81 |
@$WAF build |
82 |
|
83 |
all-debug: |
84 |
@$WAF -v build |
85 |
|
86 |
all-progress: |
87 |
@$WAF -p build |
88 |
|
89 |
install: |
90 |
if test -n "\$(DESTDIR)"; then \\ |
91 |
$WAF install --yes --destdir="\$(DESTDIR)" ; \\ |
92 |
else \\ |
93 |
$WAF install --yes ; \\ |
94 |
fi; |
95 |
|
96 |
uninstall: |
97 |
@if test -n "\$(DESTDIR)"; then \\ |
98 |
$WAF uninstall --destdir="\$(DESTDIR)" ; \\ |
99 |
else \\ |
100 |
$WAF uninstall ; \\ |
101 |
fi; |
102 |
|
103 |
clean: |
104 |
@$WAF clean |
105 |
|
106 |
distclean: |
107 |
@$WAF distclean |
108 |
@-rm -rf _build_ |
109 |
@-rm -f Makefile |
110 |
|
111 |
check: |
112 |
@$WAF check |
113 |
|
114 |
dist: |
115 |
@$WAF dist |
116 |
|
117 |
.PHONY: clean dist distclean check uninstall install all |
118 |
|
119 |
EOF |
120 |
} |
121 |
|
122 |
checkWAF |
123 |
|
124 |
generateMakefile |
125 |
|
126 |
"${WAF}" configure $* |
127 |
|
128 |
exit $? |