| 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 set -e | 10 set -e |
| 11 | 11 |
| 12 CheckNaClEnabled() { | 12 CheckNaClEnabled() { |
| 13 # Skip check on if this isn't newlib. | 13 # Skip check on if this isn't newlib or glibc. |
| 14 if [[ ${TOOLCHAIN} != newlib ]]; then | 14 if [[ ${TOOLCHAIN} != newlib && ${TOOLCHAIN} != glibc ]]; then |
| 15 return | 15 return |
| 16 fi | 16 fi |
| 17 TMP_CHECK_FILE="/tmp/.enable_nacl_check.nexe" | 17 TMP_CHECK_FILE="/tmp/.enable_nacl_check.nexe" |
| 18 # Assume we can reuse the test file if present. | 18 # Assume we can reuse the test file if present. |
| 19 if [[ ! -e ${TMP_CHECK_FILE} ]]; then | 19 if [[ ! -e ${TMP_CHECK_FILE} ]]; then |
| 20 geturl -q _platform_specific/${NACL_ARCH}/bash.nexe \ | 20 geturl -q _platform_specific/${NACL_ARCH}/bash.nexe \ |
| 21 ${TMP_CHECK_FILE} || exit 1 | 21 ${TMP_CHECK_FILE} || exit 1 |
| 22 fi | 22 fi |
| 23 set +e | 23 set +e |
| 24 ${TMP_CHECK_FILE} -c 'exit 42' | 24 ${TMP_CHECK_FILE} -c 'exit 42' |
| 25 if [[ $? != 42 ]]; then | 25 if [[ $? != 42 ]]; then |
| 26 echo "*********************** ERROR ***********************" | 26 echo "*********************** ERROR ***********************" |
| 27 echo | 27 echo |
| 28 echo "In order to use the NaCl Dev Environment, you must" | 28 echo "In order to use the NaCl Dev Environment, you must" |
| 29 echo "currently enable 'Native Client' at the url:" | 29 echo "currently enable 'Native Client' at the url:" |
| 30 echo " chrome://flags" | 30 echo " chrome://flags" |
| 31 echo "You must then restart your browser." | 31 echo "You must then restart your browser." |
| 32 echo | 32 echo |
| 33 echo "Eventually this should not be required." | 33 echo "Eventually this may not be required." |
| 34 echo "Follow this issue: https://crbug.com/477808" | 34 echo "Follow this issue: https://crbug.com/477808" |
| 35 echo | 35 echo |
| 36 echo "*********************** ERROR ***********************" | 36 echo "*********************** ERROR ***********************" |
| 37 # TODO: A more proper way to handle error would be "exit 1" here | 37 # TODO: A more proper way to handle error would be "exit 1" here |
| 38 # and keep window open so that error message could be shown. | 38 # and keep window open so that error message could be shown. |
| 39 while [[ 1 == 1 ]]; do | 39 while [[ 1 == 1 ]]; do |
| 40 read | 40 read |
| 41 done | 41 done |
| 42 fi | 42 fi |
| 43 set -e | 43 set -e |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 fi | 88 fi |
| 89 | 89 |
| 90 if [[ ${have_gcc} == 0 ]]; then | 90 if [[ ${have_gcc} == 0 ]]; then |
| 91 echo "WARNING: \ | 91 echo "WARNING: \ |
| 92 emacs and gcc not yet available for your platform (coming soon)." | 92 emacs and gcc not yet available for your platform (coming soon)." |
| 93 fi | 93 fi |
| 94 } | 94 } |
| 95 | 95 |
| 96 CheckNaClEnabled | 96 CheckNaClEnabled |
| 97 InstallBasePackages $@ | 97 InstallBasePackages $@ |
| OLD | NEW |