Update lttng-analyses jobs
[lttng-ci.git] / scripts / babeltrace / build.sh
index e9f06b1073a6eb6b68f0905a0ed6bb3af5b9810a..4aa0cb62000c3515d2ca6908d6c2252a5ef8d5b3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -exu
 #
 # Copyright (C) 2015 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
 #
@@ -25,12 +25,37 @@ PREFIX="$WORKSPACE/build"
 
 CONF_OPTS=""
 
+case "$arch" in
+solaris10)
+    MAKE=gmake
+    TAR=gtar
+    NPROC=gnproc
+    BISON=bison
+    YACC="$BISON -y"
+    ;;
+solaris11)
+    MAKE=gmake
+    TAR=gtar
+    NPROC=nproc
+    BISON="/opt/csw/bin/bison"
+    YACC="$BISON -y"
+    export PATH="$PATH:/usr/perl5/bin"
+    ;;
+*)
+    MAKE=make
+    TAR=tar
+    NPROC=nproc
+    BISON=bison
+    YACC="$BISON -y"
+    ;;
+esac
+
 case "$conf" in
 static)
     echo "Static build"
     CONF_OPTS="--enable-static --disable-shared"
     ;;
-python_bindings)  
+python-bindings)  
     echo "Build with python bindings"
     # We only support bindings built with Python 3
     export PYTHON="python3"
@@ -60,63 +85,47 @@ case "$build" in
                BUILD_PATH=$WORKSPACE/oot
                mkdir -p $BUILD_PATH
                cd $BUILD_PATH
-               $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
+               MAKE=$MAKE BISON="$BISON" YACC="$YACC" $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
                ;;
        dist)
                echo "Distribution out of tree build"
                BUILD_PATH=`mktemp -d`
 
                # Initial configure and generate tarball
-               ./configure
-               make dist
+               MAKE=$MAKE BISON="$BISON" YACC="$YACC" ./configure
+               $MAKE dist
 
                mkdir -p $BUILD_PATH
                cp *.tar.* $BUILD_PATH/
                cd $BUILD_PATH
 
                # Ignore level 1 of tar
-               tar xvf *.tar.* --strip 1
+               $TAR xvf *.tar.* --strip 1
 
-               $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
+               MAKE=$MAKE BISON="$BISON" YACC="$YACC" $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
 
                # Set test plan to dist tar
                TEST_PLAN_PATH=$BUILD_PATH
                ;;
        *)
                echo "Standard tree build"
-               $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
+               MAKE=$MAKE BISON="$BISON" YACC="$YACC" $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
                ;;
 esac
 
-make
-make install
-
-rm -rf $WORKSPACE/tap
-mkdir -p $WORKSPACE/tap
-
-cd $BUILD_PATH/tests
-
-# Run make check tests
-if [ -e $TEST_PLAN_PATH/tests/tests ]; then
-       prove --merge --exec '' - < $TEST_PLAN_PATH/tests/tests --archive $WORKSPACE/tap/ || true
-else
-       echo "Missing test plan"
-       exit 1
-fi
-
-# TAP plugin is having a hard time with .yml files.
-rm -f $WORKSPACE/tap/meta.yml
-
-# And also with files without extension, so rename all result to *.tap
-find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
-
-make clean
+$MAKE -j `$NPROC`
+$MAKE install
+$MAKE check
+$MAKE clean
 
 # Cleanup rpath and libtool .la files
-find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
+#find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
 
 if [ $build = "dist" ]; then
-       rm -rf $BUILD_PATH
+    cd $WORKSPACE
+    rm -rf $BUILD_PATH
 fi
+
+# EOF
This page took 0.038085 seconds and 4 git commands to generate.