3 # Copyright (C) 2015 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
4 # 2016 - Michael Jeanson <mjeanson@efficios.com>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 SRCDIR
="$WORKSPACE/src/babeltrace"
26 TMPDIR
="$WORKSPACE/tmp"
27 PREFIX
="$WORKSPACE/build"
29 # Create build and tmp directories
30 rm -rf "$PREFIX" "$TMPDIR"
31 mkdir
-p "$PREFIX" "$TMPDIR"
35 # Set platform variables
48 BISON
="/opt/csw/bin/bison"
50 export PATH
="$PATH:/usr/perl5/bin"
55 NPROC
="getconf _NPROCESSORS_ONLN"
58 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
59 export CFLAGS
="-I/opt/local/include"
60 export LDFLAGS
="-L/opt/local/lib"
71 # Set configure options for each build configuration
76 CONF_OPTS
="--enable-static --disable-shared"
79 echo "Build with python bindings"
80 # We only support bindings built with Python 3
81 export PYTHON
="python3"
82 export PYTHON_CONFIG
="/usr/bin/python3-config"
83 CONF_OPTS
="--enable-python-bindings"
91 # Enter the source directory
94 # Run bootstrap in the source directory prior to configure
99 # oot : out-of-tree build
100 # dist: build via make dist
101 # * : normal tree build
103 # Make sure to move to the build_path and configure
108 echo "Out of tree build"
109 BUILD_PATH
="$WORKSPACE/oot"
110 mkdir
-p "$BUILD_PATH"
112 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
116 echo "Distribution out of tree build"
117 BUILD_PATH
="$(mktemp -d)"
119 # Initial configure and generate tarball
120 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure"
123 mkdir
-p "$BUILD_PATH"
124 cp .
/*.
tar.
* "$BUILD_PATH/"
127 # Ignore level 1 of tar
128 $TAR xvf .
/*.
tar.
* --strip 1
130 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
134 echo "LLVM clang build"
137 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
140 echo "Standard in-tree build"
141 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
146 $MAKE -j "$($NPROC)" V
=1
152 # Copy tap logs for the jenkins tap parser
153 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
155 # Clean the build directory
158 # Cleanup rpath in executables and shared libraries
159 find "$PREFIX/bin" -type f
-perm -0500 -exec chrpath
--delete {} \
;
160 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
162 # Remove libtool .la files
163 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
165 # Clean temp dir for dist build
166 if [ "$build" = "dist" ]; then
This page took 0.039492 seconds and 4 git commands to generate.