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
43 export PATH
="/opt/csw/bin:/usr/ccs/bin:$PATH"
49 BISON
="/opt/csw/bin/bison"
51 export PATH
="$PATH:/usr/perl5/bin"
56 NPROC
="getconf _NPROCESSORS_ONLN"
59 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
60 export CFLAGS
="-I/opt/local/include"
61 export LDFLAGS
="-L/opt/local/lib"
72 # Set configure options for each build configuration
77 CONF_OPTS
="--enable-static --disable-shared"
80 echo "Build with python bindings"
81 # We only support bindings built with Python 3
82 export PYTHON
="python3"
83 export PYTHON_CONFIG
="/usr/bin/python3-config"
84 CONF_OPTS
="--enable-python-bindings"
92 # Enter the source directory
95 # Run bootstrap in the source directory prior to configure
100 # oot : out-of-tree build
101 # dist: build via make dist
102 # * : normal tree build
104 # Make sure to move to the build_path and configure
109 echo "Out of tree build"
110 BUILD_PATH
="$WORKSPACE/oot"
111 mkdir
-p "$BUILD_PATH"
113 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
117 echo "Distribution out of tree build"
118 BUILD_PATH
="$(mktemp -d)"
120 # Initial configure and generate tarball
121 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure"
124 mkdir
-p "$BUILD_PATH"
125 cp .
/*.
tar.
* "$BUILD_PATH/"
128 # Ignore level 1 of tar
129 $TAR xvf .
/*.
tar.
* --strip 1
131 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
135 echo "LLVM clang build"
138 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
141 echo "Standard in-tree build"
142 MAKE
=$MAKE BISON
="$BISON" YACC
="$YACC" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
147 $MAKE -j "$($NPROC)" V
=1
153 # Copy tap logs for the jenkins tap parser
154 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
156 # Clean the build directory
159 # Cleanup rpath in executables and shared libraries
160 find "$PREFIX/bin" -type f
-perm -0500 -exec chrpath
--delete {} \
;
161 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
163 # Remove libtool .la files
164 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
166 # Clean temp dir for dist build
167 if [ "$build" = "dist" ]; then
This page took 0.036184 seconds and 4 git commands to generate.