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 set -o nounset | 6 set -o nounset |
7 set -o errexit | 7 set -o errexit |
8 | 8 |
9 # Turn on/off debugging mode | 9 # Turn on/off debugging mode |
10 readonly PNACL_DEBUG=${PNACL_DEBUG:-false} | 10 readonly PNACL_DEBUG=${PNACL_DEBUG:-false} |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 readonly BUILD_PLATFORM_MAC | 85 readonly BUILD_PLATFORM_MAC |
86 readonly BUILD_PLATFORM_WIN | 86 readonly BUILD_PLATFORM_WIN |
87 readonly SCONS_BUILD_PLATFORM | 87 readonly SCONS_BUILD_PLATFORM |
88 readonly SO_PREFIX | 88 readonly SO_PREFIX |
89 readonly SO_EXT | 89 readonly SO_EXT |
90 readonly SO_DIR | 90 readonly SO_DIR |
91 | 91 |
92 BUILD_ARCH_X8632=false | 92 BUILD_ARCH_X8632=false |
93 BUILD_ARCH_X8664=false | 93 BUILD_ARCH_X8664=false |
94 BUILD_ARCH_ARM=false | 94 BUILD_ARCH_ARM=false |
| 95 BUILD_ARCH_MIPS=false |
95 if [ "${BUILD_ARCH}" == "x86_32" ] || | 96 if [ "${BUILD_ARCH}" == "x86_32" ] || |
96 [ "${BUILD_ARCH}" == "i386" ] || | 97 [ "${BUILD_ARCH}" == "i386" ] || |
97 [ "${BUILD_ARCH}" == "i686" ] ; then | 98 [ "${BUILD_ARCH}" == "i686" ] ; then |
98 BUILD_ARCH=x86_32 | 99 BUILD_ARCH=x86_32 |
99 BUILD_ARCH_X8632=true | 100 BUILD_ARCH_X8632=true |
100 elif [ "${BUILD_ARCH}" == "x86_64" ] ; then | 101 elif [ "${BUILD_ARCH}" == "x86_64" ] ; then |
101 BUILD_ARCH_X8664=true | 102 BUILD_ARCH_X8664=true |
102 elif [ "${BUILD_ARCH}" == "armv7l" ] ; then | 103 elif [ "${BUILD_ARCH}" == "armv7l" ] ; then |
103 BUILD_ARCH_ARM=true | 104 BUILD_ARCH_ARM=true |
| 105 elif [ "${BUILD_ARCH}" == "mips32" ] ; then |
| 106 BUILD_ARCH_MIPS=true |
104 else | 107 else |
105 echo "Unknown build arch '${BUILD_ARCH}'" | 108 echo "Unknown build arch '${BUILD_ARCH}'" |
106 exit -1 | 109 exit -1 |
107 fi | 110 fi |
108 readonly BUILD_ARCH | 111 readonly BUILD_ARCH |
109 readonly BUILD_ARCH_X8632 | 112 readonly BUILD_ARCH_X8632 |
110 readonly BUILD_ARCH_X8664 | 113 readonly BUILD_ARCH_X8664 |
| 114 readonly BUILD_ARCH_ARM |
| 115 readonly BUILD_ARCH_MIPS |
111 | 116 |
112 | 117 |
113 HOST_ARCH=${HOST_ARCH:-${BUILD_ARCH}} | 118 HOST_ARCH=${HOST_ARCH:-${BUILD_ARCH}} |
114 HOST_ARCH_X8632=false | 119 HOST_ARCH_X8632=false |
115 HOST_ARCH_X8664=false | 120 HOST_ARCH_X8664=false |
116 HOST_ARCH_ARM=false | 121 HOST_ARCH_ARM=false |
| 122 HOST_ARCH_MIPS=false |
117 if [ "${HOST_ARCH}" == "x86_32" ] || | 123 if [ "${HOST_ARCH}" == "x86_32" ] || |
118 [ "${HOST_ARCH}" == "i386" ] || | 124 [ "${HOST_ARCH}" == "i386" ] || |
119 [ "${HOST_ARCH}" == "i686" ] ; then | 125 [ "${HOST_ARCH}" == "i686" ] ; then |
120 HOST_ARCH=x86_32 | 126 HOST_ARCH=x86_32 |
121 HOST_ARCH_X8632=true | 127 HOST_ARCH_X8632=true |
122 elif [ "${HOST_ARCH}" == "x86_64" ] ; then | 128 elif [ "${HOST_ARCH}" == "x86_64" ] ; then |
123 HOST_ARCH_X8664=true | 129 HOST_ARCH_X8664=true |
124 elif [ "${HOST_ARCH}" == "armv7l" ] ; then | 130 elif [ "${HOST_ARCH}" == "armv7l" ] ; then |
125 HOST_ARCH_ARM=true | 131 HOST_ARCH_ARM=true |
| 132 elif [ "${HOST_ARCH}" == "mips32" ] ; then |
| 133 HOST_ARCH_MIPS=true |
126 else | 134 else |
127 echo "Unknown host arch '${HOST_ARCH}'" | 135 echo "Unknown host arch '${HOST_ARCH}'" |
128 exit -1 | 136 exit -1 |
129 fi | 137 fi |
130 readonly HOST_ARCH | 138 readonly HOST_ARCH |
131 readonly HOST_ARCH_X8632 | 139 readonly HOST_ARCH_X8632 |
132 readonly HOST_ARCH_X8664 | 140 readonly HOST_ARCH_X8664 |
133 readonly HOST_ARCH_ARM | 141 readonly HOST_ARCH_ARM |
| 142 readonly HOST_ARCH_MIPS |
134 | 143 |
135 if [ "${BUILD_ARCH}" != "${HOST_ARCH}" ]; then | 144 if [ "${BUILD_ARCH}" != "${HOST_ARCH}" ]; then |
136 if ! { ${BUILD_ARCH_X8664} && ${HOST_ARCH_X8632}; }; then | 145 if ! { ${BUILD_ARCH_X8664} && ${HOST_ARCH_X8632}; }; then |
137 echo "Cross builds other than build=x86_64 with host=x86_32 not supported" | 146 echo "Cross builds other than build=x86_64 with host=x86_32 not supported" |
138 exit -1 | 147 exit -1 |
139 fi | 148 fi |
140 fi | 149 fi |
141 | 150 |
142 if ${BUILD_PLATFORM_WIN}; then | 151 if ${BUILD_PLATFORM_WIN}; then |
143 # TODO(robertm): switch this to svn.bat, hg.bat, git.bat, gclient.bat | 152 # TODO(robertm): switch this to svn.bat, hg.bat, git.bat, gclient.bat |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 StepBanner "RUN-WITH-RETRY" "Retrying in ${delay_sec} seconds." | 858 StepBanner "RUN-WITH-RETRY" "Retrying in ${delay_sec} seconds." |
850 sleep ${delay_sec} | 859 sleep ${delay_sec} |
851 else | 860 else |
852 StepBanner "RUN-WITH-RETRY" \ | 861 StepBanner "RUN-WITH-RETRY" \ |
853 "'${cmdname}' failed ${max_retries} times. Aborting." | 862 "'${cmdname}' failed ${max_retries} times. Aborting." |
854 return 1 | 863 return 1 |
855 fi | 864 fi |
856 done | 865 done |
857 | 866 |
858 } | 867 } |
OLD | NEW |