summaryrefslogtreecommitdiffstats
path: root/build_env
diff options
context:
space:
mode:
authorkrad <krad@fb.com>2017-08-17 14:09:13 -0700
committerJeff Darcy <jeff@pl.atyp.us>2017-08-18 12:28:02 +0000
commit2f343120302e7ed3ea42f276a0a92e557582ad51 (patch)
tree51f2b83e4df7ba4f11ed224ffb893661c89dff1c /build_env
parent233156d6fc1eabed41fcae6a877db3d66ff6f073 (diff)
fb-smoke: Add fb-smoke, build and build_env to r-3.8
Summary: The new plan is to keep fb-smoke, build and build_env in every version of gluster. Changes in r-3.6 will be ported to r-3.8 henceforth. We reference fbcode for remote testing. Test Plan: Run unit, asan, valgrind Reviewers: junsongli, sshreyas, jdarcy Reviewed By: jdarcy Subscribers: #posix_storage Differential Revision: https://phabricator.intern.facebook.com/D5653092 Tasks: T20082902 Change-Id: Iebf4cfc1752e97d6f9efe80af88ee06c21103d83 Signature: t1:5653092:1503006640:642f075cba3a7295af42638e100d2e48f426f07a Reviewed-on: https://review.gluster.org/18055 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> Tested-by: Jeff Darcy <jeff@pl.atyp.us> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'build_env')
-rw-r--r--build_env54
1 files changed, 54 insertions, 0 deletions
diff --git a/build_env b/build_env
new file mode 100644
index 00000000000..5c53cc57b72
--- /dev/null
+++ b/build_env
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+#
+# Note: The GF_CONF_OPTS (configure) options will only be used for dev or
+# test builds. For RPM builds the configure options are defined in the
+# glusterfs.spec.in file. ASAN is not enabled by for RPMs as it degrades
+# performance. In specific instances it can be enabled simply be appending
+# the --with-asan option in the %build step of the spec file.
+#
+
+GF_CONF_OPTS="--localstatedir=/var --sysconfdir /var/lib --prefix /usr --libdir /usr/lib64 \
+ --enable-fusermount --enable-api --with-jemalloc \
+ --with-ipv6-default --with-fbextras --disable-tiering"
+
+if [ -x /usr/lib/rpm/redhat/dist.sh ]; then
+ REDHAT_MAJOR=$(/usr/lib/rpm/redhat/dist.sh --distnum)
+else
+ REDHAT_MAJOR=0
+fi
+
+# Enable systemd support on CentOS >= 7
+if [ $REDHAT_MAJOR -ge 7 ]; then
+ GF_CONF_OPTS="$GF_CONF_OPTS --with-systemd"
+fi
+export GF_CONF_OPTS
+
+# Check if ASAN is enabled
+if [ "$ASAN_ENABLED" -eq "1" ]; then
+ GF_CONF_OPTS="$GF_CONF_OPTS --with-asan"
+fi
+
+if [ $REDHAT_MAJOR -eq "7" ]; then
+ GCC_BIN="/opt/rh/devtoolset-4/root/usr/bin/gcc"
+ GCC_LIB="/opt/rh/devtoolset-4/root/lib64"
+ DESTDIR='/' # pycompile is finicky in centos7 if --destdir is passed nothing.
+elif [ $REDHAT_MAJOR -eq "6" ]; then
+ ENGSHARE_GCC_PATH="/mnt/vol/engshare/third-party2/gcc"
+ GCC_BIN="$ENGSHARE_GCC_PATH/4.9.x/centos6-native/108cf83/bin/gcc"
+ GCC_LIB="$ENGSHARE_GCC_PATH/4.9.x/centos6-native/108cf83/lib64"
+else
+ echo "Centos $REDHAT_MAJOR is not currently supported"
+ exit 1
+fi
+
+export LIB_DIR="$GCC_LIB"
+export CC="$GCC_BIN"
+
+#export CC="/mnt/vol/engshare/third-party2/gcc/4.9.x/centos6-native/108cf83/bin/gcc"
+
+# If you think this should all be done in configure.ac you'd be 100%
+# correct; aside from the fact that it simply doesn't work when done there :).
+# You'll find the debug symbols are not present in resultant binaries nor is
+# the code un-optimized.
+export CFLAGS="-O0 -ggdb -fPIC -Wall -Werror -L${LIB_DIR}"