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.

Statistics
| Branch: | Revision:

main_repo / configure @ 90fc8d36

History | View | Annotate | Download (2.03 KB)

1
#! /bin/sh
2

    
3
# waf configure wrapper
4

    
5
# Fancy colors used to beautify the output a bit.
6
#
7
NORMAL=""
8
BOLD=""
9
RED=""
10
YELLOW=""
11
GREEN=""
12

    
13
EXIT_SUCCESS=0
14
EXIT_FAILURE=1
15
EXIT_ERROR=2
16
EXIT_BUG=10
17

    
18
CUR_DIR=$PWD
19

    
20
#possible relative path
21
WORKINGDIR=`dirname $0`
22
cd $WORKINGDIR
23
#abs path
24
WORKINGDIR=`pwd`
25
cd $CUR_DIR
26

    
27
# Checks for WAF. Honours $WAF if set. Stores path to 'waf' in $WAF.
28
# Requires that $PYTHON is set.
29
#
30
checkWAF()
31
{
32
	printf "Checking for WAF\t\t\t:  "
33
	#installed miniwaf in sourcedir
34
	if [ -z "$WAF" ] ; then
35
	    if [ -f "${WORKINGDIR}/waf" ] ; then
36
		WAF="${WORKINGDIR}/waf"
37
		if [ ! -x "$WAF" ] ; then
38
		    chmod +x $WAF
39
		fi
40
	    fi
41
	fi
42
	if [ -z "$WAF" ] ; then
43
	    if [ -f "${WORKINGDIR}/waf-light" ] ; then
44
		${WORKINGDIR}/waf-light --make-waf
45
	        WAF="${WORKINGDIR}/waf"
46
	    fi
47
	fi
48
	#global installed waf with waf->waf.py link
49
	if [ -z "$WAF" ] ; then
50
	    WAF=`which waf 2>/dev/null`
51
	fi
52
	# neither waf nor miniwaf could be found
53
	if [ ! -x "$WAF" ] ; then
54
	    printf $RED"not found"$NORMAL"\n"
55
	    echo "Go to http://code.google.com/p/waf/"
56
	    echo "and download a waf version"
57
	    exit $EXIT_FAILURE
58
	else
59
	  printf $GREEN"$WAF"$NORMAL"\n"
60
	fi
61
}
62

    
63
# Generates a Makefile. Requires that $WAF is set.
64
#
65
generateMakefile()
66
{
67
	cat > Makefile << EOF
68
#!/usr/bin/make -f
69
# Waf Makefile wrapper
70
WAF_HOME=$CUR_DIR
71

    
72
all:
73
	@$WAF build
74

    
75
all-debug:
76
	@$WAF -v build
77

    
78
all-progress:
79
	@$WAF -p build
80

    
81
install:
82
	if test -n "\$(DESTDIR)"; then \\
83
	    $WAF install --destdir="\$(DESTDIR)" ; \\
84
	else \\
85
	    $WAF install ; \\
86
	fi;
87

    
88
uninstall:
89
	@if test -n "\$(DESTDIR)"; then \\
90
	    $WAF uninstall --destdir="\$(DESTDIR)" ; \\
91
	else \\
92
	    $WAF uninstall ; \\
93
	fi;
94
 
95
test: all
96
	@for i in test/test*.js; do \\
97
		echo -n "\$\$i: "; \\
98
		build/default/node \$\$i && echo pass || echo fail; \\
99
	done 
100

    
101
clean:
102
	@$WAF clean
103

    
104
distclean:
105
	@$WAF distclean
106
	@-rm -rf _build_
107
	@-rm -f Makefile
108
	@-rm -f *.pyc
109

    
110
check:
111
	@$WAF check
112

    
113
dist:
114
	@$WAF dist
115

    
116
.PHONY: clean dist distclean check uninstall install all test
117

    
118
EOF
119
}
120

    
121
checkWAF
122

    
123
generateMakefile
124

    
125
"${WAF}" configure $*
126

    
127
exit $?