diff options
author | Arnstein Ressem <aressem@gmail.com> | 2017-11-03 13:08:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 13:08:45 +0100 |
commit | 48e5b49d2bd0b2e0fc6086328c00dc0ffd898f03 (patch) | |
tree | 20996a1d74798f6f8550f1cccbdde19d020ef5f1 | |
parent | 3b9510271a5cb3ca0e1b2040ab85b2a308974040 (diff) |
Revert "Revert "Various minor fixes to bootstrap scripts""
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | bootstrap-cpp.sh | 24 | ||||
-rwxr-xr-x | bootstrap.sh | 2 |
3 files changed, 24 insertions, 7 deletions
diff --git a/README.md b/README.md index 37ceb44ccfd..97c4bf69bc3 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,15 @@ You can also setup CentOS 7 natively and install the following build dependencie ### Build Java modules export MAVEN_OPTS="-Xms128m -Xmx512m" - sh bootstrap.sh java + source /opt/rh/rh-maven33/enable + bash bootstrap.sh java mvn -T <num-threads> install ### Build C++ modules Replace `<build-dir>` with the name of the directory in which you'd like to build Vespa. Replace `<source-dir>` with the directory in which you've cloned/unpacked the source tree. - sh bootstrap-cpp.sh <source-dir> <build-dir> + bash bootstrap-cpp.sh <source-dir> <build-dir> cd <build-dir> make -j <num-threads> ctest3 -j <num-threads> diff --git a/bootstrap-cpp.sh b/bootstrap-cpp.sh index 0b1d5751e96..47d2a82622a 100755 --- a/bootstrap-cpp.sh +++ b/bootstrap-cpp.sh @@ -5,9 +5,10 @@ usage() { echo "Usage: $0 <source-dir> <build-dir>" >&2 } +# Parse arguments if [ $# -eq 2 ]; then - SOURCE_DIR=$(realpath $1) - BUILD_DIR=$(realpath $2) + SOURCE_DIR="$1" + BUILD_DIR="$2" elif [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then usage exit 0 @@ -17,10 +18,23 @@ else exit 1 fi -mkdir -p "${BUILD_DIR}" +# Check the source directory +if [ ! -d "$SOURCE_DIR" ] ; then + echo "Source dir $SOURCE_DIR not found" >&2 + exit 1 +fi +SOURCE_DIR=$(realpath "${SOURCE_DIR}") + +# Check (and possibly create) the build directory +mkdir -p "${BUILD_DIR}" || { + echo "Failed to create build directory" >&2 + exit 1 +} +BUILD_DIR=$(realpath "${BUILD_DIR}") +# Build it source /opt/rh/devtoolset-6/enable || true cd "${SOURCE_DIR}" -sh ./bootstrap.sh full +bash ./bootstrap.sh full cd "${BUILD_DIR}" -sh ${SOURCE_DIR}/bootstrap-cmake.sh ${SOURCE_DIR} +bash ${SOURCE_DIR}/bootstrap-cmake.sh "${SOURCE_DIR}" diff --git a/bootstrap.sh b/bootstrap.sh index 075da74b7c7..d0593eb1dee 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -5,6 +5,8 @@ usage() { echo "Usage: $0 [full | java | default]" >&2 } +source /opt/rh/rh-maven33/enable + if [ $# -eq 0 ]; then # Build minimal set of java modules required to run cmake MODE=default |