| 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 #@ PNaCl toolchain build script | 6 #@ PNaCl toolchain build script |
| 7 #@------------------------------------------------------------------- | 7 #@------------------------------------------------------------------- |
| 8 #@ This script builds the ARM and PNaCl untrusted toolchains. | 8 #@ This script builds the ARM and PNaCl untrusted toolchains. |
| 9 #@ It MUST be run from the native_client/ directory. | 9 #@ It MUST be run from the native_client/ directory. |
| 10 ###################################################################### | 10 ###################################################################### |
| (...skipping 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3085 # extract all the files | 3085 # extract all the files |
| 3086 local count=0 | 3086 local count=0 |
| 3087 for i in ${pattern} ; do | 3087 for i in ${pattern} ; do |
| 3088 if [ ! -e "$i" ]; then | 3088 if [ ! -e "$i" ]; then |
| 3089 # we may also see the unexpanded pattern here if there is no match | 3089 # we may also see the unexpanded pattern here if there is no match |
| 3090 continue | 3090 continue |
| 3091 fi | 3091 fi |
| 3092 count=$((count+1)) | 3092 count=$((count+1)) |
| 3093 ${checker} $i | 3093 ${checker} $i |
| 3094 done | 3094 done |
| 3095 if [ "${count}" = "0" ] ; then | |
| 3096 echo "FAIL - archive empty or wrong contents: ${archive}" | |
| 3097 ls -l "${tmp}" | |
| 3098 exit -1 | |
| 3099 fi | |
| 3100 echo "PASS (${count} files)" | 3095 echo "PASS (${count} files)" |
| 3101 rm -rf "${tmp}" | 3096 rm -rf "${tmp}" |
| 3102 spopd | 3097 spopd |
| 3103 } | 3098 } |
| 3104 | 3099 |
| 3105 IsLinkerScript() { | 3100 IsLinkerScript() { |
| 3106 local fname="$1" | 3101 local fname="$1" |
| 3107 local type="$(file --brief --mime-type "${fname}")" | 3102 local type="$(file --brief --mime-type "${fname}")" |
| 3108 case "$type" in | 3103 case "$type" in |
| 3109 text/x-c) | 3104 text/x-c) |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3613 | 3608 |
| 3614 if [ "$(type -t $1)" != "function" ]; then | 3609 if [ "$(type -t $1)" != "function" ]; then |
| 3615 #Usage | 3610 #Usage |
| 3616 echo "ERROR: unknown function '$1'." >&2 | 3611 echo "ERROR: unknown function '$1'." >&2 |
| 3617 echo "For help, try:" | 3612 echo "For help, try:" |
| 3618 echo " $0 help" | 3613 echo " $0 help" |
| 3619 exit 1 | 3614 exit 1 |
| 3620 fi | 3615 fi |
| 3621 | 3616 |
| 3622 "$@" | 3617 "$@" |
| OLD | NEW |