X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Flibrseq%2Fbuild.sh;h=d56a399fcdbe9869c88c971b44e24de5ff014c8e;hb=32dde2a3e67e7c517fe2699b3f24781b4a48ae59;hp=92865de62bb34a933c25f68cf40318ec738c26a9;hpb=4b8ed6e3be85066d8399db8d19447e05e0745fb7;p=lttng-ci.git diff --git a/scripts/librseq/build.sh b/scripts/librseq/build.sh index 92865de..d56a399 100755 --- a/scripts/librseq/build.sh +++ b/scripts/librseq/build.sh @@ -1,7 +1,7 @@ -#!/bin/bash -exu +#!/bin/bash # # Copyright (C) 2015 Jonathan Rajotte-Julien -# Copyright (C) 2019 Michael Jeanson +# Copyright (C) 2019-2020 Michael Jeanson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +set -exu + # Version compare functions vercomp () { set +u @@ -69,10 +71,20 @@ verne() { [ "$res" -ne "0" ] } +failed_configure() { + # Assume we are in the configured build directory + echo "#################### BEGIN config.log ####################" + cat config.log + echo "#################### END config.log ####################" + + # End the build with failure + exit 1 +} + # Required variables WORKSPACE=${WORKSPACE:-} -arch=${arch:-} +platform=${platform:-} conf=${conf:-} build=${build:-} cc=${cc:-} @@ -99,49 +111,17 @@ gcc) export CC=gcc export CXX=g++ ;; -gcc-4.8) - export CC=gcc-4.8 - export CXX=g++-4.8 - ;; -gcc-5) - export CC=gcc-5 - export CXX=g++-5 - ;; -gcc-6) - export CC=gcc-6 - export CXX=g++-6 - ;; -gcc-7) - export CC=gcc-7 - export CXX=g++-7 - ;; -gcc-8) - export CC=gcc-8 - export CXX=g++-8 +gcc-*) + export CC=gcc-${cc#gcc-} + export CXX=g++-${cc#gcc-} ;; clang) export CC=clang export CXX=clang++ ;; -clang-3.9) - export CC=clang-3.9 - export CXX=clang++-3.9 - ;; -clang-4.0) - export CC=clang-4.0 - export CXX=clang++-4.0 - ;; -clang-5.0) - export CC=clang-5.0 - export CXX=clang++-5.0 - ;; -clang-6.0) - export CC=clang-6.0 - export CXX=clang++-6.0 - ;; -clang-7) - export CC=clang-7 - export CXX=clang++-7 +clang-*) + export CC=clang-${cc#clang-} + export CXX=clang++-${cc#clang-} ;; *) if [ "x$cc" != "x" ]; then @@ -156,7 +136,7 @@ if [ "x${CC:-}" != "x" ]; then fi # Set platform variables -case "$arch" in +case "$platform" in *) export MAKE=make export TAR=tar @@ -166,6 +146,10 @@ case "$arch" in ;; esac +# Print build env details +print_os || true +print_tooling || true + # Enter the source directory cd "$SRCDIR" @@ -208,7 +192,7 @@ oot) builddir=$(mktemp -d) cd "$builddir" - "$SRCDIR/configure" "${CONF_OPTS[@]}" + "$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure ;; dist) @@ -216,7 +200,7 @@ dist) # Run configure and generate the tar file # in the source directory - ./configure + ./configure || failed_configure $MAKE dist # Create and enter a temporary build directory @@ -228,7 +212,7 @@ dist) $TAR xvf "$SRCDIR"/*.tar.* --strip 1 # Build in extracted source tree - ./configure "${CONF_OPTS[@]}" + ./configure "${CONF_OPTS[@]}" || failed_configure ;; oot-dist) @@ -239,7 +223,7 @@ oot-dist) cd "$builddir" # Run configure out of tree and generate the tar file - "$SRCDIR/configure" + "$SRCDIR/configure" || failed_configure $MAKE dist dist_srcdir="$(mktemp -d)" @@ -255,12 +239,12 @@ oot-dist) # Run configure from the extracted distribution tar, # out of the source tree - "$dist_srcdir/configure" "${CONF_OPTS[@]}" + "$dist_srcdir/configure" "${CONF_OPTS[@]}" || failed_configure ;; *) echo "Standard in-tree build" - ./configure "${CONF_OPTS[@]}" + ./configure "${CONF_OPTS[@]}" || failed_configure ;; esac @@ -279,7 +263,7 @@ ret=$? set -e # Copy tap logs for the jenkins tap parser before cleaning the build dir -#rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap" +rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$WORKSPACE/tap" # Clean the build directory $MAKE clean