summaryrefslogtreecommitdiffstats
path: root/tools/clang/scripts/package.sh
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 11:44:52 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 11:44:52 +0000
commit331fabe33484fdb165dc4ca3418aa7046c717fc6 (patch)
tree7a046e0f01791a03b68a2510a06eae89fa467cbb /tools/clang/scripts/package.sh
parent02fbaefa96ef85ffcc372f21b803fa4acb9b138e (diff)
downloadchromium_src-331fabe33484fdb165dc4ca3418aa7046c717fc6.zip
chromium_src-331fabe33484fdb165dc4ca3418aa7046c717fc6.tar.gz
chromium_src-331fabe33484fdb165dc4ca3418aa7046c717fc6.tar.bz2
roll clang 138187:138500
Also pass --disable-threads and --disable-pthreads to configure, for goma. Also modify the script to try to download prebuilt binaries first. This is faster, and makes sure the bots use the exact same binary as goma. The binaries are downloaded from http://commondatastorage.googleapis.com/chromium-browser-clang/index.html Also add a script that packages a clang build up into a tgz for uploading with gsutil, based on code by ukai@. Finally, if the svn checkout fails, remove the destination directory and try again (for bots that have a checkout from before we had an internal llvm svn mirror). BUG=none TEST=none Review URL: http://codereview.chromium.org/7741039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/clang/scripts/package.sh')
-rwxr-xr-xtools/clang/scripts/package.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/clang/scripts/package.sh b/tools/clang/scripts/package.sh
new file mode 100755
index 0000000..fa0a575
--- /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
+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 -)
+
+# 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