OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 # | 5 # |
6 | 6 |
7 # nacl-bochs-2.4.6.sh | 7 # nacl-bochs-2.4.6.sh |
8 # | 8 # |
9 # usage: nacl-bochs-2.4.6.sh | 9 # usage: nacl-bochs-2.4.6.sh |
10 # | 10 # |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 BOCHS_EXAMPLE_DIR=${NACL_SRC}/examples/systems/bochs-2.4.6 | 26 BOCHS_EXAMPLE_DIR=${NACL_SRC}/examples/systems/bochs-2.4.6 |
27 | 27 |
28 CustomConfigureStep() { | 28 CustomConfigureStep() { |
29 Banner "Configuring ${PACKAGE_NAME}" | 29 Banner "Configuring ${PACKAGE_NAME}" |
30 # export the nacl tools | 30 # export the nacl tools |
31 export CC=${NACLCC} | 31 export CC=${NACLCC} |
32 export CXX=${NACLCXX} | 32 export CXX=${NACLCXX} |
33 export CXXFLAGS="-O2 -g" | 33 export CXXFLAGS="-O2 -g" |
34 export LDFLAGS="" | 34 export LDFLAGS="" |
35 if [ ${NACL_PACKAGES_BITSIZE} == "pnacl" ] ; then | 35 if [ ${NACL_ARCH} = "pnacl" ] ; then |
36 export CXXFLAGS="-O3 -g" | 36 export CXXFLAGS="-O3 -g" |
37 export LDFLAGS="-O0 -static" | 37 export LDFLAGS="-O0 -static" |
38 fi | 38 fi |
39 export AR=${NACLAR} | 39 export AR=${NACLAR} |
40 export RANLIB=${NACLRANLIB} | 40 export RANLIB=${NACLRANLIB} |
41 # path and package magic to make sure we call the right | 41 # path and package magic to make sure we call the right |
42 # sdl-config, etc. | 42 # sdl-config, etc. |
43 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig | 43 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig |
44 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 44 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} |
45 export PATH=${NACL_BIN_PATH}:${PATH}; | 45 export PATH=${NACL_BIN_PATH}:${PATH}; |
46 export PATH="${NACL_SDK_USR_BIN}:${PATH}" | 46 export PATH="${NACL_SDK_USR_BIN}:${PATH}" |
47 | 47 |
48 export NACLBXLIBS="-lnacl-mounts -lpthread" | 48 export NACLBXLIBS="-lnacl-mounts -lpthread" |
49 | 49 |
50 # Hacky way of getting around the bochs configuration tools which don't allow | 50 # Hacky way of getting around the bochs configuration tools which don't allow |
51 # --whole-archive and don't allow for multiple libraries with the same name | 51 # --whole-archive and don't allow for multiple libraries with the same name |
52 # on the linker line | 52 # on the linker line |
53 PWD=$(pwd) | 53 PWD=$(pwd) |
54 # TODO(bradnelson): take this out once the sdk is fixed (and do the line | 54 # TODO(bradnelson): take this out once the sdk is fixed (and do the line |
55 # after). | 55 # after). |
56 if [ "$NACL_PACKAGES_BITSIZE" = "64" ]; then | 56 if [ "$NACL_ARCH" = "x86_64" ]; then |
57 ChangeDir ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib | 57 ChangeDir ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib |
58 elif [ "$NACL_PACKAGES_BITSIZE" = "32" ]; then | 58 elif [ "$NACL_ARCH" = "i686" ]; then |
59 ChangeDir ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 | 59 ChangeDir ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib32 |
| 60 elif [ "$NACL_ARCH" = "arm" ]; then |
| 61 ChangeDir ${NACL_TOOLCHAIN_ROOT}/arm-nacl/lib |
60 else | 62 else |
61 ChangeDir ${NACL_TOOLCHAIN_ROOT}/sdk/lib | 63 ChangeDir ${NACL_TOOLCHAIN_ROOT}/sdk/lib |
62 fi | 64 fi |
63 #ChangeDir ${NACL_TOOLCHAIN_ROOT}/x86_64-nacl/lib${NACL_PACKAGES_BITSIZE} | |
64 cp libppapi_cpp.a libppapi_cpp_COPY.a | 65 cp libppapi_cpp.a libppapi_cpp_COPY.a |
65 ChangeDir ${PWD} | 66 ChangeDir ${PWD} |
66 | 67 |
67 export LIBS= | 68 export LIBS= |
68 export LIBS="$LIBS -Wl,--start-group" | 69 export LIBS="$LIBS -Wl,--start-group" |
69 export LIBS="$LIBS -lppapi" | 70 export LIBS="$LIBS -lppapi" |
70 export LIBS="$LIBS -lppapi_cpp" | 71 export LIBS="$LIBS -lppapi_cpp" |
71 export LIBS="$LIBS -Lbochs_ppapi -lbochs_ppapi" | 72 export LIBS="$LIBS -Lbochs_ppapi -lbochs_ppapi" |
72 export LIBS="$LIBS -lnacl-mounts" | 73 export LIBS="$LIBS -lnacl-mounts" |
73 export LIBS="$LIBS -lpthread" | 74 export LIBS="$LIBS -lpthread" |
74 export LIBS="$LIBS -lppapi_cpp_COPY" | 75 export LIBS="$LIBS -lppapi_cpp_COPY" |
75 # TOOD(robertm): investigate why this is only necessary for pnacl | 76 # TOOD(robertm): investigate why this is only necessary for pnacl |
76 if [ ${NACL_PACKAGES_BITSIZE} == "pnacl" ] ; then | 77 if [ ${NACL_ARCH} = "pnacl" ] ; then |
77 export LIBS="$LIBS -lnosys" | 78 export LIBS="$LIBS -lnosys" |
78 fi | 79 fi |
79 export LIBS="$LIBS -Wl,--end-group" | 80 export LIBS="$LIBS -Wl,--end-group" |
80 | 81 |
81 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 82 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
82 Remove ${PACKAGE_NAME}-build | 83 Remove ${PACKAGE_NAME}-build |
83 MakeDir ${PACKAGE_NAME}-build | 84 MakeDir ${PACKAGE_NAME}-build |
84 cd ${PACKAGE_NAME}-build | 85 cd ${PACKAGE_NAME}-build |
85 ../configure \ | 86 ../configure \ |
86 --host=nacl \ | 87 --host=nacl \ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 cp -r ${BOCHS_DIR}/msrs.def img/ | 121 cp -r ${BOCHS_DIR}/msrs.def img/ |
121 cd img | 122 cd img |
122 | 123 |
123 PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" | 124 PUBLISH_DIR="${NACL_PACKAGES_PUBLISH}/${PACKAGE_NAME}" |
124 MakeDir ${PUBLISH_DIR} | 125 MakeDir ${PUBLISH_DIR} |
125 | 126 |
126 tar cf ${PUBLISH_DIR}/img.tar ./ | 127 tar cf ${PUBLISH_DIR}/img.tar ./ |
127 | 128 |
128 cp ${START_DIR}/bochs.html ${PUBLISH_DIR} | 129 cp ${START_DIR}/bochs.html ${PUBLISH_DIR} |
129 cp ${START_DIR}/bochs.nmf ${PUBLISH_DIR} | 130 cp ${START_DIR}/bochs.nmf ${PUBLISH_DIR} |
130 cp ${BOCHS_BUILD}/bochs \ | 131 cp ${BOCHS_BUILD}/bochs ${PUBLISH_DIR}/bochs_${NACL_ARCH}.nexe |
131 ${PUBLISH_DIR}/bochs_x86-${NACL_PACKAGES_BITSIZE}.nexe \ | |
132 | 132 |
133 cd .. | 133 cd .. |
134 } | 134 } |
135 | 135 |
136 CustomCheck() { | 136 CustomCheck() { |
137 # verify sha1 checksum for tarball | 137 # verify sha1 checksum for tarball |
138 if ${SHA1CHECK} <$1 &>/dev/null; then | 138 if ${SHA1CHECK} <$1 &>/dev/null; then |
139 return 0 | 139 return 0 |
140 else | 140 else |
141 return 1 | 141 return 1 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 CustomPackageInstall() { | 205 CustomPackageInstall() { |
206 GameGetStep ${LINUX_IMG_URL} ${LINUX_IMG_NAME} | 206 GameGetStep ${LINUX_IMG_URL} ${LINUX_IMG_NAME} |
207 DefaultPreInstallStep | 207 DefaultPreInstallStep |
208 CustomDownloadStep2 ${URL} ${PACKAGE_NAME} \ | 208 CustomDownloadStep2 ${URL} ${PACKAGE_NAME} \ |
209 ${BOCHS_EXAMPLE_DIR}/bochs-2.4.6.sha1 | 209 ${BOCHS_EXAMPLE_DIR}/bochs-2.4.6.sha1 |
210 DefaultExtractStep | 210 DefaultExtractStep |
211 CustomPatchStep | 211 CustomPatchStep |
212 CustomConfigureStep | 212 CustomConfigureStep |
213 DefaultBuildStep | 213 DefaultBuildStep |
214 if [ ${NACL_PACKAGES_BITSIZE} == "pnacl" ] ; then | 214 if [ ${NACL_ARCH} = "pnacl" ] ; then |
215 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/bochs | 215 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/bochs |
216 fi | 216 fi |
217 CustomInstallStep | 217 CustomInstallStep |
218 DefaultCleanUpStep | 218 DefaultCleanUpStep |
219 } | 219 } |
220 | 220 |
221 CustomPackageInstall | 221 CustomPackageInstall |
222 exit 0 | 222 exit 0 |
OLD | NEW |