summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-05-17 15:26:03 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2015-06-11 07:29:03 -0700
commit0bb51f8a620cb059ed94bcba10d5f3d285f04371 (patch)
tree01bbed226e04b88b59884786d6a2c406a6204ba6 /configure.ac
parent013994da53831d2ee3d36714256ae9b3b109ffee (diff)
build: fix compiling on older distributions
data-tiering is disabled on RHEL-5 because it depends on a too new SQLite version. This change also prevents installing some of files that are used by geo-replication, which is also not available on RHEL-5. geo-replication depends on a too recent version of Python. Due to an older version of OpenSSL, some of the newer functions can not be used. A fallback to previous functions is done. Unfortunately RHEL-5 does not seem to have TLSv1.2 support, so only older versions can be used. Cherry picked from commit 0209b18fd65f9df5ebd0a8764ebf864d0d392998: > Change-Id: I672264a673f5432358d2e83b17e2a34efd9fd913 > BUG: 1222317 > Signed-off-by: Niels de Vos <ndevos@redhat.com> > Reviewed-on: http://review.gluster.org/10803 > Tested-by: NetBSD Build System <jenkins@build.gluster.org> > Tested-by: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> > Reviewed-by: Vijay Bellur <vbellur@redhat.com> Also including the changes from http://review.gluster.org/11140: > build: improve detection of new OpenSSL features > > Building on Mac OS X revealed that the current check for > CRYPTO_THREADID_set_callback() availability in OpenSSL is not correct. > > There also does not seem to be a guarantee that TLSv1_2_method() is > available when TLS1_2_VERSION is #define'd. > > Change-Id: I21508065fc181a1c74bee4fd6d23bb5bdf7cea7a > BUG: 1222317 > Reviewed-on: http://review.gluster.org/11140 > Original-author: Kaleb KEITHLEY <kkeithle@redhat.com> > Signed-off-by: Niels de Vos <ndevos@redhat.com> Change-Id: I672264a673f5432358d2e83b17e2a34efd9fd913 BUG: 1228510 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11096 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac50
1 files changed, 31 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index 1a09854224b..a93c1cd6de3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -388,14 +388,7 @@ AC_CHECK_HEADERS([sys/ioctl.h], AC_DEFINE(HAVE_IOCTL_IN_SYS_IOCTL_H, 1, [have sy
AC_CHECK_HEADERS([sys/extattr.h])
dnl Math library
-case $host_os in
- linux*)
- MATH_LIB=''
- ;;
- *)
- MATH_LIB='-lm'
- ;;
-esac
+AC_CHECK_LIB([m], [pow], [MATH_LIB='-lm'], [MATH_LIB=''])
AC_SUBST(MATH_LIB)
dnl use libuuid.so or fall-back to contrib/uuid
@@ -406,6 +399,16 @@ PKG_CHECK_MODULES([UUID], [uuid],
[HAVE_LIBUUID=no
UUID_CFLAGS='-I$(CONTRIBDIR)/uuid'])
AM_CONDITIONAL([HAVE_LIBUUID], [test x$HAVE_LIBUUID = xyes])
+
+dnl older version of libuuid (from e2fsprogs) require including uuid/uuid.h
+saved_CFLAGS=${CFLAGS}
+CFLAGS="${CFLAGS} ${UUID_CFLAGS}"
+AC_CHECK_HEADER([uuid.h], [], [AC_CHECK_HEADER([uuid/uuid.h])])
+CFLAGS=${saved_CFLAGS}
+if test "x$ac_cv_header_uuid_uuid_h" = "xyes"; then
+ UUID_CFLAGS="${UUID_CFLAGS} -I$(pkg-config --variable=includedir uuid)/uuid"
+fi
+
dnl libglusterfs needs uuid.h, practically everything depends on it
GF_CPPFLAGS="${GF_CPPFLAGS} ${UUID_CFLAGS}"
dnl PKGCONFIG_UUID is used for the dependency in *.pc.in files
@@ -530,6 +533,11 @@ fi
AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes])
+dnl check for old openssl
+AC_CHECK_LIB([crypto], CRYPTO_THREADID_set_callback, [AC_DEFINE([HAVE_CRYPTO_THREADID], [1], [use new OpenSSL functions])])
+
+AC_CHECK_LIB([ssl], TLSv1_2_method, [AC_DEFINE([HAVE_TLSV1_2_METHOD], [1], [use new OpenSSL functions])])
+
# start encryption/crypt section
AC_CHECK_HEADERS([openssl/cmac.h], [have_cmac_h=yes], [have_cmac_h=no])
@@ -705,6 +713,7 @@ if test "x$enable_georeplication" != "xno"; then
GEOREP_EXTRAS_SUBDIR=geo-rep
fi
AC_SUBST(GEOREP_EXTRAS_SUBDIR)
+AM_CONDITIONAL(USE_GEOREP, test "x$enable_georeplication" != "xno")
# CDC xlator - check if libz is present if so enable HAVE_LIB_Z
BUILD_CDC=yes
@@ -808,11 +817,8 @@ AC_SUBST(HAVE_BACKTRACE)
if test "x${have_backtrace}" != "xyes"; then
AC_TRY_COMPILE([#include <math.h>], [double x=0.0; x=ceil(0.0);],
- [have_math_h=yes],
+ [],
AC_MSG_ERROR([need math library for libexecinfo]))
-if test "x${have_math_h}" = "xyes"; then
- LIBS="$LIBS -lm"
-fi
fi
dnl glusterfs prints memory usage to stderr by sending it SIGUSR1
@@ -905,26 +911,29 @@ GF_HOST_OS=""
GF_LDFLAGS="-rdynamic"
dnl check for gcc -Werror=format-security
-saved_GF_CFLAGS="-Wformat -Werror=format-security"
+saved_CFLAGS=$CFLAGS
+CFLAGS="-Wformat -Werror=format-security"
AC_MSG_CHECKING([whether $CC accepts -Werror=format-security])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_format_security=yes], [cc_werror_format_security=no])
echo $cc_werror_format_security
if test "x$cc_werror_format_security" = "xno"; then
- GF_CFLAGS="$GF_CFLAGS"
+ CFLAGS="$saved_CFLAGS"
else
- GF_CFLAGS="$saved_GF_CFLAGS $GF_CFLAGS"
+ CFLAGS="$saved_CFLAGS $CFLAGS"
+ GF_CFLAGS="$GF_CFLAGS $CFLAGS"
fi
dnl check for gcc -Werror=implicit-function-declaration
-saved_GF_CFLAGS=$GF_CFLAGS
-GF_CFLAGS="-Werror=implicit-function-declaration"
+saved_CFLAGS=$CFLAGS
+CFLAGS="-Werror=implicit-function-declaration"
AC_MSG_CHECKING([whether $CC accepts -Werror=implicit-function-declaration])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [cc_werror_implicit=yes], [cc_werror_implicit=no])
echo $cc_werror_implicit
if test "x$cc_werror_implicit" = "xno"; then
- GF_CFLAGS="$saved_GF_CFLAGS"
+ CFLAGS="$saved_CFLAGS"
else
- GF_CFLAGS="$saved_GF_CFLAGS $GF_CFLAGS"
+ CFLAGS="$saved_CFLAGS $CFLAGS"
+ GF_CFLAGS="$GF_CFLAGS $CFLAGS"
fi
dnl clang is mostly GCC-compatible, but its version is much lower,
@@ -1242,6 +1251,9 @@ AC_SUBST(UNITTEST_LDFLAGS)
AC_SUBST(CFLAGS)
# end enable debug section
+dnl libglusterfs.so uses math functions
+GF_LDADD="${GF_LDADD} ${MATH_LIB}"
+
AC_SUBST(GF_HOST_OS)
AC_SUBST(GF_CFLAGS)
AC_SUBST(GF_LDFLAGS)