Silence -Wunused-variable in release builds.
[llvm/stm8.git] / utils / crosstool / create-snapshots.sh
blobd70232a3ce4650696bde14716ddb52ffa86faee5
1 #!/bin/bash
3 # Creates LLVM SVN snapshots: llvm-$REV.tar.bz2 and llvm-gcc-4.2-$REV.tar.bz2,
4 # where $REV is an SVN revision of LLVM. This is used for creating stable
5 # tarballs which can be used to build known-to-work crosstools.
7 # Syntax:
8 # $0 [REV] -- grabs the revision $REV from SVN; if not specified, grabs the
9 # latest SVN revision.
11 set -o nounset
12 set -o errexit
14 readonly LLVM_PROJECT_SVN="http://llvm.org/svn/llvm-project"
16 getLatestRevisionFromSVN() {
17 svn info ${LLVM_PROJECT_SVN} | egrep ^Revision | sed 's/^Revision: //'
20 readonly REV="${1:-$(getLatestRevisionFromSVN)}"
22 createTarballFromSVN() {
23 local module=$1
24 local log="${module}.log"
25 echo "Running: svn export -r ${REV} ${module}; log in ${log}"
26 svn -q export -r ${REV} ${LLVM_PROJECT_SVN}/${module}/trunk \
27 ${module} > ${log} 2>&1
29 # Create "module-revision.tar.bz2" packages from the SVN checkout dirs.
30 local tarball="${module}-${REV}.tar.bz2"
31 echo "Creating tarball: ${tarball}"
32 tar cjf ${tarball} ${module}
34 echo "Cleaning up '${module}'"
35 rm -rf ${module} ${log}
38 for module in "llvm" "llvm-gcc-4.2"; do
39 createTarballFromSVN ${module}
40 done