Merge remote branch 'upstream/master'
[mono.git] / nacl / nacl64-mono.sh
1 #!/bin/bash
2
3 # nacl64-mono.sh
4 #
5 # usage:  nacl64-mono.sh
6 #
7 # this script builds a compiler for 64-bit NaCl code
8 # (installed in ./compiler folder)
9 #
10
11 readonly MONO_TRUNK_NACL=$(pwd)
12
13 readonly PACKAGE_NAME=nacl64-mono-build
14
15 readonly INSTALL_PATH=${MONO_TRUNK_NACL}/compiler
16
17 source common.sh
18 source nacl-common.sh
19
20
21 CustomConfigureStep() {
22   Banner "Configuring ${PACKAGE_NAME}"
23   set +e
24   cd ${PACKAGE_NAME}
25   make distclean
26   cd ${MONO_TRUNK_NACL}
27   set -e
28   Remove ${PACKAGE_NAME}
29   MakeDir ${PACKAGE_NAME}
30   cd ${PACKAGE_NAME}
31   cp ../nacl64-mono-config-cache ../nacl64-mono-config-cache.temp
32   if [ $HOST_BITSIZE = "64" ]; then
33     ../../configure \
34       CFLAGS="-O0" CXXFLAGS="-O0" CC='cc -m32' CXX='g++ -m32' \
35       --host=i386-pc-linux \
36       --build=amd64-pc-linux \
37       --target=nacl64 \
38       --prefix=${INSTALL_PATH} \
39       --with-tls=pthread \
40       --enable-nacl-codegen \
41       --disable-mono-debugger \
42       --disable-mcs-build \
43       --with-sigaltstack=no \
44       --cache-file=../nacl64-mono-config-cache.temp
45   else
46     ../../configure \
47       --target=nacl64 \
48       --prefix=${INSTALL_PATH} \
49       --with-tls=pthread \
50       --enable-nacl-codegen \
51       --disable-mono-debugger \
52       --disable-mcs-build \
53       --with-sigaltstack=no \
54       --cache-file=../nacl64-mono-config-cache.temp
55   fi
56   
57
58   rm ../nacl64-mono-config-cache.temp
59 }
60
61 CustomBuildStep() {
62   MONO_NACL_ALIGN_MASK_OFF=1 make -j4
63 }
64
65 CustomInstallStep() {
66   MONO_NACL_ALIGN_MASK_OFF=1 make install
67 }
68
69 CustomPackageInstall() {
70   CustomConfigureStep
71   #CustomBuildStep
72   #CustomInstallStep
73   DefaultBuildStep
74   DefaultInstallStep
75 }
76
77
78 CustomPackageInstall
79 exit 0