-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.sh
executable file
·94 lines (80 loc) · 1.52 KB
/
configure.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
set -euo pipefail
gypfile="${GYPFILE:-XMUtil.gyp}"
rmout="${rmout:-yes}"
quiet=no
msvs=no
xcode=no
ui=no
gyp_ui=0
arch_id=64
x86=yes
mac_arch=x86_64
usage() {
cat <<EOF
usage: $0 [--use-xcode] [--use-msvs] [-q] [--with-ui]
This bootstraps the gyp build system.
EOF
}
for arg in "$@"
do
case $arg in
--use-xcode)
xcode=yes
;;
--use-msvs)
msvs=yes
;;
--32bit)
arch_id=32
x86=yes
;;
--64bit)
arch_id=64
x86=no
;;
--mac-arm)
mac_arch=arm64
;;
--with-ui)
ui=yes
gyp_ui=1
;;
-q)
quiet=yes
;;
--help)
usage
exit
;;
esac
done
source ./build/environment.sh
if [ $ui = 'yes' ]; then
. ./qt_generate.sh
fi
if [ $xcode = 'yes' ]; then
generator=xcode
elif [ $msvs = 'yes' ]; then
generator=msvs
else
generator=ninja
fi
if [[ $arch_id = '32' && $x86 = 'yes' ]]; then
export CC="${CC:-cc} -m32 -march=prescott"
export CXX="${CXX:-cxx} -m32 -march=prescott"
fi
export GYP_GENERATORS=$generator
export GYPDEFS="-Dqtdir=$QTDIR -Dwith_ui=$gyp_ui"
"./build/bin/gyp" -Darch_id=$arch_id -Dcwd=`pwd` $GYPDEFS $gypfile --toplevel-dir=`pwd` --depth=0
result=$?
if [ $quiet = 'no' ]; then
echo "configured with:"
echo " xcode generation: $xcode"
echo " msvs generation: $msvs"
echo " with ui: $ui"
echo " x86: $x86"
echo " CC: ${CC:-<default>}"
echo " CXX: ${CXX:-<default>}"
fi
exit $result