[msvc] Update csproj files (#4479)
[mono.git] / nacl / nacl-runtime-mono.sh
1 #!/bin/bash
2 # Copyright (c) 2009 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that be
4 # found in the LICENSE file.
5 #
6
7 # nacl-runtime-mono.sh
8 #
9 # usage:  nacl-runtime-mono.sh
10 #
11 # this script builds mono runtime for Native Client 
12 #
13
14 readonly MONO_TRUNK_NACL=$(pwd)
15
16 source common.sh
17
18 readonly PACKAGE_NAME=runtime${TARGET_BIT_PREFIX}-build
19 readonly INSTALL_PATH=${MONO_TRUNK_NACL}/naclmono-${CROSS_ID}
20
21
22 CustomConfigureStep() {
23   Banner "Configuring ${PACKAGE_NAME}"
24   # export the nacl tools
25   set +e
26   if [ -f ${PACKAGE_NAME}/Makefile ]
27   then
28     cd ${PACKAGE_NAME}
29   fi
30   make distclean
31   cd ${MONO_TRUNK_NACL}
32   set -e
33   if [ $TARGET_BITSIZE == "32" ]; then
34     CONFIG_OPTS="--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu"
35   else
36     CONFIG_OPTS="--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu"
37   fi
38   # UGLY hack to allow dynamic linking
39   sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../configure
40   sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../libgc/configure
41   sed -i -e s/elf_i386/elf_nacl/ -e s/elf_x86_64/elf64_nacl/ ../eglib/configure
42   Remove ${PACKAGE_NAME}
43   MakeDir ${PACKAGE_NAME}
44   cd ${PACKAGE_NAME}
45   CC=${NACLCC} CXX=${NACLCXX} AR=${NACLAR} RANLIB=${NACLRANLIB} PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig LD="${NACLLD}" \
46   PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} PATH=${NACL_BIN_PATH}:${PATH} LIBS="-lnacl_dyncode -lc -lg -lnosys -lnacl" \
47   CFLAGS="-g -O2 -D_POSIX_PATH_MAX=256 -DPATH_MAX=256" ../../configure \
48     ${CONFIG_OPTS} \
49     --exec-prefix=${INSTALL_PATH} \
50     --libdir=${INSTALL_PATH}/lib \
51     --prefix=${INSTALL_PATH} \
52     --program-prefix="" \
53     --oldincludedir=${INSTALL_PATH}/include \
54     --with-glib=embedded \
55     --with-tls=pthread \
56     --enable-threads=posix \
57     --without-sigaltstack \
58     --without-mmap \
59     --with-gc=included \
60     --enable-nacl-gc \
61     --with-sgen=no \
62     --enable-nls=no \
63     --enable-nacl-codegen \
64     --disable-system-aot \
65     --enable-shared \
66     --disable-parallel-mark \
67     --with-static-mono=no
68
69 }
70
71 CustomInstallStep() {
72   make install
73 }
74
75 CustomPackageInstall() {
76   CustomConfigureStep
77   DefaultBuildStep
78   CustomInstallStep
79 }
80
81 CustomPackageInstall
82 exit 0