-
Notifications
You must be signed in to change notification settings - Fork 9
/
build-win32-cldc.sh
218 lines (206 loc) · 5.78 KB
/
build-win32-cldc.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#!/bin/sh
USAGE="`basename $0`: [-CTcdghjmnp] [-r rootdir] [-J JDK_DIR]"
HELP="Options:
-C performs a clean before building
-c build CLDC HI
-d debug build
-e erase build output / clean
-h print this help information
-j build javacall_impl
-m build midp
-n use NAMS
-p build pcsl
-T compile THUMB mode
-J JDK_DIR specify the JDK directory (i.e. c:/jdk1.4)
-r rootdir use <rootdir> as the root of the tree for building"
BUILD_TARGET=WIN32_JAVACALL
unset DEBUG_OPTION
unset MIDP_DEBUG_OPTION
unset CLEAN
unset BUILD_JAVACALL_IMPL
unset BUILD_PCSL
unset BUILD_CLDC
unset ERASE_BUILD_OUTPUT
unset BUILD_MIDP
USE_NAMS=false
ENABLE_THUMB=false
USE_NOKIA_UI=true
USE_PSPKVM_EXT=true
USE_JSR_75=true
USE_JSR_179=true
USE_JSR_172=true
USE_JSR_226=true
while getopts \?J:CTcdDehjmnpr: c
do
case $c in
C) CLEAN="true";;
J) JDK_DIR=$OPTARG
export JDK_DIR;;
c) BUILD_CLDC="true";;
d) DEBUG_OPTION="USE_DEBUG=true"
MIDP_DEBUG_OPTION="USE_DEBUG=true";;
D) DEBUG_OPTION="USE_DEBUG=true"
MIDP_DEBUG_OPTION="USE_CLDC_RELEASE=true";;
e) ERASE_BUILD_OUTPUT="true";CLEAN="true";;
h) echo "${USAGE}"
echo "${HELP}"
exit 2;;
j) BUILD_JAVACALL_IMPL="true";;
m) BUILD_MIDP="true";;
n) USE_NAMS=true;;
p) BUILD_PCSL="true";;
r) WS_ROOT=$OPTARG;;
T) ENABLE_THUMB=true;;
\?) echo "${USAGE}"
echo "${HELP}"
exit 2;;
esac
done
echo
echo
echo "-------------- BUILD ${BUILD_TARGET}----------------"
if [ -z "${WS_ROOT}" ]
then
WS_ROOT=`pwd`
echo WS_ROOT not specified using ${WS_ROOT}
fi
if [ -z "${BUILD_JAVACALL_IMPL}" -a -z "${BUILD_PCSL}" -a -z "${BUILD_CLDC}" -a -z "${BUILD_MIDP}" ]
then
BUILD_JAVACALL_IMPL=true
BUILD_PCSL=true
BUILD_CLDC=true
BUILD_MIDP=true
fi
JAVACALL_DIR=${WS_ROOT}/javacall
PCSL_DIR=${WS_ROOT}/pcsl
CLDC_DIR=${WS_ROOT}/cldc
MIDP_DIR=${WS_ROOT}/midp
RESTRICTED_CRYPTO_DIR=${WS_ROOT}/restricted_crypto
TOOLS_DIR=${WS_ROOT}/tools
JSR_120_DIR=${WS_ROOT}/jsr120
NOKIA_UI_DIR=${WS_ROOT}/ext/nokia
PSPKVM_EXT_DIR=${WS_ROOT}/ext/pspkvm
JSR_179_DIR=${WS_ROOT}/jsr179
JSR_172_DIR=${WS_ROOT}/jsr172
JSR_226_DIR=${WS_ROOT}/jsr226
PISCES_DIR=${WS_ROOT}/pisces
#PSPDEV_GNU_TOOLS_DIR=`psp-config -P`
PSPDEV_GNU_TOOLS_DIR=
#JAVACALL_OUTPUT_DIR=${JAVACALL_DIR}/configuration/phoneMEFeature/psp_mips/output
JAVACALL_OUTPUT_DIR=${JAVACALL_DIR}/configuration/phoneMEFeature/win32_x86/output
PCSL_OUTPUT_DIR=${PCSL_DIR}/output
if [ "${BUILD_JAVACALL_IMPL}" = "true" ]
then
BUILDMODULE=${JAVACALL_DIR}/configuration/phoneMEFeature/win32_x86
cd ${BUILDMODULE}
if [ "${CLEAN}" = "true" ]; then
echo "Cleaning: ${BUILDMODULE}"
rm -rf ${JAVACALL_OUTPUT_DIR}
fi
if [ "${ERASE_BUILD_OUTPUT}" != "true" ]; then
echo "Building: ${BUILDMODULE}"
make USE_NATIVE_AMS=${USE_NAMS} \
JAVACALL_DIR=${JAVACALL_DIR} \
JAVACALL_OUTPUT_DIR=${JAVACALL_OUTPUT_DIR} \
ENABLE_THUMB=${ENABLE_THUMB} \
USE_JSR_75=${USE_JSR_75} \
USE_JSR_179=${USE_JSR_179} \
USE_PROPERTIES_FROM_FS=true \
${DEBUG_OPTION}
fi
if [ $? != 0 ];then
echo make failed for ${BUILD_TARGET} module ${BUILDMODULE}
exit 1
fi
fi
if [ "${BUILD_PCSL}" = "true" ]
then
BUILDMODULE=${PCSL_DIR}
cd ${BUILDMODULE}
if [ "${CLEAN}" = "true" ]; then
echo "Cleaning: ${BUILDMODULE}"
rm -rf ${PCSL_OUTPUT_DIR}
fi
if [ "${ERASE_BUILD_OUTPUT}" != "true" ]; then
echo "Building: ${BUILDMODULE}"
make JAVACALL_OUTPUT_DIR=${JAVACALL_OUTPUT_DIR} \
PCSL_PLATFORM=javacall_i386_vc \
PCSL_OUTPUT_DIR=${PCSL_OUTPUT_DIR} \
ENABLE_THUMB=${ENABLE_THUMB} \
GNU_TOOLS_DIR=${PSPDEV_GNU_TOOLS_DIR} \
${DEBUG_OPTION}
fi
if [ $? != 0 ];then
echo make failed for ${BUILD_TARGET} module ${BUILDMODULE}
exit 1
fi
fi
if [ "${BUILD_CLDC}" = "true" ]
then
BUILDMODULE=${CLDC_DIR}/build/javacall_i386_vc
cd ${BUILDMODULE}
if [ "${CLEAN}" = "true" ]; then
echo "Cleaning: ${BUILDMODULE}"
rm -rf dist loopgen romgen target tools ../classes ../tmpclasses ../classes.zip
fi
if [ "${ERASE_BUILD_OUTPUT}" != "true" ]; then
echo "Building: ${BUILDMODULE}"
make JDK_DIR=${JDK_DIR} \
ENABLE_ISOLATES=true \
ENABLE_PCSL=true \
PCSL_OUTPUT_DIR=${PCSL_OUTPUT_DIR} \
PCSL_DIST_DIR=${PCSL_OUTPUT_DIR}/javacall_i386 \
JAVACALL_OUTPUT_DIR=${JAVACALL_OUTPUT_DIR} \
JVMWorkSpace=${CLDC_DIR} \
${DEBUG_OPTION}
fi
if [ $? != 0 ];then
echo make failed for ${BUILD_TARGET} module ${BUILDMODULE}
exit 1
fi
fi
if [ "${BUILD_MIDP}" = "true" ]
then
BUILDMODULE=${MIDP_DIR}/build/javacall
cd ${BUILDMODULE}
if [ "${CLEAN}" = "true" ]; then
echo "Cleaning: ${BUILDMODULE}"
rm -rf output
fi
if [ "${ERASE_BUILD_OUTPUT}" != "true" ]; then
echo "Building: ${BUILDMODULE}"
make JDK_DIR=${JDK_DIR} \
USE_NATIVE_AMS=${USE_NAMS} \
ENABLE_THUMB=${ENABLE_THUMB} \
JAVACALL_PLATFORM=win32_i386_vc \
JAVACALL_OUTPUT_DIR=${JAVACALL_OUTPUT_DIR} \
PCSL_OUTPUT_DIR=${PCSL_OUTPUT_DIR} \
CLDC_DIST_DIR=${CLDC_DIR}/build/javacall_i386_vc/dist \
TOOLS_DIR=${TOOLS_DIR} \
RESTRICTED_CRYPTO_DIR=${RESTRICTED_CRYPTO_DIR} \
USE_JSR_75=${USE_JSR_75} \
JSR_75_DIR=${WS_ROOT}/jsr75 \
JSR_120_DIR=${JSR_120_DIR} \
USE_JSR_179=${USE_JSR_179} \
JSR_179_DIR=${JSR_179_DIR} \
USE_NOKIA_UI=${USE_NOKIA_UI} \
NOKIA_UI_DIR=${NOKIA_UI_DIR} \
USE_PSPKVM_EXT=${USE_PSPKVM_EXT} \
PSPKVM_EXT_DIR=${PSPKVM_EXT_DIR} \
USE_MULTIPLE_ISOLATES=true \
skip_ams_executables=false \
SOFT_KEYBOARD_ENABLED=true \
JSR_172_DIR=${JSR_172_DIR} \
USE_JSR_172=${USE_JSR_172} \
USE_JSR_226=${USE_JSR_226} \
JSR_226_DIR=${JSR_226_DIR} \
PISCES_DIR=${PISCES_DIR} \
${MIDP_DEBUG_OPTION}
if [ $? != 0 ];then
echo make failed for ${BUILD_TARGET} module ${BUILDMODULE}
exit 1
else
echo "Done! Go to midp/build/javacall/output, run runPhoneME.bat"
fi
fi
fi