-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwaf_variant
executable file
·57 lines (50 loc) · 1.73 KB
/
waf_variant
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
54
55
56
57
#!/bin/bash
# --------------------------------------------------------------------
# Copyright (C) 1991 - 2023 - EDF R&D - www.code-aster.org
# This file is part of code_aster.
#
# code_aster is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# code_aster is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with code_aster. If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------------------
WAF_SUFFIX=`basename $0 | sed 's/^waf_//'`
if [ ${WAF_SUFFIX} = "waf" ]; then
WAF_SUFFIX=$(readlink $0 | sed 's/^waf_//')
fi
WAF_DEFAULT_VARIANT=""
if [ ${WAF_SUFFIX} = "debug" ]; then
WAF_SUFFIX="mpi"
WAF_DEFAULT_VARIANT="debug"
fi
if [ ${WAF_SUFFIX} = "std" ]; then
export ENABLE_MPI=0
fi
export WAF_SUFFIX
export WAF_DEFAULT_VARIANT
export WAFLOCK=.lock-${WAF_SUFFIX}${WAF_DEFAULT_VARIANT}_build
# default arguments value
builddir="build/${WAF_SUFFIX}"${WAF_DEFAULT_VARIANT}
jobs=4
# backup original arguments
orig=("$@")
OPTS=$(getopt --quiet -o o:j: --long out:,jobs: -n $(basename $0) -- "$@")
eval set -- "$OPTS"
while true; do
case "$1" in
-o | --out ) builddir="$2"; shift ;;
-j | --jobs ) jobs="$2"; shift ;;
-- ) shift; break ;;
* ) break ;;
esac
shift
done
./waf.main "${orig[@]}" --out=${builddir} --jobs=${jobs}