-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·162 lines (154 loc) · 2.7 KB
/
build.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
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
#!/bin/sh
BASE_PATH=`dirname $0`
PROJECT_ROOT=$BASE_PATH
# get default type
case `uname -o` in
*Linux*|*linux*)
if test `uname -m` = "x86_64"; then
type=linux_64
else
type=linux_32
fi
;;
esac
# parse arugments
debugFlag=0
helpFlag=0
n=0
while test $# != 0; do
case $1 in
-h | --help)
helpFlag=1
shift
;;
-d | --debug)
debugFlag=1
shift
;;
--)
shift
break
;;
-*)
$ECHO >&2 "ERROR: unknown option '$1'"
exit 1
;;
*)
case $1 in
linux)
if test `uname -m` = "x86_64"; then
type=linux_64
else
type=linux_32
fi
;;
linux_32)
type=linux
;;
linux_64)
type=linux
;;
win32)
if test `uname -m` = "x86_64"; then
type=win32_64
else
type=win32_32
fi
;;
win32_32)
type=win32_32
;;
win32_64)
type=win32_64
;;
*)
echo >&2 ERROR: unsupported type '$1'!
exit 1
;;
esac
shift
;;
esac
done
while test $# != 0; do
case $1 in
linux)
if test `uname -m` = "x86_64"; then
type=linux_64
else
type=linux_32
fi
;;
linux_32)
type=linux
;;
linux_64)
type=linux
;;
win32)
if test `uname -m` = "x86_64"; then
type=win32_64
else
type=win32_32
fi
;;
win32_32)
type=win32_32
;;
win32_64)
type=win32_64
;;
*)
echo >&2 ERROR: unsupported type '$1'!
exit 1
;;
esac
shift
done
if test $helpFlag -eq 1; then
echo "Usage: $0 [options] linux|linux_32|linux_64|win32|win32_32|win32_64"
echo ""
echo "Options: -h|--help print help"
exit 0
fi
# check arguments
if test -z "$type"; then
echo >&2 ERROR: no type given!
fi
# build
$PROJECT_ROOT/download-third-party-packages.sh \
--no-verbose \
$ADDITIONAL_DOWNLOAD_FLAGS
case $type in
linux_32)
$PROJECT_ROOT/configure \
;
;;
linux_64)
$PROJECT_ROOT/configure \
;
;;
win32_32)
$PROJECT_ROOT/configure \
--host=i686-w64-mingw32 \
--build=x86_64-linux \
--disable-link-static \
--enable-link-dynamic \
--disable-bfd \
--disable-epm \
;
;;
win32_64)
$PROJECT_ROOT/configure \
--host=x86_64-w64-mingw32 \
--build=x86_64-linux \
--disable-link-static \
--enable-link-dynamic \
--disable-bfd \
--disable-epm \
;
;;
esac
make
make install DESTDIR=$PWD/tmp DIST=1 SYSTEM=Windows
exit 0