[ "$res" -ne "0" ]
}
+# Required parameters
+arch=${arch:-}
+conf=${conf:-}
+build=${build:-}
+
SRCDIR="$WORKSPACE/src/liburcu"
TMPDIR="$WORKSPACE/tmp"
MAKE=gmake
TAR=gtar
NPROC=gnproc
- CFLAGS="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
+ LDFLAGS=""
+ CFLAGS=""
+ export PATH="/opt/csw/bin:/usr/ccs/bin:$PATH"
;;
solaris11)
MAKE=gmake
TAR=gtar
NPROC=nproc
- CFLAGS="-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__=1"
+ LDFLAGS=""
+ CFLAGS=""
export PATH="$PATH:/usr/perl5/bin"
;;
NPROC="getconf _NPROCESSORS_ONLN"
BISON="bison"
YACC="$BISON -y"
+ LDFLAGS="-L/opt/local/lib"
+ CFLAGS="-I/opt/local/include"
export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
- export CFLAGS="-I/opt/local/include"
- export LDFLAGS="-L/opt/local/lib"
;;
*)
MAKE=make
TAR=tar
NPROC=nproc
+ LDFLAGS=""
CFLAGS=""
;;
esac
-# Set configure options for each build configuration
+# Enter the source directory
+cd "$SRCDIR"
+
+# Run bootstrap in the source directory prior to configure
+./bootstrap
+
+# Get source version from configure script
+eval "$(grep '^PACKAGE_VERSION=' ./configure)"
+
+# Set configure options and environment variables for each build
+# configuration.
CONF_OPTS=""
case "$conf" in
static)
CONF_OPTS="--enable-static --disable-shared"
;;
-tls_fallback)
+tls_fallback)
echo "Using pthread_getspecific() to emulate TLS"
CONF_OPTS="--disable-compiler-tls"
;;
+debug-rcu)
+ echo "Enable RCU sanity checks for debugging"
+ if vergte "$PACKAGE_VERSION" "0.10"; then
+ CONF_OPTS="--enable-rcu-debug"
+ else
+ CFLAGS="$CFLAGS -DDEBUG_RCU"
+ fi
+ ;;
+
*)
echo "Standard build"
CONF_OPTS=""
;;
esac
-
-# Enter the source directory
-cd "$SRCDIR"
-
-# Run bootstrap in the source directory prior to configure
-./bootstrap
-
-# Get source version from configure script
-eval `grep '^PACKAGE_VERSION=' ./configure`
-
-
# Build type
# oot : out-of-tree build
# dist: build via make dist
BUILD_PATH=$WORKSPACE/oot
mkdir -p "$BUILD_PATH"
cd "$BUILD_PATH"
- MAKE=$MAKE CFLAGS="$CFLAGS" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
+ MAKE=$MAKE CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS
;;
dist)
echo "Distribution out of tree build"
- BUILD_PATH=`mktemp -d`
+ BUILD_PATH=$(mktemp -d)
# Initial configure and generate tarball
MAKE=$MAKE "$SRCDIR/configure"
# Ignore level 1 of tar
$TAR xvf ./*.tar.* --strip 1
- MAKE=$MAKE CFLAGS="$CFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
+ MAKE=$MAKE CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
;;
*)
echo "Standard in-tree build"
- MAKE=$MAKE CFLAGS="$CFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
+ MAKE=$MAKE CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS
;;
esac
# BUILD!
-$MAKE -j `$NPROC` V=1
+$MAKE -j "$($NPROC)" V=1
$MAKE install
# Run tests