aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2016-04-22 16:47:57 +0300
committerDiana Picus <diana.picus@linaro.org>2016-04-27 11:12:58 +0300
commit416bc4fa97ca57032c7e1ae8402510e5cc033938 (patch)
treea2eb0de1610d6dc0eb7b6fc87c0a55cc7bf3905e /helpers
parentec97c50454eb23d0b549e9ae01cbdfa537cdb2b9 (diff)
downloadlinaro-scripts-416bc4fa97ca57032c7e1ae8402510e5cc033938.tar.gz
Typos & nitpicks
Fix some typos in the READMEs. Nit #1: Use full path when cloning repo If we use the basename, we're forced to run the script from the directory where we want the whole thing to live. By using the full path, we can run the script from anywhere. Nit #2: Use more general name for variable (generator vs ninja) Nit #3 (noticed by Renato): Set generator explicitly in llvm-build When ninja is not found, we use make for the build. However, we don't tell cmake about it and instead let it choose its own default generator. This commit explicitly sets the cmake generator to "Unix Makefiles", in case cmake's default generator for the current platform is not make. In order to get this to work, it was necessary to make some changes to the safe_run helper function, so we wouldn't lose the quotes around "Unix Makefiles". Change-Id: I9592645d517d006b0e680a2996d498e57f009400
Diffstat (limited to 'helpers')
-rwxr-xr-xhelpers/llvm-build6
-rwxr-xr-xhelpers/llvm-common5
-rwxr-xr-xhelpers/llvm-prepare3
3 files changed, 6 insertions, 8 deletions
diff --git a/helpers/llvm-build b/helpers/llvm-build
index 8d2fab4..5b4f27d 100755
--- a/helpers/llvm-build
+++ b/helpers/llvm-build
@@ -61,10 +61,10 @@ fi
## Choose between make and ninja
make=make
-ninja=
+generator="Unix Makefiles"
if which ninja 2>&1 > /dev/null; then
make=ninja
- ninja="-G Ninja"
+ generator="Ninja"
fi
## Debug mode, make it lighter
@@ -83,7 +83,7 @@ cd $build_dir
## Re-run CMake file files are damaged / not there
if [ ! -f build.ninja ] && [ ! -f Makefile ]; then
echo " + Configuring Build"
- safe_run cmake $ninja $LLVM_SRC \
+ safe_run cmake -G "$generator" $LLVM_SRC \
-DCMAKE_BUILD_TYPE=$build_type \
-DLLVM_BUILD_TESTS=True \
-DLLVM_ENABLE_ASSERTIONS=True \
diff --git a/helpers/llvm-common b/helpers/llvm-common
index 5cf3f4a..d7de48f 100755
--- a/helpers/llvm-common
+++ b/helpers/llvm-common
@@ -43,10 +43,9 @@ get_branches() {
}
safe_run() {
- CMD="$*"
- $CMD
+ "$@"
if [[ $? != 0 ]]; then
- echo "'$CMD' failed, bailing out"
+ echo "'$@' failed, bailing out"
exit 1
fi
}
diff --git a/helpers/llvm-prepare b/helpers/llvm-prepare
index a6cd8cf..babc77c 100755
--- a/helpers/llvm-prepare
+++ b/helpers/llvm-prepare
@@ -11,12 +11,11 @@ function prepare() {
src=$1
origin=$2
svn=$3
- dir=`basename $src`
# Clone Linaro repo
if [ ! -d $src/.git ]; then
mkdir -p $src
cd $src/..
- safe_run git clone $origin $dir
+ safe_run git clone $origin $src
fi
# Link with upstream SVN
if [[ $LLVM_GITRW = 'yes' && ! -d $src/.git/svn ]]; then