diff options
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 711 |
1 files changed, 377 insertions, 334 deletions
diff --git a/configure.ac b/configure.ac index 5c598717337..e2d6fd66cec 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_INIT([glusterfs], AC_SUBST([PACKAGE_RELEASE], [m4_esyscmd([build-aux/pkg-version --release])]) -AM_INIT_AUTOMAKE(tar-pax) +AM_INIT_AUTOMAKE([tar-pax foreign]) # Removes warnings when using automake 1.14 around (...but option 'subdir-objects' is disabled ) #but libglusterfs fails to build with contrib (Then are not set up that way?) @@ -21,16 +21,13 @@ AM_INIT_AUTOMAKE(tar-pax) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)]) -if make --help 2>&1 | grep -q no-print-directory; then - AM_MAKEFLAGS="$AM_MAKEFLAGS --no-print-directory"; -fi - AC_CONFIG_HEADERS([config.h site.h]) AC_CONFIG_FILES([Makefile libglusterfs/Makefile libglusterfs/src/Makefile - libglusterfs/src/gfdb/Makefile + libglusterd/Makefile + libglusterd/src/Makefile geo-replication/src/peer_gsec_create geo-replication/src/peer_mountbroker geo-replication/src/peer_mountbroker.py @@ -47,11 +44,8 @@ AC_CONFIG_FILES([Makefile rpc/rpc-transport/Makefile rpc/rpc-transport/socket/Makefile rpc/rpc-transport/socket/src/Makefile - rpc/rpc-transport/rdma/Makefile - rpc/rpc-transport/rdma/src/Makefile rpc/xdr/Makefile rpc/xdr/src/Makefile - rpc/xdr/gen/Makefile xlators/Makefile xlators/meta/Makefile xlators/meta/src/Makefile @@ -64,13 +58,9 @@ AC_CONFIG_FILES([Makefile xlators/storage/Makefile xlators/storage/posix/Makefile xlators/storage/posix/src/Makefile - xlators/storage/bd/Makefile - xlators/storage/bd/src/Makefile xlators/cluster/Makefile xlators/cluster/afr/Makefile xlators/cluster/afr/src/Makefile - xlators/cluster/stripe/Makefile - xlators/cluster/stripe/src/Makefile xlators/cluster/dht/Makefile xlators/cluster/dht/src/Makefile xlators/cluster/ec/Makefile @@ -86,16 +76,12 @@ AC_CONFIG_FILES([Makefile xlators/performance/io-threads/src/Makefile xlators/performance/io-cache/Makefile xlators/performance/io-cache/src/Makefile - xlators/performance/symlink-cache/Makefile - xlators/performance/symlink-cache/src/Makefile xlators/performance/quick-read/Makefile xlators/performance/quick-read/src/Makefile xlators/performance/open-behind/Makefile xlators/performance/open-behind/src/Makefile xlators/performance/md-cache/Makefile xlators/performance/md-cache/src/Makefile - xlators/performance/decompounder/Makefile - xlators/performance/decompounder/src/Makefile xlators/performance/nl-cache/Makefile xlators/performance/nl-cache/src/Makefile xlators/debug/Makefile @@ -128,14 +114,6 @@ AC_CONFIG_FILES([Makefile xlators/features/changelog/src/Makefile xlators/features/changelog/lib/Makefile xlators/features/changelog/lib/src/Makefile - xlators/features/changetimerecorder/Makefile - xlators/features/changetimerecorder/src/Makefile - xlators/features/glupy/Makefile - xlators/features/glupy/examples/Makefile - xlators/features/glupy/src/Makefile - xlators/features/glupy/src/setup.py - xlators/features/glupy/src/__init__.py - xlators/features/glupy/src/glupy/Makefile xlators/features/locks/Makefile xlators/features/locks/src/Makefile xlators/features/quota/Makefile @@ -180,14 +158,17 @@ AC_CONFIG_FILES([Makefile xlators/features/cloudsync/src/Makefile xlators/features/utime/Makefile xlators/features/utime/src/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/src/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/Makefile + xlators/features/cloudsync/src/cloudsync-plugins/src/cvlt/src/Makefile + xlators/features/metadisp/Makefile + xlators/features/metadisp/src/Makefile xlators/playground/Makefile xlators/playground/template/Makefile xlators/playground/template/src/Makefile - xlators/encryption/Makefile - xlators/encryption/rot-13/Makefile - xlators/encryption/rot-13/src/Makefile - xlators/encryption/crypt/Makefile - xlators/encryption/crypt/src/Makefile xlators/system/Makefile xlators/system/posix-acl/Makefile xlators/system/posix-acl/src/Makefile @@ -212,10 +193,15 @@ AC_CONFIG_FILES([Makefile extras/init.d/glustereventsd-Debian extras/init.d/glustereventsd-Redhat extras/init.d/glustereventsd-FreeBSD + extras/ganesha/Makefile + extras/ganesha/config/Makefile + extras/ganesha/scripts/Makefile + extras/ganesha/ocf/Makefile extras/systemd/Makefile extras/systemd/glusterd.service extras/systemd/glustereventsd.service extras/systemd/glusterfssharedstorage.service + extras/systemd/gluster-ta-volume.service extras/run-gluster.tmpfiles extras/benchmarking/Makefile extras/hook-scripts/Makefile @@ -242,6 +228,7 @@ AC_CONFIG_FILES([Makefile extras/hook-scripts/reset/Makefile extras/hook-scripts/reset/post/Makefile extras/hook-scripts/reset/pre/Makefile + extras/python/Makefile extras/snap_scheduler/Makefile events/Makefile events/src/Makefile @@ -249,10 +236,8 @@ AC_CONFIG_FILES([Makefile events/tools/Makefile contrib/fuse-util/Makefile contrib/umountd/Makefile - contrib/uuid/uuid_types.h glusterfs-api.pc libgfchangelog.pc - libgfdb.pc api/Makefile api/src/Makefile api/examples/Makefile @@ -290,10 +275,78 @@ AC_ARG_ENABLE([debug], [Enable debug build options.])) if test "x$enable_debug" = "xyes"; then BUILD_DEBUG=yes - CFLAGS="${CFLAGS} -g -rdynamic -O0 -DDEBUG" + GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG" else BUILD_DEBUG=no - CFLAGS="${CFLAGS} -g -rdynamic" +fi + +SANITIZER=none + +AC_ARG_ENABLE([asan], + AC_HELP_STRING([--enable-asan], + [Enable Address Sanitizer support])) +if test "x$enable_asan" = "xyes"; then + SANITIZER=asan + AC_CHECK_LIB([asan], [__asan_init], , + [AC_MSG_ERROR([--enable-asan requires libasan.so, exiting])]) + GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=address -fno-omit-frame-pointer" + GF_LDFLAGS="${GF_LDFLAGS} -lasan" +fi + +AC_ARG_ENABLE([tsan], + AC_HELP_STRING([--enable-tsan], + [Enable Thread Sanitizer support])) +if test "x$enable_tsan" = "xyes"; then + if test "x$SANITIZER" != "xnone"; then + AC_MSG_ERROR([only one sanitizer can be enabled at once]) + fi + SANITIZER=tsan + AC_CHECK_LIB([tsan], [__tsan_init], , + [AC_MSG_ERROR([--enable-tsan requires libtsan.so, exiting])]) + if test "x$ac_cv_lib_tsan___tsan_init" = xyes; then + AC_MSG_CHECKING([whether tsan API can be used]) + saved_CFLAGS=${CFLAGS} + CFLAGS="${CFLAGS} -fsanitize=thread" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + [#include <sanitizer/tsan_interface.h>]], + [[__tsan_create_fiber(0)]])], + [TSAN_API=yes], [TSAN_API=no]) + AC_MSG_RESULT([$TSAN_API]) + if test x$TSAN_API = "xyes"; then + AC_DEFINE(HAVE_TSAN_API, 1, [Define if tsan API can be used.]) + fi + CFLAGS=${saved_CFLAGS} + fi + GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=thread -fno-omit-frame-pointer" + GF_LDFLAGS="${GF_LDFLAGS} -ltsan" +fi + +AC_ARG_ENABLE([ubsan], + AC_HELP_STRING([--enable-ubsan], + [Enable Undefined Behavior Sanitizer support])) +if test "x$enable_ubsan" = "xyes"; then + if test "x$SANITIZER" != "xnone"; then + AC_MSG_ERROR([only one sanitizer can be enabled at once]) + fi + SANITIZER=ubsan + AC_CHECK_LIB([ubsan], [__ubsan_default_options], , + [AC_MSG_ERROR([--enable-ubsan requires libubsan.so, exiting])]) + GF_CFLAGS="${GF_CFLAGS} -O2 -g -fsanitize=undefined -fno-omit-frame-pointer" + GF_LDFLAGS="${GF_LDFLAGS} -lubsan" +fi + +# Initialize CFLAGS before usage +BUILD_TCMALLOC=no +AC_ARG_ENABLE([tcmalloc], + AC_HELP_STRING([--enable-tcmalloc], + [Enable linking with tcmalloc library.])) +if test "x$enable_tcmalloc" = "xyes"; then + BUILD_TCMALLOC=yes + GF_CFLAGS="${GF_CFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" + AC_CHECK_LIB([tcmalloc], [malloc], [], + [AC_MSG_ERROR([when --enable-tcmalloc is used, tcmalloc library needs to be present])]) + GF_LDFLAGS="-ltcmalloc ${GF_LDFLAGS}" fi @@ -321,14 +374,17 @@ AC_ARG_WITH([ipv6-default], AC_HELP_STRING([--with-ipv6-default], [Set IPv6 as default.]), [with_ipv6_default=${with_libtirpc}], [with_ipv6_default="no"]) -if test "x$ac_cv_file__etc_redhat_release" = "xyes"; then - if rpm -qa centos-release | grep centos; then - if rpm -q centos-release | grep "release-6"; then - with_ipv6_default="no" - fi +AC_CHECK_FILE([/etc/centos-release]) +if test "x$ac_cv_file__etc_centos_release" = "xyes"; then + if grep "release 6" /etc/centos-release; then + with_ipv6_default="no" fi fi +dnl On some distributions '-ldl' isn't automatically added to LIBS +AC_CHECK_LIB([dl], [dlopen], [LIB_DL=-ldl]) +AC_SUBST(LIB_DL) + AC_ARG_ENABLE([privport_tracking], AC_HELP_STRING([--disable-privport_tracking], [Disable internal tracking of privileged ports.])) @@ -346,19 +402,34 @@ case $host_os in fi # OSX version lesser than 9 has llvm/clang optimization issues which leads to various segfaults if test "`/usr/bin/sw_vers | grep ProductVersion: | cut -f 2 | cut -d. -f2`" -lt 9; then - CFLAGS="${CFLAGS} -g -O0 -DDEBUG" + GF_CFLAGS="${GF_CFLAGS} -g -O0 -DDEBUG" fi ;; esac # --enable-valgrind prevents calling dlclose(), this leaks memory AC_ARG_ENABLE([valgrind], - AC_HELP_STRING([--enable-valgrind], - [Enable valgrind for resource leak debugging.])) -if test "x$enable_valgrind" = "xyes"; then - AC_DEFINE(RUN_WITH_VALGRIND, 1, [define if all processes should run under valgrind]) -fi - + AC_HELP_STRING([--enable-valgrind@<:@=memcheck,drd@:>@], + [Enable valgrind for resource leak (memcheck, which is + the default) or thread synchronization (drd) debugging.])) +case x$enable_valgrind in + xmemcheck|xyes) + AC_DEFINE(RUN_WITH_MEMCHECK, 1, + [Define if all processes should run under 'valgrind --tool=memcheck'.]) + VALGRIND_TOOL=memcheck + ;; + xdrd) + AC_DEFINE(RUN_WITH_DRD, 1, + [Define if all processes should run under 'valgrind --tool=drd'.]) + VALGRIND_TOOL=drd + ;; + x|xno) + VALGRIND_TOOL=no + ;; + *) + AC_MSG_ERROR([Please specify --enable-valgrind@<:@=memcheck,drd@:>@]) + ;; +esac AC_ARG_WITH([previous-options], [AS_HELP_STRING([--with-previous-options], @@ -476,17 +547,18 @@ AC_CHECK_HEADERS([openssl/dh.h]) AC_CHECK_HEADERS([openssl/ecdh.h]) +AC_CHECK_LIB([ssl], [SSL_CTX_get0_param], [AC_DEFINE([HAVE_SSL_CTX_GET0_PARAM], [1], [define if found OpenSSL SSL_CTX_get0_param])]) + dnl Math library AC_CHECK_LIB([m], [pow], [MATH_LIB='-lm'], [MATH_LIB='']) AC_SUBST(MATH_LIB) -dnl use libuuid.so or fall-back to contrib/uuid +dnl depend on libuuid.so PKG_CHECK_MODULES([UUID], [uuid], [have_uuid=yes AC_DEFINE(HAVE_LIBUUID, 1, [have libuuid.so]) PKGCONFIG_UUID=uuid], - [have_uuid=no - UUID_CFLAGS='-I$(CONTRIBDIR)/uuid']) + [have_uuid=no]) AM_CONDITIONAL([HAVE_LIBUUID], [test x$have_uuid = xyes]) dnl older version of libuuid (from e2fsprogs) require including uuid/uuid.h @@ -500,10 +572,25 @@ 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" + have_uuid=yes +fi + +if test "x$have_uuid" != "xyes"; then + case $host_os in + *freebsd*) + AC_MSG_ERROR([e2fsprogs-libuuid is required to build glusterfs]) + ;; + linux*) + AC_MSG_ERROR([libuuid is required to build glusterfs]) + ;; + *) + AC_MSG_ERROR([a Linux compatible libuuid is required to build glusterfs]) + ;; + esac fi dnl libglusterfs needs uuid.h, practically everything depends on it -GF_CPPFLAGS="${GF_CPPFLAGS} ${UUID_CFLAGS}" +GF_CFLAGS="${GF_CFLAGS} ${UUID_CFLAGS}" dnl PKGCONFIG_UUID is used for the dependency in *.pc.in files AC_SUBST(PKGCONFIG_UUID) @@ -582,53 +669,54 @@ fi dnl Check Python Availability have_python=no -case $host_os in - freebsd*) - PYTHON=/usr/local/bin/python2 - ;; - *) - PYTHON=/usr/bin/python2 - ;; -esac +dnl if the user has not specified a python, pick one +if test -z "${PYTHON}"; then + case $host_os in + freebsd*) + if test -x /usr/local/bin/python3; then + PYTHON=/usr/local/bin/python3 + else + PYTHON=/usr/local/bin/python2 + fi + ;; + *) + if test -x /usr/bin/python3; then + PYTHON=/usr/bin/python3 + else + PYTHON=/usr/bin/python2 + fi + ;; + esac +fi AM_PATH_PYTHON([2.6],,[:]) -if test "x${PYTHON}" != "x:"; then +if test -n "${PYTHON}"; then have_python=yes fi +AM_CONDITIONAL(HAVE_PYTHON, test "x$have_python" = "xyes") -echo "python = ${PYTHON}" - -dnl Check if version matches that we require -PYTHONDEV_CPPFLAGS= -PYTHONDEV_LDFLAGS= -BUILD_PYTHON_SITE_PACKAGES= -BUILD_PYTHON_INC= -BUILD_PYTHON_LIB= -have_Python_h="no" - -dnl Use pkg-config to get runtime search patch missing from ${PYTHON}-config +dnl Use pkg-config to get runtime search path missing from ${PYTHON}-config dnl Just do "true" on failure so that configure does not bail out -PKG_CHECK_MODULES([PYTHON], "python-${PYTHON_VERSION}",,true) - -PYTHONDEV_CPPFLAGS="`${PYTHON}-config --cflags`" -dnl Edit out the flags that are not required or are conflicting -PYTHONDEV_CPPFLAGS=`echo ${PYTHONDEV_CPPFLAGS} | sed -e 's/-Wp,-D_FORTIFY_SOURCE=[[0-9]]//g'` +dnl Note: python 2.6's devel pkg (e.g. in CentOS/RHEL 6) does not have +dnl pkg-config files, so this work-around instead +if test "x${PYTHON_VERSION}" = "x2.6"; then + PYTHON_CFLAGS=$(python-config --includes) + PYTHON_LIBS=$(python-config --libs) +else + PKG_CHECK_MODULES([PYTHON], "python-${PYTHON_VERSION}",,true) +fi -dnl Find python libs at user configured libdir and also "lib" under prefix -PYTHONDEV_LDFLAGS="${PYTHON_LIBS} -L`${PYTHON}-config --prefix`/lib -L`${PYTHON}-config --prefix`/$libdir `${PYTHON}-config --ldflags`" +PYTHON_CFLAGS=$(echo ${PYTHON_CFLAGS} | sed -e 's|-I|-isystem |') BUILD_PYTHON_SITE_PACKAGES=${pythondir} -BUILD_PYTHON_INC=`${PYTHON} -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_inc())" 2>/dev/null` -BUILD_PYTHON_LIB=python${PYTHON_VERSION} - -dnl Now check for python header using the include path obtained above -AC_CHECK_HEADERS([${BUILD_PYTHON_INC}/Python.h],[have_Python_h=yes],[]) - -AC_SUBST(PYTHONDEV_CPPFLAGS) -AC_SUBST(PYTHONDEV_LDFLAGS) AC_SUBST(BUILD_PYTHON_SITE_PACKAGES) -AC_SUBST(BUILD_PYTHON_INC) -AC_SUBST(BUILD_PYTHON_LIB) +# Eval two times to expand fully. First eval replaces $exec_prefix into $prefix +# Second eval will expand $prefix +build_python_site_packages_temp="${pythondir}" +eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\" +eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\" +BUILD_PYTHON_SITE_PACKAGES_EXPANDED=${build_python_site_packages_temp} +AC_SUBST(BUILD_PYTHON_SITE_PACKAGES_EXPANDED) # FUSE section AC_ARG_ENABLE([fuse-client], @@ -641,45 +729,17 @@ if test "x$enable_fuse_client" != "xno"; then BUILD_FUSE_CLIENT="yes" fi -AC_ARG_ENABLE([bd-xlator], - AC_HELP_STRING([--enable-bd-xlator], [Build BD xlator])) - -if test "x${with_server}" = "xyes" -a "x$enable_bd_xlator" != "xno"; then - AC_CHECK_LIB([lvm2app], - [lvm_init,lvm_lv_from_name], - [HAVE_BD_LIB="yes"], - [HAVE_BD_LIB="no"]) - -if test "x$HAVE_BD_LIB" = "xyes"; then - # lvm_lv_from_name() has been made public with lvm2-2.02.79 - AC_CHECK_DECLS( - [lvm_lv_from_name], - [NEED_LVM_LV_FROM_NAME_DECL="no"], - [NEED_LVM_LV_FROM_NAME_DECL="yes"], - [[#include <lvm2app.h>]]) - fi -fi +AC_SUBST(FUSE_CLIENT_SUBDIR) -if test "x$enable_bd_xlator" = "xyes" -a "x$HAVE_BD_LIB" = "xno"; then - echo "BD xlator requested but required lvm2 development library not found." - exit 1 -fi +AC_ARG_ENABLE([fuse-notifications], + AS_HELP_STRING([--disable-fuse-notifications], [Disable FUSE notifications])) -BUILD_BD_XLATOR=no -if test "x${enable-bd-xlator}" != "xno" -a "x${HAVE_BD_LIB}" = "xyes"; then - BUILD_BD_XLATOR=yes - AC_DEFINE(HAVE_BD_XLATOR, 1, [define if lvm2app library found and bd xlator - enabled]) - if test "x$NEED_LVM_LV_FROM_NAME_DECL" = "xyes"; then - AC_DEFINE(NEED_LVM_LV_FROM_NAME_DECL, 1, [defined if lvm_lv_from_name() - was not found in the lvm2app.h header, but can be linked]) - fi -fi +AS_IF([test "x$enable_fuse_notifications" != "xno"], [ + AC_DEFINE([HAVE_FUSE_NOTIFICATIONS], [1], [Use FUSE notifications]) +]) -AM_CONDITIONAL([ENABLE_BD_XLATOR], [test x$BUILD_BD_XLATOR = xyes]) +# end FUSE section -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], TLS_method, [HAVE_OPENSSL_1_1="yes"], [HAVE_OPENSSL_1_1="no"]) if test "x$HAVE_OPENSSL_1_1" = "xyes"; then @@ -688,28 +748,6 @@ else AC_CHECK_LIB([ssl], TLSv1_2_method, [AC_DEFINE([HAVE_TLSV1_2_METHOD], [1], [Using OpenSSL-1.0 TLSv1_2_method])]) fi -# start encryption/crypt section - -AC_CHECK_HEADERS([openssl/cmac.h], [have_cmac_h=yes], [have_cmac_h=no]) - -AC_ARG_ENABLE([crypt-xlator], - AC_HELP_STRING([--enable-crypt-xlator], [Build crypt encryption xlator])) - -if test "x$enable_crypt_xlator" = "xyes" -a "x$have_cmac_h" = "xno"; then - AC_MSG_ERROR([Encryption xlator requires OpenSSL with cmac.h]) -fi - -BUILD_CRYPT_XLATOR=no -if test "x$enable_crypt_xlator" != "xno" -a "x$have_cmac_h" = "xyes"; then - BUILD_CRYPT_XLATOR=yes - AC_DEFINE(HAVE_CRYPT_XLATOR, 1, [enable building crypt encryption xlator]) -fi - -AM_CONDITIONAL([ENABLE_CRYPT_XLATOR], [test x$BUILD_CRYPT_XLATOR = xyes]) - -AC_SUBST(FUSE_CLIENT_SUBDIR) -# end FUSE section - # FUSERMOUNT section AC_ARG_ENABLE([fusermount], @@ -740,53 +778,6 @@ if test "x$enable_epoll" != "xno"; then fi # end EPOLL section - -# IBVERBS section -AC_ARG_ENABLE([ibverbs], - AC_HELP_STRING([--disable-ibverbs], - [Do not build the ibverbs transport])) - -if test "x$enable_ibverbs" != "xno"; then - AC_CHECK_LIB([ibverbs], - [ibv_get_device_list], - [HAVE_LIBIBVERBS="yes"], - [HAVE_LIBIBVERBS="no"]) - AC_CHECK_LIB([rdmacm], [rdma_create_id], [HAVE_RDMACM="yes"], [HAVE_RDMACM="no"]) - if test "x$HAVE_RDMACM" = "xyes" ; then - AC_CHECK_DECLS( - [RDMA_OPTION_ID_REUSEADDR], - [], - [AC_ERROR([Need at least version 1.0.15 of librdmacm])], - [[#include <rdma/rdma_cma.h>]]) - fi -fi - -if test "x$enable_ibverbs" = "xyes"; then - if test "x$HAVE_LIBIBVERBS" = "xno"; then - echo "ibverbs-transport requested, but libibverbs is not present." - exit 1 - fi - - if test "x$HAVE_RDMACM" = "xno"; then - echo "ibverbs-transport requested, but librdmacm is not present." - exit 1 - fi -fi - -BUILD_RDMA=no -BUILD_IBVERBS=no -if test "x$enable_ibverbs" != "xno" -a "x$HAVE_LIBIBVERBS" = "xyes" -a "x$HAVE_RDMACM" = "xyes"; then - IBVERBS_SUBDIR=ib-verbs - BUILD_IBVERBS=yes - RDMA_SUBDIR=rdma - BUILD_RDMA=yes -fi - -AC_SUBST(IBVERBS_SUBDIR) -AC_SUBST(RDMA_SUBDIR) -# end IBVERBS section - - # SYNCDAEMON section AC_ARG_ENABLE([georeplication], AC_HELP_STRING([--disable-georeplication], @@ -794,6 +785,9 @@ AC_ARG_ENABLE([georeplication], BUILD_SYNCDAEMON=no case $host_os in + freebsd*) +#do nothing + ;; linux*) #do nothing ;; @@ -833,6 +827,17 @@ fi AC_SUBST(GEOREP_EXTRAS_SUBDIR) AM_CONDITIONAL(USE_GEOREP, test "x$enable_georeplication" != "xno") +# METADISP section +AC_ARG_ENABLE([metadisp], + AC_HELP_STRING([--enable-metadisp], + [Enable the metadata dispersal xlator])) +BUILD_METADISP=no +if test "x${enable_metadisp}" = "xyes"; then + BUILD_METADISP=yes +fi +AM_CONDITIONAL([BUILD_METADISP], [test "x$BUILD_METADISP" = "xyes"]) +# end METADISP section + # Events section AC_ARG_ENABLE([events], AC_HELP_STRING([--disable-events], @@ -896,41 +901,13 @@ AM_CONDITIONAL([USE_FIREWALLD],test ["x${BUILD_FIREWALLD}" = "xyes"]) #endof firewald section -# Data tiering requires sqlite -AC_ARG_ENABLE([tiering], - AC_HELP_STRING([--disable-tiering], - [Disable data classification/tiering]), - [BUILD_GFDB="${enableval}"], [BUILD_GFDB="yes"]) - -case $host_os in - darwin*) - SQLITE_LIBS="-lsqlite3" - AC_CHECK_HEADERS([sqlite3.h], AC_DEFINE(USE_GFDB, 1)) - ;; - *) - if test "x${BUILD_GFDB}" = "xyes"; then - PKG_CHECK_MODULES([SQLITE], [sqlite3], - AC_DEFINE(USE_GFDB, 1), - AC_MSG_ERROR([pass --disable-tiering to build without sqlite])) - else - AC_DEFINE(USE_GFDB, 0, [no sqlite, gfdb is disabled]) - fi - ;; -esac - -AC_SUBST(SQLITE_CFLAGS) -AC_SUBST(SQLITE_LIBS) -AM_CONDITIONAL(BUILD_GFDB, test "x${with_server}" = "xyes" -a "x${BUILD_GFDB}" = "xyes") -AM_CONDITIONAL(USE_GFDB, test "x${with_server}" = "xyes" -a "x${BUILD_GFDB}" = "xyes") - # xml-output AC_ARG_ENABLE([xml-output], AC_HELP_STRING([--disable-xml-output], [Disable the xml output])) BUILD_XML_OUTPUT="yes" if test "x$enable_xml_output" != "xno"; then - #check if libxml is present if so enable HAVE_LIB_XML - m4_ifdef([AM_PATH_XML2],[AM_PATH_XML2([2.6.19])], [no_xml=yes]) + PKG_CHECK_MODULES([XML], [libxml-2.0], [], [no_xml="yes"]) if test "x${no_xml}" = "x"; then AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.]) else @@ -950,6 +927,34 @@ else fi # end of xml-output +dnl cloudsync section +BUILD_CLOUDSYNC="no" +AC_CHECK_LIB([curl], [curl_easy_setopt], [LIBCURL="-lcurl"]) +if test -n "$LIBCURL";then + HAVE_LIBCURL="yes" +fi +AC_CHECK_HEADERS([openssl/hmac.h openssl/evp.h openssl/bio.h openssl/buffer.h], [HAVE_OPENSSL="yes"]) +if test "x$HAVE_LIBCURL" = "xyes" -a "x$HAVE_OPENSSL" = "xyes";then + HAVE_AMAZONS3="yes" +fi +AM_CONDITIONAL([BUILD_AMAZONS3_PLUGIN], [test "x$HAVE_AMAZONS3" = "xyes"]) +if test "x$HAVE_AMAZONS3" = "xyes";then + BUILD_CLOUDSYNC="yes" +fi +BUILD_CVLT_PLUGIN="no" +case $host_os in +#enable cvlt plugin only for linux platforms + linux*) + BUILD_CVLT_PLUGIN="yes" + BUILD_CLOUDSYNC="yes" + ;; + *) + ;; +esac +AM_CONDITIONAL([BUILD_CVLT_PLUGIN], [test "x$BUILD_CVLT_PLUGIN" = "xyes"]) +AM_CONDITIONAL([BUILD_CLOUDSYNC], [test "x$BUILD_CLOUDSYNC" = "xyes"]) +dnl end cloudsync section + dnl SELinux feature enablement case $host_os in linux*) @@ -971,6 +976,25 @@ if test "x${have_backtrace}" = "xyes"; then fi AC_SUBST(HAVE_BACKTRACE) +dnl Old (before C11) compiler can compile (but not link) this: +dnl +dnl int main () { +dnl _Static_assert(1, "True"); +dnl return 0; +dnl } +dnl +dnl assuming that _Static_assert is an implicitly declared function. So +dnl we're trying to link just to make sure that this is not the case. + +AC_MSG_CHECKING([whether $CC supports C11 _Static_assert]) +AC_TRY_LINK([], [_Static_assert(1, "True");], + [STATIC_ASSERT=yes], [STATIC_ASSERT=no]) + +AC_MSG_RESULT([$STATIC_ASSERT]) +if test x$STATIC_ASSERT = "xyes"; then + AC_DEFINE(HAVE_STATIC_ASSERT, 1, [Define if C11 _Static_assert is supported.]) +fi + if test "x${have_backtrace}" != "xyes"; then AC_TRY_COMPILE([#include <math.h>], [double x=0.0; x=ceil(0.0);], [], @@ -978,11 +1002,11 @@ AC_TRY_COMPILE([#include <math.h>], [double x=0.0; x=ceil(0.0);], fi dnl glusterfs prints memory usage to stderr by sending it SIGUSR1 -AC_CHECK_FUNC([malloc_stats], [have_malloc_stats=yes]) -if test "x${have_malloc_stats}" = "xyes"; then - AC_DEFINE(HAVE_MALLOC_STATS, 1, [define if found malloc_stats]) +AC_CHECK_FUNC([mallinfo], [have_mallinfo=yes]) +if test "x${have_mallinfo}" = "xyes"; then + AC_DEFINE(HAVE_MALLINFO, 1, [define if found mallinfo]) fi -AC_SUBST(HAVE_MALLOC_STATS) +AC_SUBST(HAVE_MALLINFO) dnl Linux, Solaris, Cygwin AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec]) @@ -990,7 +1014,7 @@ dnl FreeBSD, NetBSD AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec]) case $host_os in *netbsd*) - CFLAGS="${CFLAGS} -D_INCOMPLETE_XOPEN_C063 -DCONFIG_MACHINE_BSWAP_H" + GF_CFLAGS="${GF_CFLAGS} -D_INCOMPLETE_XOPEN_C063 -DCONFIG_MACHINE_BSWAP_H" ;; esac AC_CHECK_FUNC([linkat], [have_linkat=yes]) @@ -1003,24 +1027,22 @@ dnl check for Monotonic clock AC_CHECK_LIB([rt], [clock_gettime], , AC_MSG_WARN([System doesn't have monotonic clock using contrib])) -dnl Check for argp +dnl check for argp, FreeBSD has the header in /usr/local/include +case $host_os in + *freebsd*) + CFLAGS="${CFLAGS} -isystem /usr/local/include" + ARGP_LDADD=-largp + ;; + *netbsd*) + ARGP_LDADD=-largp + ;; +esac +dnl argp-standalone does not provide a pkg-config file AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp])) - -BUILD_ARGP_STANDALONE=no -if test "x${ac_cv_header_argp_h}" = "xno"; then - AC_CONFIG_SUBDIRS(contrib/argp-standalone) - BUILD_ARGP_STANDALONE=yes - ARGP_STANDALONE_CPPFLAGS='-I${top_srcdir}/contrib/argp-standalone' - ARGP_STANDALONE_LDADD='${top_builddir}/contrib/argp-standalone/libargp.a' - ARGP_STANDALONE_DIR='${top_builddir}/contrib/argp-standalone' +if test "x$ac_cv_header_argp_h" != "xyes"; then + AC_MSG_ERROR([argp.h not found, install libargp or argp-standalone]) fi - -dnl libglusterfs needs argp.h, practically everything depends on it -GF_CPPFLAGS="${GF_CPPFLAGS} ${ARGP_STANDALONE_CPPFLAGS}" - -AC_SUBST(ARGP_STANDALONE_CPPFLAGS) -AC_SUBST(ARGP_STANDALONE_LDADD) -AC_SUBST(ARGP_STANDALONE_DIR) +AC_SUBST(ARGP_LDADD) dnl Check for atomic operation support AC_MSG_CHECKING([for gcc __atomic builtins]) @@ -1064,6 +1086,38 @@ if test "x${have_posix_fallocate}" = "xyes"; then AC_DEFINE(HAVE_POSIX_FALLOCATE, 1, [define if posix_fallocate exists]) fi +# On fedora-29, copy_file_range syscall and the libc API both are present. +# Whereas, on some machines such as centos-7, RHEL-7, the API is not there. +# Only the system call is present. So, this change is to determine whether +# the API is present or not. If not, then check whether the system call is +# present or not. Accordingly sys_copy_file_range function will first call +# the API if it is there. Otherwise it will call syscall(SYS_copy_file_range). +AC_CHECK_FUNC([copy_file_range], [have_copy_file_range=yes]) +if test "x${have_copy_file_range}" = "xyes"; then + AC_DEFINE(HAVE_COPY_FILE_RANGE, 1, [define if copy_file_range exists]) +else + OLD_CFLAGS=${CFLAGS} + CFLAGS="-D_GNU_SOURCE" + AC_CHECK_DECL([SYS_copy_file_range], , , [#include <sys/syscall.h>]) + if test "x${ac_cv_have_decl_SYS_copy_file_range}" = "xyes"; then + AC_DEFINE(HAVE_COPY_FILE_RANGE_SYS, 1, [define if SYS_copy_file_range is available]) + fi + CFLAGS=${OLD_CFLAGS} +fi + +AC_CHECK_FUNC([syncfs], [have_syncfs=yes]) +if test "x${have_syncfs}" = "xyes"; then + AC_DEFINE(HAVE_SYNCFS, 1, [define if syncfs exists]) +else + OLD_CFLAGS=${CFLAGS} + CFLAGS="-D_GNU_SOURCE" + AC_CHECK_DECL([SYS_syncfs], , , [#include <sys/syscall.h>]) + if test "x${ac_cv_have_decl_SYS_syncfs}" = "xyes"; then + AC_DEFINE(HAVE_SYNCFS_SYS, 1, [define if SYS_syncfs is available]) + fi + CFLAGS=${OLD_CFLAGS} +fi + BUILD_NANOSECOND_TIMESTAMPS=no AC_CHECK_FUNC([utimensat], [have_utimensat=yes]) if test "x${have_utimensat}" = "xyes"; then @@ -1079,6 +1133,16 @@ if test "x${ac_cv_have_decl_SEEK_HOLE}" = "xyes"; then fi CFLAGS=${OLD_CFLAGS} +AC_CHECK_FUNC([accept4], [have_accept4=yes]) +if test "x${have_accept4}" = "xyes"; then + AC_DEFINE(HAVE_ACCEPT4, 1, [define if accept4 exists]) +fi + +AC_CHECK_FUNC([paccept], [have_paccept=yes]) +if test "x${have_paccept}" = "xyes"; then +AC_DEFINE(HAVE_PACCEPT, 1, [define if paccept exists]) +fi + # Check the distribution where you are compiling glusterfs on GF_DISTRIBUTION= @@ -1099,7 +1163,7 @@ fi AC_SUBST(GF_DISTRIBUTION) GF_HOST_OS="" -GF_LDFLAGS="-rdynamic" +GF_LDFLAGS="${GF_LDFLAGS} -rdynamic" dnl see --with-libtirpc option check above, libtirpc(-devel) is required for dnl ipv6-default @@ -1134,28 +1198,21 @@ 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 - CFLAGS="$saved_CFLAGS" -else - CFLAGS="$saved_CFLAGS $CFLAGS" - GF_CFLAGS="$GF_CFLAGS $CFLAGS" +if test "x$cc_werror_format_security" = "xyes"; then + GF_CFLAGS="$GF_CFLAGS ${CFLAGS}" fi +CFLAGS="$saved_CFLAGS" dnl check for gcc -Werror=implicit-function-declaration saved_CFLAGS=$CFLAGS -saved_GF_CFLAGS=$GF_CFLAGS CFLAGS="-Werror=implicit-function-declaration" -GF_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 - CFLAGS="$saved_CFLAGS" - GF_CFLAGS="$saved_GF_CFLAGS" -else - CFLAGS="$saved_CFLAGS $CFLAGS" - GF_CFLAGS="$saved_GF_CFLAGS $GF_CFLAGS" +if test "x$cc_werror_implicit" = "xyes"; then + GF_CFLAGS="${GF_CFLAGS} ${CFLAGS}" fi +CFLAGS="$saved_CFLAGS" dnl clang is mostly GCC-compatible, but its version is much lower, dnl so we have to check for it. @@ -1199,7 +1256,6 @@ if test "x$exec_prefix" = xNONE; then exec_prefix="$(eval echo $prefix)" fi GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs" -GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd" prefix=$old_prefix exec_prefix=$old_exec_prefix @@ -1211,6 +1267,8 @@ fi localstatedir="$(eval echo ${localstatedir})" LOCALSTATEDIR=$localstatedir +GLUSTERFSD_MISCDIR="$(eval echo ${localstatedir})/lib/misc/glusterfsd" + old_prefix=$prefix if test "x$prefix" = xNONE; then prefix=$ac_default_prefix @@ -1219,6 +1277,7 @@ GLUSTERD_VOLFILE="$(eval echo ${sysconfdir})/glusterfs/glusterd.vol" prefix=$old_prefix +GFAPI_EXTRA_LDFLAGS='-Wl,--version-script=$(top_srcdir)/api/src/gfapi.map' case $host_os in linux*) GF_HOST_OS="GF_LINUX_HOST_OS" @@ -1238,9 +1297,9 @@ case $host_os in GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\"" - GF_LDADD="${ARGP_STANDALONE_LDADD}" + GF_LDADD="${ARGP_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then - GF_LDFLAGS="-lexecinfo" + GF_LDFLAGS="${GF_LDFLAGS} -lexecinfo" fi GF_FUSE_LDADD="-lperfuse" BUILD_FUSE_CLIENT=yes @@ -1251,17 +1310,13 @@ case $host_os in ;; *freebsd*) GF_HOST_OS="GF_BSD_HOST_OS" - GF_CFLAGS="${GF_CFLAGS} ${ARGP_STANDALONE_CPPFLAGS} -O0" - GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" - GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" - GF_CFLAGS="${GF_CFLAGS} -D_LIBGEN_H_" GF_CFLAGS="${GF_CFLAGS} -DO_DSYNC=0" GF_CFLAGS="${GF_CFLAGS} -Dxdr_quad_t=xdr_longlong_t" GF_CFLAGS="${GF_CFLAGS} -Dxdr_u_quad_t=xdr_u_longlong_t" GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(sbindir)\\\"" - GF_LDADD="${ARGP_STANDALONE_LDADD}" + GF_LDADD="${ARGP_LDADD}" if test "x$ac_cv_header_execinfo_h" = "xyes"; then - GF_LDFLAGS="-lexecinfo" + GF_LDFLAGS="${GF_LDFLAGS} -lexecinfo" fi BUILD_FUSE_CLIENT=yes BUILD_FUSERMOUNT=no @@ -1271,27 +1326,18 @@ case $host_os in darwin*) GF_HOST_OS="GF_DARWIN_HOST_OS" LIBTOOL=glibtool - GF_CFLAGS="${GF_CFLAGS} ${ARGP_STANDALONE_CPPFLAGS} " GF_CFLAGS="${GF_CFLAGS} -D_REENTRANT -D_XOPEN_SOURCE " GF_CFLAGS="${GF_CFLAGS} -D_DARWIN_USE_64_BIT_INODE " GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME" GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME" - GF_LDADD="${ARGP_STANDALONE_LDADD}" - GF_LDFLAGS="" + GF_LDADD="${ARGP_LDADD}" + GF_LDFLAGS="${GF_LDFLAGS}" GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse" BUILD_FUSERMOUNT="no" FUSERMOUNT_SUBDIR="" GLUSTERD_WORKDIR="${LOCALSTATEDIR}/db/glusterd" - ;; -esac - -case $host_os in - darwin*) GFAPI_EXTRA_LDFLAGS='-Wl,-alias_list,$(top_srcdir)/api/src/gfapi.aliases' ;; - *) - GFAPI_EXTRA_LDFLAGS='-Wl,--version-script=$(top_srcdir)/api/src/gfapi.map' - ;; esac # Default value for sbindir @@ -1309,19 +1355,11 @@ sysconfdirtemp="${sysconfdir}" eval sysconfdirtemp=\"${sysconfdirtemp}\" SYSCONF_DIR=${sysconfdirtemp} -# Eval two times to expand fully. First eval replaces $exec_prefix into $prefix -# Second eval will expand $prefix -build_python_site_packages_temp="${BUILD_PYTHON_SITE_PACKAGES}" -eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\" -eval build_python_site_packages_temp=\"${build_python_site_packages_temp}\" -BUILD_PYTHON_SITE_PACKAGES_EXPANDED=${build_python_site_packages_temp} - prefix=$prefix_temp exec_prefix=$exec_prefix_temp AC_SUBST(SBIN_DIR) AC_SUBST(SYSCONF_DIR) -AC_SUBST(BUILD_PYTHON_SITE_PACKAGES_EXPANDED) # lazy umount emulation UMOUNTD_SUBDIR="" @@ -1365,7 +1403,7 @@ AC_CHECK_LIB([readline -lcurses],[readline],[RLLIBS="-lreadline -lcurses"]) AC_CHECK_LIB([readline -ltermcap],[readline],[RLLIBS="-lreadline -ltermcap"]) AC_CHECK_LIB([readline -lncurses],[readline],[RLLIBS="-lreadline -lncurses"]) -if test "x$RLLIBS" != "x"; then +if test -n "$RLLIBS"; then if test "x$RL_UNDO" = "xyes"; then AC_DEFINE(HAVE_READLINE, 1, [readline enabled CLI]) BUILD_READLINE=yes @@ -1378,58 +1416,25 @@ fi BUILD_LIBAIO=no AC_CHECK_LIB([aio],[io_setup],[LIBAIO="-laio"]) -if test "x$LIBAIO" != "x"; then +if test -n "$LIBAIO"; then AC_DEFINE(HAVE_LIBAIO, 1, [libaio based POSIX enabled]) BUILD_LIBAIO=yes fi -dnl glupy section -BUILD_GLUPY=no - -AC_ARG_ENABLE([glupy], AS_HELP_STRING([--enable-glupy], [build glupy])) -if test "x$enable_glupy" != "xno"; then enable_glupy=yes; fi - -if test "x$enable_glupy" = "xyes"; then - GLUPY_SUBDIR=glupy - GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile - GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile - - if test "x${have_python}" = "xyes" -a "x${have_Python_h}" = "xyes"; then - case $host_os in - darwin*) - BUILD_GLUPY=no - ;; - *) - BUILD_GLUPY=yes - ;; - esac - else - AC_MSG_WARN([ - --------------------------------------------------------------------------------- - cannot build glupy. python 2.x and python-devel/python-dev package are required. - ---------------------------------------------------------------------------------]) - fi - - if test "x$BUILD_GLUPY" = "xyes"; then - - echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB" - - AC_SUBST(GLUPY_SUBDIR) - AC_SUBST(GLUPY_SUBDIR_MAKEFILE) - AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE) - fi -fi -dnl end glupy section - dnl gnfs section BUILD_GNFS="no" +RPCBIND_SERVICE="" AC_ARG_ENABLE([gnfs], AC_HELP_STRING([--enable-gnfs], [Enable legacy gnfs server xlator.])) if test "x${with_server}" = "xyes" -a "x$enable_gnfs" = "xyes"; then BUILD_GNFS="yes" + GF_CFLAGS="$GF_CFLAGS -DBUILD_GNFS" + RPCBIND_SERVICE="rpcbind.service" fi AM_CONDITIONAL([BUILD_GNFS], [test x$BUILD_GNFS = xyes]) +AC_SUBST(BUILD_GNFS) +AC_SUBST(RPCBIND_SERVICE) dnl end gnfs section dnl Check for userspace-rcu @@ -1439,10 +1444,12 @@ PKG_CHECK_MODULES([URCU], [liburcu-bp], [], AC_MSG_ERROR([liburcu-bp not found]))]) PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.8], [], [PKG_CHECK_MODULES([URCU_CDS], [liburcu-cds >= 0.7], - [AC_DEFINE(URCU_OLD, 1, [Define if liburcu 0.6 or 0.7 is found])], + [AC_DEFINE(URCU_OLD, 1, [Define if liburcu 0.6 or 0.7 is found]) + USE_CONTRIB_URCU='yes'], [AC_CHECK_HEADERS([urcu/cds.h], [AC_DEFINE(URCU_OLD, 1, [Define if liburcu 0.6 or 0.7 is found]) - URCU_CDS_LIBS='-lurcu-cds'], + URCU_CDS_LIBS='-lurcu-cds' + USE_CONTRIB_URCU='yes'], [AC_MSG_ERROR([liburcu-cds not found])])])]) BUILD_UNITTEST="no" @@ -1569,7 +1576,23 @@ AC_SUBST(USE_EC_DYNAMIC_NEON) dnl libglusterfs.so uses math functions GF_LDADD="${GF_LDADD} ${MATH_LIB}" -GF_XLATOR_DEFAULT_LDFLAGS='-avoid-version -export-symbols $(top_srcdir)/xlators/xlator.sym' +case $host_os in + dnl Can't use libtool's portable "-no-undefined" as it seems to be ignored on Linux + linux*) + GF_NO_UNDEFINED='-Wl,--no-undefined' + ;; + darwin*) + GF_NO_UNDEFINED='-Wl,-undefined' + ;; + *) + dnl There's an issue on FreeBSD with reference to __progname used in some parts of code + GF_NO_UNDEFINED='' + ;; +esac +dnl GF_XLATOR_DEFAULT_LDFLAGS is for most xlators that expose a common set of symbols +GF_XLATOR_DEFAULT_LDFLAGS='-avoid-version -export-symbols $(top_srcdir)/xlators/xlator.sym $(UUID_LIBS) $(GF_NO_UNDEFINED) $(TIRPC_LIBS)' +dnl GF_XLATOR_LDFLAGS is for xlators that expose extra symbols, e.g. dht +GF_XLATOR_LDFLAGS='-avoid-version $(UUID_LIBS) $(GF_NO_UNDEFINED) $(TIRPC_LIBS)' AC_SUBST(GF_HOST_OS) AC_SUBST(GF_CFLAGS) @@ -1581,19 +1604,34 @@ AC_SUBST(RLLIBS) AC_SUBST(LIBAIO) AC_SUBST(AM_MAKEFLAGS) AC_SUBST(AM_LIBTOOLFLAGS) +AC_SUBST(GF_NO_UNDEFINED) AC_SUBST(GF_XLATOR_DEFAULT_LDFLAGS) +AC_SUBST(GF_XLATOR_LDFLAGS) +AC_SUBST(GF_XLATOR_MGNT_LIBADD) + +case $host_os in + *freebsd*) + GF_XLATOR_MGNT_LIBADD="-lutil -lprocstat" + ;; +esac CONTRIBDIR='$(top_srcdir)/contrib' AC_SUBST(CONTRIBDIR) GF_CPPDEFINES='-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D$(GF_HOST_OS)' GF_CPPINCLUDES='-include $(top_builddir)/config.h -include $(top_builddir)/site.h -I$(top_srcdir)/libglusterfs/src -I$(top_builddir)/libglusterfs/src' +if test "x${USE_CONTRIB_URCU}" = "xyes"; then + GF_CPPINCLUDES="${GF_CPPINCLUDES} -I\$(CONTRIBDIR)/userspace-rcu" +fi GF_CPPFLAGS="$GF_CPPFLAGS $GF_CPPDEFINES $GF_CPPINCLUDES" AC_SUBST([GF_CPPFLAGS]) AM_CONDITIONAL([GF_LINUX_HOST_OS], test "${GF_HOST_OS}" = "GF_LINUX_HOST_OS") AM_CONDITIONAL([GF_DARWIN_HOST_OS], test "${GF_HOST_OS}" = "GF_DARWIN_HOST_OS") AM_CONDITIONAL([GF_BSD_HOST_OS], test "${GF_HOST_OS}" = "GF_BSD_HOST_OS") +if test "${GF_HOST_OS}" = "GF_BSD_HOST_OS"; then + AC_DEFINE(GF_BSD_HOST_OS, 1, [This is a BSD compatible OS.]) +fi AC_SUBST(GLUSTERD_WORKDIR) AM_CONDITIONAL([GF_INSTALL_GLUSTERD_WORKDIR], test ! -d ${GLUSTERD_WORKDIR} && test -d ${sysconfdir}/glusterd ) @@ -1615,8 +1653,6 @@ GFAPI_VERSION="7."${PACKAGE_VERSION} LIBGFCHANGELOG_VERSION="0.0.1" AC_SUBST(GFAPI_VERSION) AC_SUBST(LIBGFCHANGELOG_VERSION) -LIBGFDB_VERSION="0.0.1" -AC_SUBST(LIBGFDB_VERSION) dnl libtool versioning LIBGFXDR_LT_VERSION="0:1:0" @@ -1643,23 +1679,19 @@ echo echo "GlusterFS configure summary" echo "===========================" echo "FUSE client : $BUILD_FUSE_CLIENT" -echo "Infiniband verbs : $BUILD_IBVERBS" echo "epoll IO multiplex : $BUILD_EPOLL" -echo "argp-standalone : $BUILD_ARGP_STANDALONE" echo "fusermount : $BUILD_FUSERMOUNT" echo "readline : $BUILD_READLINE" echo "georeplication : $BUILD_SYNCDAEMON" echo "Linux-AIO : $BUILD_LIBAIO" echo "Enable Debug : $BUILD_DEBUG" -echo "Block Device xlator : $BUILD_BD_XLATOR" -echo "glupy : $BUILD_GLUPY" +echo "Run with Valgrind : $VALGRIND_TOOL" +echo "Sanitizer enabled : $SANITIZER" echo "Use syslog : $USE_SYSLOG" echo "XML output : $BUILD_XML_OUTPUT" -echo "Encryption xlator : $BUILD_CRYPT_XLATOR" echo "Unit Tests : $BUILD_UNITTEST" echo "Track priv ports : $TRACK_PRIVPORTS" echo "POSIX ACLs : $BUILD_POSIX_ACLS" -echo "Data Classification : $BUILD_GFDB" echo "SELinux features : $USE_SELINUX" echo "firewalld-config : $BUILD_FIREWALLD" echo "Events : $BUILD_EVENTS" @@ -1671,4 +1703,15 @@ echo "Legacy gNFS server : $BUILD_GNFS" echo "IPV6 default : $with_ipv6_default" echo "Use TIRPC : $with_libtirpc" echo "With Python : ${PYTHON_VERSION}" +echo "Cloudsync : $BUILD_CLOUDSYNC" +echo "Metadata dispersal : $BUILD_METADISP" +echo "Link with TCMALLOC : $BUILD_TCMALLOC" echo + +# dnl Note: ${X^^} capitalization assumes bash >= 4.x +if test "x$SANITIZER" != "xnone"; then + echo "Note: since glusterfs processes are daemon processes, use" + echo "'export ${SANITIZER^^}_OPTIONS=log_path=/path/to/xxx.log' to collect" + echo "sanitizer output. Further details and more options can be" + echo "found at https://github.com/google/sanitizers." +fi |
