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/>.
19 # Version compare functions
22 if [[ "$1" == "$2" ]]; then
26 local i ver1
=($1) ver2
=($2)
27 # fill empty fields in ver1 with zeros
28 for ((i
=${#ver1[@]}; i
<${#ver2[@]}; i
++)); do
31 for ((i
=0; i
<${#ver1[@]}; i
++)); do
32 if [[ -z ${ver2[i]} ]]; then
33 # fill empty fields in ver2 with zeros
36 if ((10#${ver1[i]} > 10#${ver2[i]})); then
39 if ((10#${ver1[i]} < 10#${ver2[i]})); then
48 vercomp
"$1" "$2"; local res
="$?"
49 [ "$res" -eq "0" ] ||
[ "$res" -eq "2" ]
53 vercomp
"$1" "$2"; local res
="$?"
58 vercomp
"$1" "$2"; local res
="$?"
59 [ "$res" -eq "0" ] ||
[ "$res" -eq "1" ]
63 vercomp
"$1" "$2"; local res
="$?"
68 vercomp
"$1" "$2"; local res
="$?"
78 SRCDIR
="$WORKSPACE/src/babeltrace"
79 TMPDIR
="$WORKSPACE/tmp"
80 PREFIX
="$WORKSPACE/build"
82 # Create build and tmp directories
83 rm -rf "$PREFIX" "$TMPDIR"
84 mkdir
-p "$PREFIX" "$TMPDIR"
87 export CFLAGS
="-g -O2"
89 # Set platform variables
96 export YACC
="$BISON -y"
97 export PATH
="/opt/csw/bin:/usr/ccs/bin:$PATH"
98 export CPPFLAGS
="-I/opt/csw/include"
99 export LDFLAGS
="-L/opt/csw/lib -R/opt/csw/lib"
100 export PKG_CONFIG_PATH
="/opt/csw/lib/pkgconfig"
106 export BISON
="/opt/csw/bin/bison"
107 export YACC
="$BISON -y"
108 export PATH
="$PATH:/usr/perl5/bin"
109 export CPPFLAGS
="-I/opt/csw/include"
110 export LDFLAGS
="-L/opt/csw/lib -R/opt/csw/lib"
111 export LD_ALTEXEC
=/usr
/sfw
/bin
/gld
112 export LD
=/usr
/sfw
/bin
/gld
117 export NPROC
="getconf _NPROCESSORS_ONLN"
119 export YACC
="$BISON -y"
120 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
121 export CFLAGS
="$CFLAGS -I/opt/local/include"
122 export LDFLAGS
="-L/opt/local/lib"
131 # Enter the source directory
134 # Run bootstrap in the source directory prior to configure
137 # Get source version from configure script
138 eval "$(grep '^PACKAGE_VERSION=' ./configure)"
140 # Set configure options for each build configuration
145 CONF_OPTS
="--enable-static --disable-shared"
146 if vergte
"$PACKAGE_VERSION" "2.0"; then
147 CONF_OPTS
="${CONF_OPTS} --enable-built-in-plugins"
151 echo "Build with python bindings"
152 # We only support bindings built with Python 3
153 export PYTHON
="python3"
154 export PYTHON_CONFIG
="/usr/bin/python3-config"
155 CONF_OPTS
="--enable-python-bindings"
157 if vergte
"$PACKAGE_VERSION" "2.0"; then
158 CONF_OPTS
="${CONF_OPTS} --enable-python-bindings-doc --enable-python-plugins"
162 echo "Standard build"
168 # oot : out-of-tree build
169 # dist: build via make dist
170 # * : normal tree build
172 # Make sure to move to the build_path and configure
177 echo "Out of tree build"
178 BUILD_PATH
="$WORKSPACE/oot"
179 mkdir
-p "$BUILD_PATH"
181 "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
185 echo "Distribution out of tree build"
186 BUILD_PATH
="$(mktemp -d)"
188 # Initial configure and generate tarball
192 mkdir
-p "$BUILD_PATH"
193 cp .
/*.
tar.
* "$BUILD_PATH/"
196 # Ignore level 1 of tar
197 $TAR xvf .
/*.
tar.
* --strip 1
199 "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
203 echo "LLVM clang build"
206 "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
209 echo "Standard in-tree build"
210 "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
215 $MAKE -j "$($NPROC)" V
=1
219 $MAKE --keep-going check
221 # Copy tap logs for the jenkins tap parser
222 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
224 # Clean the build directory
227 # Cleanup rpath in executables and shared libraries
228 find "$PREFIX/bin" -type f
-perm -0500 -exec chrpath
--delete {} \
;
229 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
231 # Remove libtool .la files
232 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
234 # Clean temp dir for dist build
235 if [ "$build" = "dist" ]; then
This page took 0.034313 seconds and 4 git commands to generate.