jjb: Add multi-version clang build to babeltrace
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 25 Apr 2019 15:53:28 +0000 (11:53 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Thu, 25 Apr 2019 15:53:28 +0000 (11:53 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
jobs/babeltrace.yaml
scripts/babeltrace/build.sh

index bc843f32a01770a472f2f14066a8b14d25118f90..0fd4372183017cdbf739488111bdf6220bcb1e0a 100644 (file)
          name: build
          values: '{obj:build}'
 
+- babeltrace_build_axes_cc: &babeltrace_build_axes_cc
+    name: 'babeltrace_build_axes_cc'
+    project-type: matrix
+    node: 'master' # Applies only to matrix flyweight task
+    axes:
+      - axis:
+         type: slave
+         name: arch
+         values: '{obj:arch}'
+      - axis:
+         type: user-defined
+         name: conf
+         values: '{obj:conf}'
+      - axis:
+         type: user-defined
+         name: build
+         values: '{obj:build}'
+      - axis:
+         type: user-defined
+         name: cc
+         values: '{obj:cc}'
+
 - babeltrace_build_builders_defaults: &babeltrace_build_builders_defaults
     name: 'babeltrace_build_builders_defaults'
     builders:
     <<: *babeltrace_build_builders_defaults
     <<: *babeltrace_build_publishers_prod
 
+- job-template:
+    name: babeltrace_{version}_{cctype}
+    defaults: babeltrace
+
+    <<: *babeltrace_build_axes_cc
+    <<: *babeltrace_build_builders_defaults
+    <<: *babeltrace_build_publishers_prod
+
 - job-template:
     name: babeltrace_{version}_winbuild
     defaults: babeltrace
           arch: !!python/tuple [amd64]
           build: !!python/tuple [std, oot, dist]
           conf: !!python/tuple [std, static, python-bindings]
-      - 'babeltrace_{version}_{buildtype}':
-          buildtype: clangbuild
-          arch: !!python/tuple [amd64]
-          build: !!python/tuple [clang]
-          conf: !!python/tuple [std, static]
       - 'babeltrace_{version}_{buildtype}':
           buildtype: portbuild
           arch: !!python/tuple [armhf, arm64, powerpc, ppc64el, i386]
             - stable-1.5
             - stable-2.0
             - master
+      - 'babeltrace_{version}_{cctype}':
+          cctype: clangbuild
+          arch: !!python/tuple [amd64]
+          build: !!python/tuple [std]
+          conf: !!python/tuple [std, static]
+          cc: !!python/tuple [clang-3.9, clang-4.0, clang-6.0, clang-7]
       - 'babeltrace_{version}_winbuild':
           arch: !!python/tuple [cygwin, cygwin64, msys2-mingw32, msys2-mingw64]
           build: !!python/tuple [std]
index 85f4a5d12376359bacd028035f94c7f8842ad8bb..cf4906393e0647be73938abc88c236a4aabd167e 100755 (executable)
@@ -73,6 +73,7 @@ verne() {
 arch=${arch:-}
 conf=${conf:-}
 build=${build:-}
+cc=${cc:-}
 
 
 SRCDIR="$WORKSPACE/src/babeltrace"
@@ -86,6 +87,68 @@ mkdir -p "$PREFIX" "$TMPDIR"
 export TMPDIR
 export CFLAGS="-g -O2"
 
+# Set compiler variables
+case "$cc" in
+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
+    ;;
+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
+    ;;
+*)
+    if [ "x$cc" != "x" ]; then
+           export CC="$cc"
+    fi
+    ;;
+esac
+
+if [ "x$CC" != "x" ]; then
+    echo "Selected compiler:"
+    "$CC" -v
+fi
+
 # Set platform variables
 case "$arch" in
 sol10-i386)
@@ -195,12 +258,6 @@ case "$build" in
         "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
         ;;
 
-    clang)
-        echo "LLVM clang build"
-        export CC=clang
-        clang -v
-       "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
-        ;;
     *)
         echo "Standard in-tree build"
         "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
This page took 0.027063 seconds and 4 git commands to generate.