| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2014 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 # This is for bash on NaCl. Note that you cannot use external commands | 6 # This is for bash on NaCl. Note that you cannot use external commands |
| 7 # until the installation is completed. Also, you cannot use features | 7 # until the installation is completed. Also, you cannot use features |
| 8 # which nacl_io does not support yet (e.g., pipes and sub-shells). | 8 # which nacl_io does not support yet (e.g., pipes and sub-shells). |
| 9 | 9 |
| 10 CheckNaClEnabled() { | 10 CheckNaClEnabled() { |
| 11 # Skip check on if this isn't newlib. | 11 # Skip check on if this isn't newlib. |
| 12 if [[ "${TOOLCHAIN}" != newlib ]]; then | 12 if [[ ${TOOLCHAIN} != newlib ]]; then |
| 13 return | 13 return |
| 14 fi | 14 fi |
| 15 TMP_CHECK_FILE="/tmp/.enable_nacl_check.nexe" | 15 TMP_CHECK_FILE="/tmp/.enable_nacl_check.nexe" |
| 16 # Assume we can reuse the test file if present. | 16 # Assume we can reuse the test file if present. |
| 17 if [[ ! -e ${TMP_CHECK_FILE} ]]; then | 17 if [[ ! -e ${TMP_CHECK_FILE} ]]; then |
| 18 geturl -q _platform_specific/${NACL_ARCH}/bash.nexe \ | 18 geturl -q _platform_specific/${NACL_ARCH}/bash.nexe \ |
| 19 ${TMP_CHECK_FILE} || exit 1 | 19 ${TMP_CHECK_FILE} || exit 1 |
| 20 fi | 20 fi |
| 21 ${TMP_CHECK_FILE} -c 'exit 42' | 21 ${TMP_CHECK_FILE} -c 'exit 42' |
| 22 if [[ $? != 42 ]]; then | 22 if [[ $? != 42 ]]; then |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 // and keep window open so that error message could be shown. | 35 // and keep window open so that error message could be shown. |
| 36 while [[ 1 == 1 ]]; do | 36 while [[ 1 == 1 ]]; do |
| 37 read | 37 read |
| 38 done | 38 done |
| 39 fi | 39 fi |
| 40 } | 40 } |
| 41 | 41 |
| 42 InstallBasePackages() { | 42 InstallBasePackages() { |
| 43 # Core packages. | 43 # Core packages. |
| 44 local default_packages="\ | 44 local default_packages="\ |
| 45 -i corelibs \ |
| 46 -i nacl-spawn \ |
| 45 -i coreutils \ | 47 -i coreutils \ |
| 46 -i bash \ | 48 -i bash \ |
| 47 -i curl \ | 49 -i curl \ |
| 48 -i findutils \ | 50 -i findutils \ |
| 49 -i grep \ | 51 -i grep \ |
| 50 -i git \ | 52 -i git \ |
| 51 -i less \ | 53 -i less \ |
| 52 -i make \ | 54 -i make \ |
| 53 -i nano \ | 55 -i nano \ |
| 54 -i python \ | 56 -i python \ |
| 55 -i grep \ | 57 -i grep \ |
| 56 -i vim" | 58 -i vim" |
| 57 | 59 |
| 58 local have_gcc=0 | 60 local have_gcc=0 |
| 59 if [[ "${NACL_ARCH}" == "i686" || "${NACL_ARCH}" == "x86_64" ]]; then | 61 if [[ ${TOOLCHAIN} == glibc ]]; then |
| 60 default_packages+=" \ | 62 if [[ ${NACL_ARCH} == i686 || ${NACL_ARCH} == x86_64 ]]; then |
| 61 -i emacs \ | 63 default_packages+=" \ |
| 62 -i mingn.base \ | 64 -i binutils \ |
| 63 -i mingn.lib" | 65 -i gcc \ |
| 64 have_gcc=1 | 66 -i mingn" |
| 67 have_gcc=1 |
| 68 fi |
| 65 fi | 69 fi |
| 66 | 70 |
| 67 # Check for updates on some packages. | 71 # Check for updates on some packages. |
| 68 package ${default_packages[@]} $@ | 72 package ${default_packages[@]} $@ |
| 69 | 73 |
| 70 if [[ ${have_gcc} == 0 ]]; then | 74 if [[ ${have_gcc} == 0 ]]; then |
| 71 echo "WARNING: \ | 75 echo "WARNING: \ |
| 72 emacs and gcc not yet available for your platform (coming soon)." | 76 emacs and gcc not yet available for your platform (coming soon)." |
| 73 fi | 77 fi |
| 74 } | 78 } |
| 75 | 79 |
| 76 CheckNaClEnabled | 80 CheckNaClEnabled |
| 77 InstallBasePackages $@ | 81 InstallBasePackages $@ |
| OLD | NEW |