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 -x | 6 set -x |
7 set -e | 7 set -e |
8 | 8 |
9 SCRIPT_DIR="$(cd $(dirname $0) && pwd)" | 9 SCRIPT_DIR="$(cd $(dirname $0) && pwd)" |
10 export NACL_SDK_ROOT="${SCRIPT_DIR}/../pepper_XX" | 10 export NACL_SDK_ROOT="${SCRIPT_DIR}/../pepper_XX" |
11 | 11 |
12 RESULT=1 | 12 RESULT=1 |
13 | 13 |
14 # TODO: Eliminate this dependency if possible. | 14 # TODO: Eliminate this dependency if possible. |
15 # This is required on OSX so that the naclports version of pkg-config can be | 15 # This is required on OSX so that the naclports version of pkg-config can be |
16 # found. | 16 # found. |
17 export PATH=${PATH}:/opt/local/bin | 17 export PATH=${PATH}:/opt/local/bin |
18 | 18 |
19 StartBuild() { | 19 StartBuild() { |
20 cd $2 | 20 cd $2 |
21 export NACL_PACKAGES_BITSIZE=$3 | 21 export NACL_ARCH=$3 |
22 echo "@@@BUILD_STEP $3-bit setup@@@" | 22 echo "@@@BUILD_STEP $3 setup@@@" |
23 if ! ./$1 ; then | 23 if ! ./$1 ; then |
24 RESULT=0 | 24 RESULT=0 |
25 fi | 25 fi |
26 } | 26 } |
27 | 27 |
28 # Ignore 'periodic-' prefix. | 28 # Ignore 'periodic-' prefix. |
29 BUILDBOT_BUILDERNAME=${BUILDBOT_BUILDERNAME#periodic-} | 29 BUILDBOT_BUILDERNAME=${BUILDBOT_BUILDERNAME#periodic-} |
30 | 30 |
31 # Decode buildername. | 31 # Decode buildername. |
32 readonly BNAME_REGEX="(.+)-(.+)-(.+)" | 32 readonly BNAME_REGEX="(.+)-(.+)-(.+)" |
33 if [[ ${BUILDBOT_BUILDERNAME} =~ $BNAME_REGEX ]]; then | 33 if [[ ${BUILDBOT_BUILDERNAME} =~ $BNAME_REGEX ]]; then |
34 readonly OS=${BASH_REMATCH[1]} | 34 readonly OS=${BASH_REMATCH[1]} |
35 readonly LIBC=${BASH_REMATCH[2]} | 35 readonly LIBC=${BASH_REMATCH[2]} |
36 readonly SHARD=${BASH_REMATCH[3]} | 36 readonly SHARD=${BASH_REMATCH[3]} |
37 else | 37 else |
38 echo "Bad BUILDBOT_BUILDERNAME: ${BUILDBOT_BUILDERNAME}" 1>&2 | 38 echo "Bad BUILDBOT_BUILDERNAME: ${BUILDBOT_BUILDERNAME}" 1>&2 |
39 exit 1 | 39 exit 1 |
40 fi | 40 fi |
41 | 41 |
42 # This a temporary hack until the pnacl support is more mature | 42 # This a temporary hack until the pnacl support is more mature |
43 if [ ${LIBC} == "pnacl_newlib" ] ; then | 43 if [ ${LIBC} = "pnacl_newlib" ] ; then |
44 ${SCRIPT_DIR}/bots/pnacl_bots.sh | 44 ${SCRIPT_DIR}/bots/pnacl_bots.sh |
45 exit 0 | 45 exit 0 |
46 fi | 46 fi |
47 | 47 |
48 # Select platform specific things. | 48 # Select platform specific things. |
49 if [ "$OS" = "mac" ]; then | 49 if [ "$OS" = "mac" ]; then |
50 readonly PYTHON=python | 50 readonly PYTHON=python |
51 # Use linux config on mac too. | 51 # Use linux config on mac too. |
52 readonly BOT_OS_DIR=linux | 52 readonly BOT_OS_DIR=linux |
53 readonly TOOLCHAIN_CLEANUP='rm -rf ${SCRIPT_DIR}/native_client_sdk_*' | 53 readonly TOOLCHAIN_CLEANUP='rm -rf ${SCRIPT_DIR}/native_client_sdk_*' |
54 elif [ "$OS" = "linux" ]; then | 54 elif [ "$OS" = "linux" ]; then |
55 readonly PYTHON=python | 55 readonly PYTHON=python |
56 readonly BOT_OS_DIR=linux | 56 readonly BOT_OS_DIR=linux |
57 readonly TOOLCHAIN_CLEANUP='rm -rf ${SCRIPT_DIR}/native_client_sdk_*' | 57 readonly TOOLCHAIN_CLEANUP='rm -rf ${SCRIPT_DIR}/native_client_sdk_*' |
58 elif [ "$OS" = "win" ]; then | 58 elif [ "$OS" = "win" ]; then |
59 readonly PYTHON=python.bat | 59 readonly PYTHON=python.bat |
60 readonly BOT_OS_DIR=windows | 60 readonly BOT_OS_DIR=windows |
61 readonly TOOLCHAIN_CLEANUP='rm -rf c:/native_client_sdk' | 61 readonly TOOLCHAIN_CLEANUP='rm -rf c:/native_client_sdk' |
62 else | 62 else |
63 echo "Bad OS: ${OS}" 1>&2 | 63 echo "Bad OS: ${OS}" 1>&2 |
64 exit 1 | 64 exit 1 |
65 fi | 65 fi |
66 | 66 |
67 # Select libc | 67 # Select libc |
68 if [ "$LIBC" == "glibc" ]; then | 68 if [ "$LIBC" = "glibc" ]; then |
69 export NACL_GLIBC=1 | 69 export NACL_GLIBC=1 |
70 elif [ "$LIBC" == "newlib" ]; then | 70 elif [ "$LIBC" = "newlib" ]; then |
71 export NACL_GLIBC=0 | 71 export NACL_GLIBC=0 |
72 else | 72 else |
73 echo "Bad LIBC: ${LIBC}" 1>&2 | 73 echo "Bad LIBC: ${LIBC}" 1>&2 |
74 exit 1 | 74 exit 1 |
75 fi | 75 fi |
76 | 76 |
77 # Compute script name. | 77 # Compute script name. |
78 readonly SCRIPT_NAME="nacl-install-${BOT_OS_DIR}-ports-${SHARD}.sh" | 78 readonly SCRIPT_NAME="nacl-install-${BOT_OS_DIR}-ports-${SHARD}.sh" |
79 | 79 |
80 # Goto src/ | 80 # Goto src/ |
81 cd ${SCRIPT_DIR}/.. | 81 cd ${SCRIPT_DIR}/.. |
82 | 82 |
83 # Cleanup. | 83 # Cleanup. |
84 echo "@@@BUILD_STEP Cleanup@@@" | 84 echo "@@@BUILD_STEP Cleanup@@@" |
85 rm -rf ${SCRIPT_DIR}/toolchain | 85 rm -rf ${SCRIPT_DIR}/toolchain |
86 ${TOOLCHAIN_CLEANUP} | 86 ${TOOLCHAIN_CLEANUP} |
87 make clean | 87 make clean |
88 | 88 |
89 # Install SDK. | 89 # Install SDK. |
90 echo "@@@BUILD_STEP Install Latest SDK@@@" | 90 echo "@@@BUILD_STEP Install Latest SDK@@@" |
91 ${PYTHON} build_tools/buildbot_sdk_setup.py | 91 ${PYTHON} build_tools/buildbot_sdk_setup.py |
92 | 92 |
93 # Build 32-bit. | 93 # Build 32-bit. |
94 StartBuild ${SCRIPT_NAME} ${SCRIPT_DIR}/bots/${BOT_OS_DIR} 32 | 94 StartBuild ${SCRIPT_NAME} ${SCRIPT_DIR}/bots/${BOT_OS_DIR} i686 |
95 if [[ $RESULT != 0 ]]; then | 95 if [[ $RESULT != 0 ]]; then |
96 # Build 64-bit. | 96 # Build 64-bit. |
97 StartBuild ${SCRIPT_NAME} ${SCRIPT_DIR}/bots/${BOT_OS_DIR} 64 | 97 StartBuild ${SCRIPT_NAME} ${SCRIPT_DIR}/bots/${BOT_OS_DIR} x86_64 |
98 fi | 98 fi |
99 | 99 |
100 exit 0 | 100 exit 0 |
OLD | NEW |