-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwaf
executable file
·53 lines (49 loc) · 1.33 KB
/
waf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# script alias to the waf engine script
# It also allows to run any other program in the build environment
# source the environment only if DEVTOOLS_COMPUTER_ID is not already defined
printf "checking environment... "
if [ -z "$DEVTOOLS_COMPUTER_ID" ]; then
env='unstable'
[ `hg branch 2> /dev/null | egrep -c 'v[0-9]+'` -eq 1 ] && env='stable-updates'
[ "${WAF_SUFFIX}" = "mpi" ] && env=${env}_${WAF_SUFFIX}
fenv=$HOME/dev/codeaster/devtools/etc/env_${env}.sh
if [ -e ${fenv} ]; then
. ${fenv}
echo "loading ${fenv}"
else
echo "no found"
fi
else
echo "already set"
fi
# call waf.engine or another program?
if [ $# -lt 1 ]; then
# no argument: use waf
true
elif [[ $1 =~ ^\- ]]; then
# start with hiphen: suppose to be a waf option
true
else
# is the first argument a waf command ?
wafcmd=(build buildelem clean configure dist distcheck distclean \
i18n install list step test uninstall)
found=0
# remove '_debug' suffix
called=${1//_debug/}
for cmd in ${wafcmd[@]}
do
if [ "$called" = "$cmd" ]; then
found=1
break
fi
done
if [ ${found} -eq 0 ]; then
# not a waf command, call passed command line
"${@}"
exit $?
fi
fi
# execute waf
${0}.engine "${@}"
exit $?