3 # Copyright (C) 2015 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Version compare functions
20 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | head -n1`" ]
24 [ "$1" = "$2" ] && return 1 || verlte
$1 $2
28 [ "$1" = "`printf '%s\n%s' $1 $2 | sort -V | tail -n1`" ]
32 [ "$1" = "$2" ] && return 1 || vergte
$1 $2
36 # Create build directory
37 rm -rf $WORKSPACE/build
38 mkdir
-p $WORKSPACE/build
40 PREFIX
="$WORKSPACE/build"
42 # Set platform variables
48 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
55 CFLAGS
="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
56 export PATH
="$PATH:/usr/perl5/bin"
67 # Set configure options for each build configuration
72 CONF_OPTS
="--enable-static --disable-shared"
76 echo "Using pthread_getspecific() to emulate TLS"
77 CONF_OPTS
="--disable-compiler-tls"
87 # Run bootstrap prior to configure
90 # Get source version from configure script
91 eval `grep '^PACKAGE_VERSION=' ./configure`
95 # oot : out-of-tree build
96 # dist: build via make dist
97 # * : normal tree build
99 # Make sure to move to the build_path and configure
101 BUILD_PATH
=$WORKSPACE
104 echo "Out of tree build"
105 BUILD_PATH
=$WORKSPACE/oot
108 MAKE
=$MAKE CFLAGS
="$CFLAGS" $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
112 echo "Distribution out of tree build"
113 BUILD_PATH
=`mktemp -d`
115 # Initial configure and generate tarball
116 MAKE
=$MAKE .
/configure
120 cp *.
tar.
* $BUILD_PATH/
123 # Ignore level 1 of tar
124 $TAR xvf
*.
tar.
* --strip 1
126 MAKE
=$MAKE CFLAGS
="$CFLAGS" $BUILD_PATH/configure
--prefix=$PREFIX $CONF_OPTS
129 BUILD_PATH
=$WORKSPACE
130 echo "Standard tree build"
131 MAKE
=$MAKE CFLAGS
="$CFLAGS" $WORKSPACE/configure
--prefix=$PREFIX $CONF_OPTS
136 $MAKE -j `$NPROC` V
=1
141 # Only run regtest for 0.9 and up
142 if vergte
"$PACKAGE_VERSION" "0.9"; then
149 # Cleanup rpath in executables and shared libraries
150 #find $WORKSPACE/build/bin -type f -perm -0500 -exec chrpath --delete {} \;
151 find $WORKSPACE/build
/lib
-name "*.so" -exec chrpath
--delete {} \
;
153 # Remove libtool .la files
154 find $WORKSPACE/build
/lib
-name "*.la" -exec rm -f {} \
;
156 # Cleanup temp directory of dist build
157 if [ "$build" = "dist" ]; then
This page took 0.116965 seconds and 4 git commands to generate.