OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/bash | |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 # This script will check out llvm and clang, and then package the results up | |
7 # to a tgz file. | |
8 | |
9 THIS_DIR="$(dirname "${0}")" | |
10 LLVM_BUILD_DIR="${THIS_DIR}/../../../third_party/llvm-build" | |
11 LLVM_BIN_DIR="${LLVM_BUILD_DIR}/Release+Asserts/bin" | |
12 LLVM_LIB_DIR="${LLVM_BUILD_DIR}/Release+Asserts/lib" | |
13 | |
14 set -ex | |
15 | |
16 # Do a clobber build. | |
17 rm -rf "${LLVM_BUILD_DIR}" | |
18 "${THIS_DIR}"/update.sh | |
19 | |
20 R=$("${LLVM_BIN_DIR}/clang" --version | \ | |
21 sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p') | |
22 | |
23 PDIR=clang-$R | |
24 rm -rf $PDIR | |
Mark Mentovai
2011/08/26 16:55:19
It’s wise to always use this as "${PDIR}" instead
Nico
2011/08/27 05:25:33
Done.
| |
25 mkdir $PDIR | |
26 mkdir $PDIR/bin | |
27 mkdir $PDIR/lib | |
28 | |
29 # Copy clang into pdir, symlink clang++ to it. | |
30 cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ | |
31 (cd $PDIR/bin && ln -sf clang clang++ && cd -) | |
32 | |
33 # Copy plugins. Some of the dylibs are pretty big, so copy only the ones we | |
34 # care about. | |
35 if [ "$(uname -s)" = "Darwin" ]; then | |
Mark Mentovai
2011/08/26 16:55:19
Same |uname -s| suggestion as in the other file ap
| |
36 cp "${LLVM_LIB_DIR}/libFindBadConstructs.dylib" $PDIR/lib | |
37 else | |
38 cp "${LLVM_LIB_DIR}/libFindBadConstructs.so" $PDIR/lib | |
39 fi | |
40 | |
41 # Copy built-in headers (lib/clang/3.0/include). | |
42 cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib | |
43 | |
44 tar zcf $PDIR.tgz -C $PDIR bin lib | |
45 | |
46 if [ "$(uname -s)" = "Darwin" ]; then | |
47 PLATFORM=Mac | |
48 else | |
49 PLATFORM=Linux_x64 | |
50 fi | |
51 | |
52 echo To upload, run: | |
53 echo gsutil cp -a public-read $PDIR.tgz \ | |
Mark Mentovai
2011/08/26 16:55:19
What sort of access control do we have on this?
Nico
2011/08/27 05:25:33
Everyone can read, only people with Magic Permissi
| |
54 gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz | |
OLD | NEW |