| 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 source pkg_info | 14 source pkg_info |
| 15 source ../../../build_tools/common.sh | 15 source ../../../build_tools/common.sh |
| 16 | 16 |
| 17 DOSBOX_EXAMPLE_DIR=${NACL_SRC}/examples/systems/dosbox-0.74 | 17 DOSBOX_EXAMPLE_DIR=${NACL_SRC}/examples/systems/dosbox-0.74 |
| 18 | 18 |
| 19 CustomConfigureStep() { | 19 CustomConfigureStep() { |
| 20 Banner "Configuring ${PACKAGE_NAME}" | 20 Banner "Configuring ${PACKAGE_NAME}" |
| 21 | 21 |
| 22 # export the nacl tools | 22 # export the nacl tools |
| 23 export CC=${NACLCC} | 23 export CC=${NACLCC} |
| 24 export CXX=${NACLCXX} | 24 export CXX=${NACLCXX} |
| 25 # NOTE: non-standard flag NACL_LDFLAGS because of some more hacking below | 25 # NOTE: non-standard flag NACL_LDFLAGS because of some more hacking below |
| 26 export CXXFLAGS="-O2 -g -I${NACL_SDK_ROOT}/include" | 26 export CXXFLAGS="${NACLPORTS_CFLAGS} -O2 -g -I${NACL_SDK_ROOT}/include" |
| 27 export NACL_LDFLAGS="" | 27 export NACL_LDFLAGS="${NACLPORTS_LDFLAGS}" |
| 28 if [ ${NACL_ARCH} = "pnacl" ] ; then | 28 if [ ${NACL_ARCH} = "pnacl" ] ; then |
| 29 export CXXFLAGS="-O3 -g" | 29 export CXXFLAGS="${NACLPORTS_CFLAGS} -O3 -g" |
| 30 export NACL_LDFLAGS="-O0 -static" | 30 export NACL_LDFLAGS="${NACL_LDFLAGS} -O0 -static" |
| 31 fi | 31 fi |
| 32 export AR=${NACLAR} | 32 export AR=${NACLAR} |
| 33 export RANLIB=${NACLRANLIB} | 33 export RANLIB=${NACLRANLIB} |
| 34 export STRIP=${NACLSTRIP} | 34 export STRIP=${NACLSTRIP} |
| 35 export PKG_CONFIG_PATH=${NACL_SDK_USR_LIB}/pkgconfig | 35 export PKG_CONFIG_PATH=${NACLPORTS_LIBDIR}/pkgconfig |
| 36 export PKG_CONFIG_LIBDIR=${NACL_SDK_USR_LIB} | 36 export PKG_CONFIG_LIBDIR=${NACLPORTS_LIBDIR} |
| 37 | 37 |
| 38 export LIBS="-L${NACL_SDK_USR_LIB} \ | 38 export LIBS="-L${NACLPORTS_LIBDIR} \ |
| 39 -lm \ | 39 -lm \ |
| 40 -lpng \ | 40 -lpng \ |
| 41 -lz" | 41 -lz" |
| 42 | 42 |
| 43 CONFIG_FLAGS="--host=${NACL_ARCH}-pc-nacl \ | 43 CONFIG_FLAGS="--host=${NACL_ARCH}-pc-nacl \ |
| 44 --prefix=${NACL_SDK_USR} \ | 44 --prefix=${NACLPORTS_PREFIX} \ |
| 45 --exec-prefix=${NACL_SDK_USR} \ | 45 --exec-prefix=${NACLPORTS_PREFIX} \ |
| 46 --libdir=${NACL_SDK_USR_LIB} \ | 46 --libdir=${NACLPORTS_LIBDIR} \ |
| 47 --oldincludedir=${NACL_SDK_USR_INCLUDE} \ | 47 --oldincludedir=${NACLPORTS_INCLUDE} \ |
| 48 --with-sdl-prefix=${NACL_SDK_USR} \ | 48 --with-sdl-prefix=${NACLPORTS_PREFIX} \ |
| 49 --with-sdl-exec-prefix=${NACL_SDK_USR}" | 49 --with-sdl-exec-prefix=${NACLPORTS_PREFIX}" |
| 50 | 50 |
| 51 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} | 51 ChangeDir ${NACL_PACKAGES_REPOSITORY}/${PACKAGE_NAME} |
| 52 ./autogen.sh | 52 ./autogen.sh |
| 53 | 53 |
| 54 Remove ${PACKAGE_NAME}-build | 54 Remove ${PACKAGE_NAME}-build |
| 55 MakeDir ${PACKAGE_NAME}-build | 55 MakeDir ${PACKAGE_NAME}-build |
| 56 cd ${PACKAGE_NAME}-build | 56 cd ${PACKAGE_NAME}-build |
| 57 ../configure ${CONFIG_FLAGS} | 57 ../configure ${CONFIG_FLAGS} |
| 58 | 58 |
| 59 # TODO(clchiou): Sadly we cannot export LIBS and LDFLAGS to configure, which | 59 # 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... |
| 109 DefaultBuildStep | 109 DefaultBuildStep |
| 110 if [ ${NACL_ARCH} = "pnacl" ] ; then | 110 if [ ${NACL_ARCH} = "pnacl" ] ; then |
| 111 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/src/dosbox | 111 DefaultTranslateStep ${PACKAGE_NAME} ${PACKAGE_NAME}-build/src/dosbox |
| 112 fi | 112 fi |
| 113 CustomInstallStep | 113 CustomInstallStep |
| 114 DefaultCleanUpStep | 114 DefaultCleanUpStep |
| 115 } | 115 } |
| 116 | 116 |
| 117 CustomPackageInstall | 117 CustomPackageInstall |
| 118 exit 0 | 118 exit 0 |
| OLD | NEW |