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 -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g | head -n1)" ]
25 [ "$1" = "$2" ] && return 1 || verlte
"$1" "$2"
29 [ "$1" = "$(printf '%s\n%s' "$1" "$2" | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g | 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"
67 NPROC
="getconf _NPROCESSORS_ONLN"
70 export PATH
="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
71 export CFLAGS
="-I/opt/local/include"
72 export LDFLAGS
="-L/opt/local/lib"
83 # Set configure options for each build configuration
88 CONF_OPTS
="--enable-static --disable-shared"
92 echo "Using pthread_getspecific() to emulate TLS"
93 CONF_OPTS
="--disable-compiler-tls"
103 # Enter the source directory
106 # Run bootstrap in the source directory prior to configure
109 # Get source version from configure script
110 eval `grep '^PACKAGE_VERSION=' ./configure`
114 # oot : out-of-tree build
115 # dist: build via make dist
116 # * : normal tree build
118 # Make sure to move to the build_path and configure
123 echo "Out of tree build"
124 BUILD_PATH
=$WORKSPACE/oot
127 MAKE
=$MAKE CFLAGS
="$CFLAGS" $SRCDIR/configure
--prefix=$PREFIX $CONF_OPTS
131 echo "Distribution out of tree build"
132 BUILD_PATH
=`mktemp -d`
134 # Initial configure and generate tarball
135 MAKE
=$MAKE $SRCDIR/configure
139 cp *.
tar.
* $BUILD_PATH/
142 # Ignore level 1 of tar
143 $TAR xvf
*.
tar.
* --strip 1
145 MAKE
=$MAKE CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
148 echo "Standard in-tree build"
149 MAKE
=$MAKE CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
154 $MAKE -j `$NPROC` V
=1
159 # Only run regtest for 0.9 and up
160 if vergte
"$PACKAGE_VERSION" "0.9"; then
167 # Cleanup rpath in executables and shared libraries
168 #find $WORKSPACE/build/bin -type f -perm -0500 -exec chrpath --delete {} \;
169 find $PREFIX/lib
-name "*.so" -exec chrpath
--delete {} \
;
171 # Remove libtool .la files
172 find $PREFIX/lib
-name "*.la" -exec rm -f {} \
;
174 # Cleanup temp directory of dist build
175 if [ "$build" = "dist" ]; then
This page took 0.039078 seconds and 4 git commands to generate.