summaryrefslogtreecommitdiffstats
path: root/bootstrap-cpp.sh
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahoo-inc.com>2017-08-17 10:58:17 +0200
committerGeir Storli <geirst@yahoo-inc.com>2017-08-17 10:58:17 +0200
commita0d6cef6e791fc7d2b0bc4eeaccc48aebb913486 (patch)
tree1ed0b9e1db6bb4a11a2b8bb23535677f53f793a9 /bootstrap-cpp.sh
parent058e91c3edd6fcf69d66945f2e3ea5949df32621 (diff)
Add script to bootstrap cpp build.
Diffstat (limited to 'bootstrap-cpp.sh')
-rwxr-xr-xbootstrap-cpp.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/bootstrap-cpp.sh b/bootstrap-cpp.sh
new file mode 100755
index 00000000000..9edac9c5602
--- /dev/null
+++ b/bootstrap-cpp.sh
@@ -0,0 +1,34 @@
+#!/bin/bash -e
+# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+usage() {
+ echo "Usage: $0 <source-dir> <build-dir>" >&2
+}
+
+if [ $# -eq 2 ]; then
+ SOURCE_DIR=$1
+ BUILD_DIR=$2
+elif [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then
+ usage
+ exit 0
+else
+ echo "Wrong number of arguments: expected 2, was $#" >&2
+ usage
+ exit 1
+fi
+
+mkdir -p "${BUILD_DIR}"
+
+source /opt/rh/devtoolset-6/enable || true
+cd "${SOURCE_DIR}"
+sh ./bootstrap.sh full
+cd "${BUILD_DIR}"
+cmake3 \
+ -DCMAKE_INSTALL_PREFIX=/opt/vespa \
+ -DJAVA_HOME=/usr/lib/jvm/java-openjdk \
+ -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \
+ -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \
+ -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \
+ -DCMAKE_BUILD_RPATH=/opt/vespa/lib64 \
+ -DVALGRIND_UNIT_TESTS=no \
+ "${SOURCE_DIR}"