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
="$?"
73 SRCDIR
="$WORKSPACE/src/liburcu"
74 TMPDIR
="$WORKSPACE/tmp"
75 PREFIX
="$WORKSPACE/build"
77 # Create build and tmp directories
78 rm -rf "$PREFIX" "$TMPDIR"
79 mkdir
-p "$PREFIX" "$TMPDIR"
83 # Set platform variables
89 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
96 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
97 export PATH
="$PATH:/usr/perl5/bin"
103 NPROC
="getconf _NPROCESSORS_ONLN"
106 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
107 export CFLAGS
="-I/opt/local/include"
108 export LDFLAGS
="-L/opt/local/lib"
119 # Set configure options for each build configuration
124 CONF_OPTS
="--enable-static --disable-shared"
128 echo "Using pthread_getspecific() to emulate TLS"
129 CONF_OPTS
="--disable-compiler-tls"
133 echo "Standard build"
139 # Enter the source directory
142 # Run bootstrap in the source directory prior to configure
145 # Get source version from configure script
146 eval `grep '^PACKAGE_VERSION=' ./configure`
150 # oot : out-of-tree build
151 # dist: build via make dist
152 # * : normal tree build
154 # Make sure to move to the build_path and configure
159 echo "Out of tree build"
160 BUILD_PATH
=$WORKSPACE/oot
161 mkdir
-p "$BUILD_PATH"
163 MAKE
=$MAKE CFLAGS
="$CFLAGS" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
167 echo "Distribution out of tree build"
168 BUILD_PATH
=`mktemp -d`
170 # Initial configure and generate tarball
171 MAKE
=$MAKE "$SRCDIR/configure"
174 mkdir
-p "$BUILD_PATH"
175 cp .
/*.
tar.
* "$BUILD_PATH/"
178 # Ignore level 1 of tar
179 $TAR xvf .
/*.
tar.
* --strip 1
181 MAKE
=$MAKE CFLAGS
="$CFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
184 echo "Standard in-tree build"
185 MAKE
=$MAKE CFLAGS
="$CFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
190 $MAKE -j `$NPROC` V
=1
195 # Only run regtest for 0.9 and up
196 if vergte
"$PACKAGE_VERSION" "0.9"; then
203 # Cleanup rpath in executables and shared libraries
204 #find $WORKSPACE/build/bin -type f -perm -0500 -exec chrpath --delete {} \;
205 find "$PREFIX/lib" -name "*.so" -exec chrpath
--delete {} \
;
207 # Remove libtool .la files
208 find "$PREFIX/lib" -name "*.la" -exec rm -f {} \
;
210 # Cleanup temp directory of dist build
211 if [ "$build" = "dist" ]; then
This page took 0.036999 seconds and 5 git commands to generate.