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/>.
26 URCU_INCS
="$WORKSPACE/deps/liburcu/build/include/"
27 URCU_LIBS
="$WORKSPACE/deps/liburcu/build/lib/"
29 SRCDIR
="$WORKSPACE/src/lttng-ust"
30 TMPDIR
="$WORKSPACE/tmp"
31 PREFIX
="$WORKSPACE/build"
33 # Create build and tmp directories
34 rm -rf "$PREFIX" "$TMPDIR"
35 mkdir
-p "$PREFIX" "$TMPDIR"
39 # Set platform variables
51 # Export time env. variables flags
52 export LD_LIBRARY_PATH
="$URCU_LIBS:${LD_LIBRARY_PATH:-}"
55 CPPFLAGS
="-I$URCU_INCS"
56 LDFLAGS
="-L$URCU_LIBS"
59 # Set configure options for each build configuration
63 # Unsupported! liblttng-ust can't pull in it's static (.a) dependencies.
65 CONF_OPTS
="--enable-static --disable-shared"
69 echo "Enable Java agent build"
70 export CLASSPATH
="/usr/share/java/log4j-1.2.jar"
71 CONF_OPTS
+=" --enable-java-agent-all --enable-jni-interface"
73 echo "Enable Python agent build"
74 CONF_OPTS
+=" --enable-python-agent"
78 echo "Enable RCU sanity checks for debugging"
79 CPPFLAGS
="${CPPFLAGS:-} -DDEBUG_RCU"
88 # Enter the source directory
91 # Run bootstrap in the source directory prior to configure
96 # oot : out-of-tree build
97 # dist : build via make dist
98 # oot-dist: build via make dist out-of-tree
99 # * : normal tree build
101 # Make sure to move to the build_path and configure
106 echo "Out of tree build"
107 BUILD_PATH
=$WORKSPACE/oot
109 mkdir
-p "$BUILD_PATH"
112 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
116 echo "Distribution tarball in-tree build"
118 # Initial configure and generate tarball
119 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$SRCDIR/configure"
122 BUILD_PATH
="$(mktemp -d)"
123 cp .
/*.
tar.
* "$BUILD_PATH/"
126 # Ignore level 1 of tar
127 $TAR xvf .
/*.
tar.
* --strip 1
129 # Build in extracted source tree
130 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
134 echo "Distribution tarball out of tree build"
135 BUILD_PATH
="$(mktemp -d)"
138 # Initial configure and generate tarball
139 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$SRCDIR/configure"
142 NEWSRC_PATH
="$(mktemp -d)"
143 cp .
/*.
tar.
* "$NEWSRC_PATH/"
146 # Ignore level 1 of tar
147 $TAR xvf .
/*.
tar.
* --strip 1
149 BUILD_PATH
="$(mktemp -d)"
152 # Build oot from extracted sources
153 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$NEWSRC_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
157 echo "Standard in-tree build"
158 CPPFLAGS
="$CPPFLAGS" LDFLAGS
="$LDFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
163 $MAKE -j "$($NPROC)" V
=1
169 # Copy tap logs for the jenkins tap parser
170 rsync
-a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests
/ "$WORKSPACE/tap"
172 # Clean the build directory
175 # Cleanup rpath in executables and shared libraries
176 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
178 # Remove libtool .la files
179 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
181 # Clean temp dir for dist build
182 if [ "$build" = "dist" ]; then
This page took 0.032591 seconds and 4 git commands to generate.