-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommon.sh
More file actions
executable file
·165 lines (140 loc) · 3.39 KB
/
Copy pathcommon.sh
File metadata and controls
executable file
·165 lines (140 loc) · 3.39 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# common script functionality
# variables exported
# script_dir = script directory, absolute path
# build_suffix= suffix of builddir: [webkit1|]-[armel|i386|host]-[m6]
set -e
die() {
echo "$0: error: $1"
exit 1
}
is_sbox() {
if [ -z "$SBOX_UNAME_MACHINE" ]; then
return 1
fi
return 0
}
is_macos() {
test "$(uname)" == "Darwin"
return $?
}
if is_macos; then
type greadlink >/dev/null 2>&1 || {
echo >&2 "greadlink is not installed. Aborting."
echo >&2 " greadlink can for example be installed using homebrew."
echo >&2 " use: brew install coreutils";
exit 1;
}
readlink() {
# Assume GNU tools are installed
greadlink $*
}
fi
script_file=`readlink -f $0`
script_dir=`dirname $script_file`
shared_dir=$script_dir/..
qt5_dir=$shared_dir/qt5
qtcomponents_dir=$shared_dir/qt-components
webkit_dir=$shared_dir/webkit
#default to host m6 build
device_target=${device_target:-"host"}
meego_target="m6"
d=`dirname $0`
if is_sbox; then
sudo="fakeroot"
device_target="$SBOX_DPKG_INST_ARCH"
else
sudo="sudo"
fi
# export DEB_BUILD_OPTIONS=parallel=30 if you want 30 jobs
parallel_jobs=$(echo $DEB_BUILD_OPTIONS | sed -e 's/.*parallel=\([0-9]\+\).*/\1/')
if [ -n "$parallel_jobs" ]; then
if [ "$parallel_jobs" = "$DEB_BUILD_OPTIONS" ]; then
parallel_jobs=""
fi
fi
if [ -z "$parallel_jobs" ]; then
if [ -f /proc/cpuinfo ]; then
parallel_jobs=$(expr $(grep 'processor' /proc/cpuinfo | wc -l) \* 2 + 1)
fi
fi
if [ -z "$parallel_jobs" ]; then
# most people have dual-cores..
parallel_jobs=3
fi
makeargs=${makeargs:-"-j${parallel_jobs}"}
browser_buildmode=debug
webkit_buildmode=--release
webkit_buildmodedir=Release
webkit="qtwebkit-webkit2-dev"
release=
valgrind=
clean=
with_icecc=
while [ $# -gt 0 ]; do
case $1 in
--release)
release=1
browser_buildmode=release
shift
;;
--webkit_release)
webkit_buildmode=--release
webkit_buildmodedir=Release
shift
;;
--m6)
meego_target="m6"
shift
;;
--cross-compile)
. $script_dir/setup-madde-toolchain.sh
if [ $? != 0 ]; then
exit $?
fi
device_target=xarmel
shift
;;
--with-icecc)
with_icecc=true
shift
;;
--webkit_debug)
webkit_buildmode=--debug
webkit_buildmodedir=Debug
shift
;;
--valgrind)
valgrind=1
shift
;;
--clean)
clean=1
shift
;;
*)
die "unknown flag $1"
break
;;
esac
done
if [ -n "$with_icecc" -a $device_target=="xarmel" -a -x $script_dir/../setup-icecc-cross-env.sh ]; then
. $script_dir/../setup-icecc-cross-env.sh
fi
is_release() {
if [ -z "$release" ]; then
return 1
fi
return
}
qmake_buildmode="CONFIG+=debug CONFIG-=release"
if is_release; then
qmake_buildmode="CONFIG+=release CONFIG-=debug"
fi
build_suffix=$device_target-$meego_target
qmake_valgrind=""
valgrind_target=""
if [ -n "$valgrind" ]; then
qmake_valgrind="--qmakearg=CONFIG+=valgrind"
valgrind_target="-valgrind"
fi
build_suffix=$device_target-$meego_target$valgrind_target