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-dosbox-0.74.sh | 7 # nacl-dosbox-0.74.sh |
8 # | 8 # |
9 # usage: nacl-dosbox-0.74.sh | 9 # usage: nacl-dosbox-0.74.sh |
10 # | 10 # |
11 # this script downloads, patches, and builds dosbox for Native Client. | 11 # this script downloads, patches, and builds dosbox for Native Client. |
12 # | 12 # |
13 | 13 |
14 readonly URL=http://commondatastorage.googleapis.com/nativeclient-mirror/nacl/do
sbox-0.74.tar.gz | 14 readonly URL=http://commondatastorage.googleapis.com/nativeclient-mirror/nacl/do
sbox-0.74.tar.gz |
15 #readonly URL=http://sourceforge.net/projects/dosbox/files/dosbox/0.74/dosbox-0.
74.tar.gz/download | 15 #readonly URL=http://sourceforge.net/projects/dosbox/files/dosbox/0.74/dosbox-0.
74.tar.gz/download |
16 readonly PATCH_FILE=nacl-dosbox-0.74.patch | 16 readonly PATCH_FILE=nacl-dosbox-0.74.patch |
17 PACKAGE_NAME=dosbox-0.74 | 17 PACKAGE_NAME=dosbox-0.74 |
18 | 18 |
19 source ../../../build_tools/common.sh | 19 source ../../../build_tools/common.sh |
20 | 20 |
21 DOSBOX_EXAMPLE_DIR=${NACL_SRC}/examples/systems/dosbox-0.74 | 21 DOSBOX_EXAMPLE_DIR=${NACL_SRC}/examples/systems/dosbox-0.74 |
22 | 22 |
23 CustomConfigureStep() { | 23 CustomConfigureStep() { |
24 Banner "Configuring ${PACKAGE_NAME}" | 24 Banner "Configuring ${PACKAGE_NAME}" |
25 | 25 |
26 # export the nacl tools | 26 # export the nacl tools |
27 export CC=${NACLCC} | 27 export CC=${NACLCC} |
28 export CXX=${NACLCXX} | 28 export CXX=${NACLCXX} |
29 # NOTE: non-standard flag NACL_LDFLAGS because of some more hacking below | 29 # NOTE: non-standard flag NACL_LDFLAGS because of some more hacking below |
30 export CXXFLAGS="-O2 -g -I${NACL_SDK_ROOT}/include" | 30 export CXXFLAGS="${NACLPORTS_CFLAGS} -O2 -g -I${NACL_SDK_ROOT}/include" |
31 export NACL_LDFLAGS="" | 31 export NACL_LDFLAGS="${NACLPORTS_LDFLAGS}" |
32 if [ ${NACL_ARCH} = "pnacl" ] ; then | 32 if [ ${NACL_ARCH} = "pnacl" ] ; then |
33 export CXXFLAGS="-O3 -g" | 33 export CXXFLAGS="${NACLPORTS_CFLAGS} -O3 -g" |
34 export NACL_LDFLAGS="-O0 -static" | 34 export NACL_LDFLAGS="${NACL_LDFLAGS} -O0 -static" |
35 fi | 35 fi |
36 export AR=${NACLAR} | 36 export AR=${NACLAR} |
37 export RANLIB=${NACLRANLIB} | 37 export RANLIB=${NACLRANLIB} |
38 export STRIP=${NACLSTRIP} | 38 export STRIP=${NACLSTRIP} |
39 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig | 39 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig |
40 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 40 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} |
41 | 41 |
42 export LIBS="-L${NACL_SDK_USR_LIB} \ | 42 export LIBS="-L${NACLPORTS_LIBDIR} \ |
43 -lm \ | 43 -lm \ |
44 -lpng \ | 44 -lpng \ |
45 -lz" | 45 -lz" |
46 | 46 |
47 CONFIG_FLAGS="--host=${NACL_ARCH}-pc-nacl \ | 47 CONFIG_FLAGS="--host=${NACL_ARCH}-pc-nacl \ |
48 --prefix=${NACL_SDK_USR} \ | 48 --prefix=${NACLPORTS_PREFIX} \ |
49 --exec-prefix=${NACL_SDK_USR} \ | 49 --exec-prefix=${NACLPORTS_PREFIX} \ |
50 --libdir=${NACL_SDK_USR_LIB} \ | 50 --libdir=${NACLPORTS_LIBDIR} \ |
51 --oldincludedir=${NACL_SDK_USR_INCLUDE} \ | 51 --oldincludedir=${NACLPORTS_INCLUDE} \ |
52 --with-sdl-prefix=${NACL_SDK_USR} \ | 52 --with-sdl-prefix=${NACLPORTS_PREFIX} \ |
53 --with-sdl-exec-prefix=${NACL_SDK_USR}" | 53 --with-sdl-exec-prefix=${NACLPORTS_PREFIX}" |
54 | 54 |
55 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 55 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
56 ./autogen.sh | 56 ./autogen.sh |
57 | 57 |
58 Remove ${PACKAGE_NAME}-build | 58 Remove ${PACKAGE_NAME}-build |
59 MakeDir ${PACKAGE_NAME}-build | 59 MakeDir ${PACKAGE_NAME}-build |
60 cd ${PACKAGE_NAME}-build | 60 cd ${PACKAGE_NAME}-build |
61 ../configure ${CONFIG_FLAGS} | 61 ../configure ${CONFIG_FLAGS} |
62 | 62 |
63 # TODO(clchiou): Sadly we cannot export LIBS and LDFLAGS to configure, which | 63 # TODO(clchiou): Sadly we cannot export LIBS and LDFLAGS to configure, which |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 DefaultBuildStep | 113 DefaultBuildStep |
114 if [ ${NACL_ARCH} = "pnacl" ] ; then | 114 if [ ${NACL_ARCH} = "pnacl" ] ; then |
115 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/src/dosbox | 115 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/src/dosbox |
116 fi | 116 fi |
117 CustomInstallStep | 117 CustomInstallStep |
118 DefaultCleanUpStep | 118 DefaultCleanUpStep |
119 } | 119 } |
120 | 120 |
121 CustomPackageInstall | 121 CustomPackageInstall |
122 exit 0 | 122 exit 0 |
OLD | NEW |