| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 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 source pkg_info | 6 BUILD_DIR=${START_DIR} |
| 7 source ../../build_tools/common.sh | |
| 8 | |
| 9 | 7 |
| 10 BuildStep() { | 8 BuildStep() { |
| 11 # The sample is built using the NaCl SDK common.mk system. | 9 # The sample is built using the NaCl SDK common.mk system. |
| 12 # We override $(OUTBASE) to force the build system to put | 10 # We override $(OUTBASE) to force the build system to put |
| 13 # all its artifacts in ${NACL_PACKAGES_REPOSITORY} rather | 11 # all its artifacts in ${NACL_PACKAGES_REPOSITORY} rather |
| 14 # than alongside the Makefile. | 12 # than alongside the Makefile. |
| 15 export OUTBASE=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_DIR} | 13 export OUTBASE=${SRC_DIR} |
| 16 export OUTBASE=${NACL_PACKAGES_REPOSITORY}/${PACKAGE_DIR} | |
| 17 export NACLPORTS_INCLUDE | 14 export NACLPORTS_INCLUDE |
| 18 export NACLPORTS_PREFIX | 15 export NACLPORTS_PREFIX |
| 19 export NACL_PACKAGES_PUBLISH | 16 export NACL_PACKAGES_PUBLISH |
| 20 export NACL_SRC | 17 export NACL_SRC |
| 21 | 18 |
| 22 MakeDir ${OUTBASE} | 19 MakeDir ${OUTBASE} |
| 23 if [ "${NACL_GLIBC}" = "1" ]; then | 20 if [ "${NACL_GLIBC}" = "1" ]; then |
| 24 MAKEFLAGS+=" TOOLCHAIN=glibc" | 21 MAKEFLAGS+=" TOOLCHAIN=glibc" |
| 25 elif [ "${NACL_ARCH}" = "pnacl" ]; then | 22 elif [ "${NACL_ARCH}" = "pnacl" ]; then |
| 26 MAKEFLAGS+=" TOOLCHAIN=pnacl" | 23 MAKEFLAGS+=" TOOLCHAIN=pnacl" |
| 27 else | 24 else |
| 28 MAKEFLAGS+=" TOOLCHAIN=newlib" | 25 MAKEFLAGS+=" TOOLCHAIN=newlib" |
| 29 fi | 26 fi |
| 30 if [ "${NACL_DEBUG}" = "1" ]; then | 27 if [ "${NACL_DEBUG}" = "1" ]; then |
| 31 MAKEFLAGS+=" CONFIG=Debug" | 28 MAKEFLAGS+=" CONFIG=Debug" |
| 32 else | 29 else |
| 33 MAKEFLAGS+=" CONFIG=Release" | 30 MAKEFLAGS+=" CONFIG=Release" |
| 34 fi | 31 fi |
| 35 if [ "${NACL_ARCH}" != "pnacl" ]; then | 32 if [ "${NACL_ARCH}" != "pnacl" ]; then |
| 36 MAKEFLAGS+=" NACL_ARCH=${NACL_ARCH_ALT}" | 33 MAKEFLAGS+=" NACL_ARCH=${NACL_ARCH_ALT}" |
| 37 fi | 34 fi |
| 38 export MAKEFLAGS | 35 export MAKEFLAGS |
| 39 ChangeDir ${START_DIR} | |
| 40 DefaultBuildStep | 36 DefaultBuildStep |
| 41 } | 37 } |
| 42 | 38 |
| 43 | 39 |
| 44 PackageInstall() { | 40 PackageInstall() { |
| 45 PreInstallStep | 41 PreInstallStep |
| 46 BuildStep | 42 BuildStep |
| 47 InstallStep | 43 InstallStep |
| 48 } | 44 } |
| 49 | |
| 50 | |
| 51 PackageInstall | |
| 52 exit 0 | |
| OLD | NEW |