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
21 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
25 [ "$1" = "$2" ] && return 1 || verlte
$1 $2
29 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | tail -n1`" ]
33 [ "$1" = "$2" ] && return 1 || vergte
$1 $2
37 SRCDIR
="$WORKSPACE/src/liburcu"
38 TMPDIR
="$WORKSPACE/tmp"
39 PREFIX
="$WORKSPACE/build"
41 # Create build and tmp directories
42 rm -rf "$PREFIX" "$TMPDIR"
43 mkdir
-p "$PREFIX" "$TMPDIR"
47 # Set platform variables
53 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
60 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
61 export PATH
="$PATH:/usr/perl5/bin"
72 # Set configure options for each build configuration
77 CONF_OPTS
="--enable-static --disable-shared"
81 echo "Using pthread_getspecific() to emulate TLS"
82 CONF_OPTS
="--disable-compiler-tls"
92 # Enter the source directory
95 # Run bootstrap in the source directory prior to configure
98 # Get source version from configure script
99 eval `grep '^PACKAGE_VERSION=' ./configure`
103 # oot : out-of-tree build
104 # dist: build via make dist
105 # * : normal tree build
107 # Make sure to move to the build_path and configure
112 echo "Out of tree build"
113 BUILD_PATH
=$WORKSPACE/oot
116 MAKE
=$MAKE CFLAGS
="$CFLAGS" $SRCDIR/configure
--prefix=$PREFIX $CONF_OPTS
120 echo "Distribution out of tree build"
121 BUILD_PATH
=`mktemp -d`
123 # Initial configure and generate tarball
124 MAKE
=$MAKE $SRCDIR/configure
128 cp *.
tar.
* $BUILD_PATH/
131 # Ignore level 1 of tar
132 $TAR xvf
*.
tar.
* --strip 1
134 MAKE
=$MAKE CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
137 echo "Standard in-tree build"
138 MAKE
=$MAKE CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
143 $MAKE -j `$NPROC` V
=1
148 # Only run regtest for 0.9 and up
149 if vergte
"$PACKAGE_VERSION" "0.9"; then
156 # Cleanup rpath in executables and shared libraries
157 #find $WORKSPACE/build/bin -type f -perm -0500 -exec chrpath --delete {} \;
158 find $PREFIX/lib
-name "*.so" -exec chrpath
--delete {} \
;
160 # Remove libtool .la files
161 find $PREFIX/lib
-name "*.la" -exec rm -f {} \
;
163 # Cleanup temp directory of dist build
164 if [ "$build" = "dist" ]; then
This page took 0.038151 seconds and 4 git commands to generate.