Chromium Code Reviews| Index: tools/clang/scripts/package.sh |
| diff --git a/tools/clang/scripts/package.sh b/tools/clang/scripts/package.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..1fcdb16d9b04db8457f6fac256c65d385b1428e8 |
| --- /dev/null |
| +++ b/tools/clang/scripts/package.sh |
| @@ -0,0 +1,54 @@ |
| +#!/bin/bash |
| +# Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +# This script will check out llvm and clang, and then package the results up |
| +# to a tgz file. |
| + |
| +THIS_DIR="$(dirname "${0}")" |
| +LLVM_BUILD_DIR="${THIS_DIR}/../../../third_party/llvm-build" |
| +LLVM_BIN_DIR="${LLVM_BUILD_DIR}/Release+Asserts/bin" |
| +LLVM_LIB_DIR="${LLVM_BUILD_DIR}/Release+Asserts/lib" |
| + |
| +set -ex |
| + |
| +# Do a clobber build. |
| +rm -rf "${LLVM_BUILD_DIR}" |
| +"${THIS_DIR}"/update.sh |
| + |
| +R=$("${LLVM_BIN_DIR}/clang" --version | \ |
| + sed -ne 's/clang version .*(trunk \([0-9]*\))/\1/p') |
| + |
| +PDIR=clang-$R |
|
hans
2011/08/26 09:02:46
you've been careful to use absolute paths so far,
Nico
2011/08/26 09:06:19
This is intentional; the tgz file should just appe
|
| +rm -rf $PDIR |
| +mkdir $PDIR |
| +mkdir $PDIR/bin |
| +mkdir $PDIR/lib |
| + |
| +# Copy clang into pdir, symlink clang++ to it. |
| +cp "${LLVM_BIN_DIR}/clang" $PDIR/bin/ |
| +(cd $PDIR/bin && ln -sf clang clang++ && cd -) |
|
hans
2011/08/26 09:02:46
is the space in the first column intentional?
Nico
2011/08/26 09:06:19
Hm, I don't see a space. You mean the '('?
hans
2011/08/26 09:17:41
You're right. Sorry, I probably need my eyes adjus
|
| + |
| +# Copy plugins. Some of the dylibs are pretty big, so copy only the ones we |
| +# care about. |
| +if [ "$(uname -s)" = "Darwin" ]; then |
| + cp "${LLVM_LIB_DIR}/libFindBadConstructs.dylib" $PDIR/lib |
| +else |
| + cp "${LLVM_LIB_DIR}/libFindBadConstructs.so" $PDIR/lib |
| +fi |
| + |
| +# Copy built-in headers (lib/clang/3.0/include). |
| +cp -R "${LLVM_LIB_DIR}/clang" $PDIR/lib |
| + |
| +tar zcf $PDIR.tgz -C $PDIR bin lib |
| + |
| +if [ "$(uname -s)" = "Darwin" ]; then |
| + PLATFORM=Mac |
| +else |
| + PLATFORM=Linux_x64 |
| +fi |
| + |
| +echo To upload, run: |
| +echo gsutil cp -a public_read $PDIR.tgz \ |
| + gs://chromium-browser-clang/$PLATFORM/$PDIR.tgz |