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.
9 # usage: nacl-runtime-mono.sh
11 # this script builds mono runtime for Native Client
14 readonly MONO_TRUNK_NACL=$(pwd)
19 readonly PACKAGE_NAME=runtime${TARGET_BIT_PREFIX}-build
20 readonly INSTALL_PATH=${MONO_TRUNK_NACL}/runtime${TARGET_BIT_PREFIX}
23 CustomConfigureStep() {
24 Banner "Configuring ${PACKAGE_NAME}"
25 # export the nacl tools
27 if [ -f ${PACKAGE_NAME}/Makefile ]
34 cp config-nacl-runtime${TARGET_BIT_PREFIX}.cache config-nacl-runtime${TARGET_BIT_PREFIX}.cache.temp
35 Remove ${PACKAGE_NAME}
36 MakeDir ${PACKAGE_NAME}
38 # TODO: remove this once libintl.h becomes available to nacl
39 CC=${NACLCC} CXX=${NACLCXX} AR=${NACLAR} RANLIB=${NACLRANLIB} PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig \
40 PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} PATH=${NACL_BIN_PATH}:${PATH} LIBS="-lnosys -lg" \
41 CFLAGS="-g -D_POSIX_PATH_MAX=256 -DPATH_MAX=256" ../../configure \
42 --host=nacl${TARGET_BIT_PREFIX} \
43 --exec-prefix=${INSTALL_PATH} \
44 --libdir=${INSTALL_PATH}/lib \
45 --prefix=${INSTALL_PATH} \
46 --oldincludedir=${MONO_TRUNK_NACL}/runtime/include \
49 --with-glib=embedded \
51 --enable-threads=posix \
52 --without-sigaltstack \
56 --enable-nacl-codegen \
57 --cache-file=../config-nacl-runtime${TARGET_BIT_PREFIX}.cache.temp
58 echo "// --- Native Client runtime below" >> config.h
59 echo "#define pthread_cleanup_push(x, y)" >> config.h
60 echo "#define pthread_cleanup_pop(x)" >> config.h
61 echo "#undef HAVE_EPOLL" >> config.h
62 echo "#undef HAVE_WORKING_SIGALTSTACK" >> config.h
63 echo "extern long int timezone;" >> config.h
64 echo "extern int daylight;" >> config.h
65 echo "#define sem_trywait(x) sem_wait(x)" >> config.h
66 echo "#define sem_timedwait(x,y) sem_wait(x)" >> config.h
67 echo "#define getdtablesize() (32768)" >> config.h
68 echo "// --- Native Client runtime below" >> eglib/src/eglib-config.h
69 echo "#undef G_BREAKPOINT" >> eglib/src/eglib-config.h
70 echo "#define G_BREAKPOINT() G_STMT_START { __asm__ (\"hlt\"); } G_STMT_END" >> eglib/src/eglib-config.h
71 rm ../config-nacl-runtime${TARGET_BIT_PREFIX}.cache.temp
79 CustomPackageInstall() {