]> sourceware.org Git - lvm2.git/blobdiff - configure.in
spacing
[lvm2.git] / configure.in
index 30dd76530bfab377f84142cf4ab87b954ecd010f..32a4886cdac04f939ac6862156fd168c583d757b 100644 (file)
@@ -1,6 +1,6 @@
 ###############################################################################
 ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
-## Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
 ##
 ## This copyrighted material is made available to anyone wishing to use,
 ## modify, copy, or redistribute it subject to the terms and conditions
@@ -31,10 +31,11 @@ case "$host_os" in
                CFLAGS="$CFLAGS"
                COPTIMISE_FLAG="-O2"
                CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+               ELDFLAGS="-Wl,--export-dynamic"
+               # FIXME Generate list and use --dynamic-list=.dlopen.sym
                CLDWHOLEARCHIVE="-Wl,-whole-archive"
                CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
                LDDEPS="$LDDEPS .export.sym"
-               LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
                LIB_SUFFIX=so
                DEVMAPPER=yes
                LVMETAD=no
@@ -48,6 +49,7 @@ case "$host_os" in
                CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
                COPTIMISE_FLAG="-O2"
                CLDFLAGS="$CLDFLAGS"
+               ELDFLAGS=
                CLDWHOLEARCHIVE="-all_load"
                CLDNOWHOLEARCHIVE=
                LIB_SUFFIX=dylib
@@ -60,6 +62,8 @@ case "$host_os" in
                ;;
 esac
 
+VERITYSETUP=no
+
 ################################################################################
 dnl -- Checks for programs.
 AC_PROG_SED
@@ -227,6 +231,20 @@ esac
 AC_MSG_RESULT(on $ADD_NODE)
 AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create])
 
+AC_MSG_CHECKING(default name mangling)
+AC_ARG_WITH(default-name-mangling,
+           AC_HELP_STRING([--with-default-name-mangling=MANGLING],
+                          [default name mangling: auto/none/hex [[MANGLING=auto]]]),
+           MANGLING=$withval, MANGLING=auto)
+case "$MANGLING" in
+ auto) mangling=DM_STRING_MANGLING_AUTO;;
+ disabled) mangling=DM_STRING_MANGLING_NONE;;
+ hex) mangling=DM_STRING_MANGLING_HEX;;
+ *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);;
+esac
+AC_MSG_RESULT($MANGLING)
+AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour])
+
 ################################################################################
 dnl -- LVM1 tool fallback option
 AC_MSG_CHECKING(whether to enable lvm1 fallback)
@@ -395,6 +413,24 @@ case "$THIN" in
   *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;;
 esac
 
+case "$THIN" in
+  internal|shared)
+       AC_ARG_WITH(thin-check,
+               AC_HELP_STRING([--with-thin-check=PATH],
+                              [thin_check tool: [[autodetect]]]),
+                              THIN_CHECK_CMD=$withval, THIN_CHECK_CMD="autodetect")
+       # Empty means a config way to ignore thin checking
+       if test "$THIN_CHECK_CMD" = "autodetect"; then
+               AC_PATH_PROG(THIN_CHECK_CMD, thin_check)
+               test -z "$THIN_CHECK_CMD" && AC_MSG_ERROR(thin_check not found in path $PATH)
+       fi
+       ;;
+esac
+
+AC_DEFINE_UNQUOTED([THIN_CHECK_CMD], ["$THIN_CHECK_CMD"],
+                  [The path to 'thin_check', if available.])
+
+
 ################################################################################
 dnl -- Disable readline
 AC_MSG_CHECKING(whether to enable readline)
@@ -547,6 +583,7 @@ if test x$BUILDCOROSYNC = xyes || \
    test x$BUILDOPENAIS = xyes; then
        PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
        CHECKCONFDB=yes
+       CHECKCMAP=yes
 fi
 
 dnl -- Look for corosync libraries if required.
@@ -565,7 +602,7 @@ fi
 dnl -- Below are checks for libraries common to more than one build.
 
 dnl -- Check confdb library.
-dnl -- mandatory for corosync build.
+dnl -- mandatory for corosync < 2.0 build.
 dnl -- optional for openais/cman build.
 
 if test x$CHECKCONFDB = xyes; then
@@ -584,11 +621,34 @@ if test x$CHECKCONFDB = xyes; then
                CONFDB_LIBS="-lconfdb"
                HAVE_CONFDB=yes
        fi
+fi
+
+dnl -- Check cmap library
+dnl -- mandatory for corosync >= 2.0 build.
+
+if test x$CHECKCMAP = xyes; then
+       PKG_CHECK_MODULES(CMAP, libcmap,
+                         [HAVE_CMAP=yes],
+                         [HAVE_CMAP=no])
+
+       AC_CHECK_HEADERS(corosync/cmap.h,
+               [HAVE_CMAP_H=yes],
+               [HAVE_CMAP_H=no])
+
+       if test x$HAVE_CMAP != xyes && \ 
+          test x$HAVE_CMAP_H = xyes; then
+               check_lib_no_libs cmap cmap_initialize
+               AC_MSG_RESULT([no pkg for cmap, using -lcmap])
+               CMAP_LIBS="-lcmap"
+               HAVE_CMAP=yes
+       fi
+fi
 
-       if test x$BUILDCOROSYNC = xyes && \
-          test x$HAVE_CONFDB != xyes &&
+if test x$BUILDCOROSYNC = xyes; then
+       if test x$HAVE_CMAP != xyes && \
+          test x$HAVE_CONFDB != xyes && \
           test x$CLVMD != xall; then
-               AC_MSG_ERROR([bailing out... confdb library is required])
+               AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required])
        fi
 fi
 
@@ -627,11 +687,12 @@ if test x$CLVMD = xall; then
        if test x$HAVE_COROSYNC = xyes && \
           test x$HAVE_QUORUM = xyes && \
           test x$HAVE_CPG = xyes && \
-          test x$HAVE_DLM = xyes && \
-          test x$HAVE_CONFDB = xyes; then
+          test x$HAVE_DLM = xyes; then
+          if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then
                AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
                CLVMD="$CLVMD,corosync"
                CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync"
+          fi
        fi
        if test x$HAVE_COROSYNC = xyes && \
           test x$HAVE_CPG = xyes && \
@@ -648,6 +709,15 @@ if test x$CLVMD = xall; then
        fi
 fi
 
+dnl -- Fixup CLVMD_CMANAGERS with new corosync
+dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service)
+dnl -- to be started.
+if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
+   if test x$HAVE_CMAP = xyes; then
+       CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm"
+   fi
+fi
+
 ################################################################################
 dnl -- clvmd pidfile
 if test "x$CLVMD" != xnone; then
@@ -690,7 +760,12 @@ if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
        if  test x$PKGCONFIG_INIT != x1; then
                pkg_config_init
        fi
-       PKG_CHECK_MODULES(SACKPT, libSaCkpt)
+
+       AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.])
+       PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes],
+               [AC_MSG_RESULT([no libSaCkpt, compiling without it])
+               AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])])
+
        if test x$HAVE_CPG != xyes; then
                PKG_CHECK_MODULES(CPG, libcpg)
        fi
@@ -757,11 +832,7 @@ AC_ARG_ENABLE(testing,
 AC_MSG_RESULT($TESTING)
 
 if test "$TESTING" = yes; then
-   AC_PATH_PROG(RUBY19, ruby1.9)
-   AC_PATH_PROG(VALGRIND, valgrind)
-   if test -z "$RUBY19" -o -z "$VALGRIND"; then
-       AC_MSG_ERROR([ruby1.9 and valgrind are required for testing])
-   fi
+       PKG_CHECK_MODULES(CUNIT, cunit >= 2.0)
 fi
 
 ################################################################################
@@ -794,13 +865,17 @@ fi
 dnl -- Build lvmetad
 AC_MSG_CHECKING(whether to build LVMetaD)
 AC_ARG_ENABLE(lvmetad,
-             AC_HELP_STRING([--disable-lvmetad],
-                            [disable the LVM Metadata Daemon]),
+             AC_HELP_STRING([--enable-lvmetad],
+                            [enable the LVM Metadata Daemon]),
              LVMETAD=$enableval)
 AC_MSG_RESULT($LVMETAD)
 
 BUILD_LVMETAD=$LVMETAD
 
+if test x$BUILD_LVMETAD = xyes; then
+       AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.])
+fi
+
 ################################################################################
 dnl -- Enable udev synchronisation
 AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
@@ -827,6 +902,17 @@ AC_ARG_ENABLE(udev_rules,
              UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
 AC_MSG_RESULT($UDEV_RULES)
 
+if test x$UDEV_RULES = xyes; then
+       AC_MSG_CHECKING(whether udev supports builtin blkid)
+       udev_version=$(udevadm info --version 2>/dev/null)
+       if test -n "$udev_version" && test "$udev_version" -ge 176; then
+               UDEV_HAS_BUILTIN_BLKID=yes
+       else
+               UDEV_HAS_BUILTIN_BLKID=no
+       fi
+       AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID)
+fi
+
 ################################################################################
 dnl -- Compatibility mode
 AC_ARG_ENABLE(compat,
@@ -945,6 +1031,71 @@ if test x$DMEVENTD = xyes; then
        AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
 fi
 
+################################################################################
+dnl -- enable veritysetup
+AC_MSG_CHECKING(whether to install veritysetup)
+AC_ARG_WITH(veritysetup, AC_HELP_STRING([--with-veritysetup=TYPE], [build veritysetup using openssl/nss/gcrypt]),
+             VERITYSETUP=$withval)
+AC_MSG_RESULT($VERITYSETUP)
+
+if test x$VERITYSETUP != xno -a x$VERITYSETUP != x; then
+       if test x$PKGCONFIG_INIT != x1; then
+               pkg_config_init
+       fi
+
+       dnl Test OPENSSL
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xopenssl; then
+               PKG_CHECK_MODULES(OPENSSL, openssl, [
+                       AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
+                       VERITYSETUP_CFLAGS="$OPENSSL_CFLAGS"
+                       VERITYSETUP_LIBS="`echo "$OPENSSL_LIBS" | sed 's/-lssl\>//'`"
+               ], [
+                       AC_CHECK_LIB(crypto, EVP_get_digestbyname, [
+                               AC_CHECK_HEADER(openssl/evp.h, [
+                                       AC_DEFINE([CRYPT_OPENSSL], 1, [Define to 1 if OpenSSL encryption is to be used.])
+                                       VERITYSETUP_CFLAGS=
+                                       VERITYSETUP_LIBS="-lcrypto"
+                               ])
+                       ])
+               ])
+       fi
+
+       dnl Test NSS
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xnss; then
+               PKG_CHECK_MODULES(NSS, nss, [
+                       AC_DEFINE([CRYPT_NSS], 1, [Define to 1 if nss encryption is to be used.])
+                       VERITYSETUP_CFLAGS="$NSS_CFLAGS"
+                       VERITYSETUP_LIBS="`echo "$NSS_LIBS" | sed 's/-lsmime3\>//' | sed 's/-lssl3\>//'`"
+               ], true)
+       fi
+
+       dnl Test GCRYPT
+       if test -z "$VERITYSETUP_CFLAGS" && test x$VERITYSETUP = xyes -o x$VERITYSETUP = xgcrypt; then
+               AC_CHECK_LIB(gcrypt, gcry_md_map_name, [
+                       AC_CHECK_HEADER(gcrypt.h, [
+                               AC_DEFINE([CRYPT_GCRYPT], 1, [Define to 1 if gcrpyt encryption is to be used.])
+                               VERITYSETUP_CFLAGS=
+                               VERITYSETUP_LIBS="-lgcrypt"
+                       ])
+               ])
+       fi
+
+       if test -z "$VERITYSETUP_LIBS"; then
+               AC_MSG_ERROR(No cryptographic library for veritysetup found)
+       fi
+       AC_CHECK_LIB(popt, poptGetContext, true, [
+               AC_MSG_ERROR(popt library was not found)
+       ])
+       AC_CHECK_HEADER(popt.h, true, [
+               AC_MSG_ERROR(popt.h was not found)
+       ])
+       VERITYSETUP_LIBS="$VERITYSETUP_LIBS -lpopt"
+       AC_SUBST(VERITYSETUP_CFLAGS)
+       AC_SUBST(VERITYSETUP_LIBS)
+       VERITYSETUP=yes
+fi
+AC_SUBST(VERITYSETUP)
+
 ################################################################################
 dnl -- getline included in recent libc
 
@@ -1136,6 +1287,27 @@ AC_ARG_WITH(udevdir,
            udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
 
 ################################################################################
+dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly.
+dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage.
+AC_ARG_WITH(systemdsystemunitdir,
+           AC_HELP_STRING([--with-systemdsystemunitdir=DIR],
+                          [systemd service files in DIR]),
+           systemdsystemunitdir=$withval,
+           pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd))
+
+if test -n "$pkg_systemdsystemunitdir"; then
+           systemdsystemunitdir=$pkg_systemdsystemunitdir;
+fi
+
+if test -z "$systemdsystemunitdir"; then
+           systemdsystemunitdir='/lib/systemd/system';
+fi
+################################################################################
+AC_ARG_WITH(tmpfilesdir,
+           AC_HELP_STRING([--with-tmpfilesdir=DIR],
+                          [install configuration files for management of volatile files and directories in DIR [[SYSCONFDIR/tmpfiles.d]]]),
+                          tmpfilesdir=$withval, tmpfilesdir='${sysconfdir}/tmpfiles.d')
+################################################################################
 dnl -- Ensure additional headers required
 if test x$READLINE = xyes; then
        AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
@@ -1180,13 +1352,14 @@ fi
 lvm_exec_prefix=$exec_prefix
 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
 test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
-AC_DEFINE_UNQUOTED(LVM_PATH, ["$lvm_exec_prefix/sbin/lvm"], [Path to lvm binary.])
+LVM_PATH="$lvm_exec_prefix/sbin/lvm"
+AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.])
 
 if  test "$CLVMD" != none; then
         clvmd_prefix=$ac_default_prefix
+        CLVMD_PATH="$clvmd_prefix/sbin/clvmd"
         test "$prefix" != NONE && clvmd_prefix=$prefix
-       AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"],
-                          [Path to clvmd binary.])
+       AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.])
 fi
 
 ################################################################################
@@ -1309,8 +1482,11 @@ AC_SUBST(CLDWHOLEARCHIVE)
 AC_SUBST(CLUSTER)
 AC_SUBST(CLVMD)
 AC_SUBST(CLVMD_CMANAGERS)
+AC_SUBST(CLVMD_PATH)
 AC_SUBST(CMAN_CFLAGS)
 AC_SUBST(CMAN_LIBS)
+AC_SUBST(CMAP_CFLAGS)
+AC_SUBST(CMAP_LIBS)
 AC_SUBST(CMDLIB)
 AC_SUBST(CONFDB_CFLAGS)
 AC_SUBST(CONFDB_LIBS)
@@ -1340,6 +1516,7 @@ AC_SUBST(DM_DEVICE_UID)
 AC_SUBST(DM_IOCTLS)
 AC_SUBST(DM_LIB_VERSION)
 AC_SUBST(DM_LIB_PATCHLEVEL)
+AC_SUBST(ELDFLAGS)
 AC_SUBST(FSADM)
 AC_SUBST(HAVE_LIBDL)
 AC_SUBST(HAVE_REALTIME)
@@ -1357,6 +1534,7 @@ AC_SUBST(LVM_LIBAPI)
 AC_SUBST(LVM_MAJOR)
 AC_SUBST(LVM_MINOR)
 AC_SUBST(LVM_PATCHLEVEL)
+AC_SUBST(LVM_PATH)
 AC_SUBST(LVM_RELEASE)
 AC_SUBST(LVM_RELEASE_DATE)
 AC_SUBST(MIRRORS)
@@ -1382,10 +1560,14 @@ AC_SUBST(STATICDIR)
 AC_SUBST(STATIC_LINK)
 AC_SUBST(TESTING)
 AC_SUBST(THIN)
+AC_SUBST(THIN_CHECK_CMD)
 AC_SUBST(UDEV_LIBS)
 AC_SUBST(UDEV_PC)
 AC_SUBST(UDEV_RULES)
 AC_SUBST(UDEV_SYNC)
+AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
+AC_SUBST(CUNIT_LIBS)
+AC_SUBST(CUNIT_CFLAGS)
 AC_SUBST(WRITE_INSTALL)
 AC_SUBST(DMEVENTD_PIDFILE)
 AC_SUBST(interface)
@@ -1395,6 +1577,8 @@ AC_SUBST(kernelvsn)
 AC_SUBST(tmpdir)
 AC_SUBST(udev_prefix)
 AC_SUBST(udevdir)
+AC_SUBST(systemdsystemunitdir)
+AC_SUBST(tmpfilesdir)
 AC_SUBST(usrlibdir)
 AC_SUBST(usrsbindir)
 
@@ -1414,6 +1598,7 @@ daemons/dmeventd/plugins/lvm2/Makefile
 daemons/dmeventd/plugins/raid/Makefile
 daemons/dmeventd/plugins/mirror/Makefile
 daemons/dmeventd/plugins/snapshot/Makefile
+daemons/dmeventd/plugins/thin/Makefile
 daemons/lvmetad/Makefile
 doc/Makefile
 doc/example.conf
@@ -1429,6 +1614,9 @@ lib/misc/lvm-version.h
 lib/raid/Makefile
 lib/snapshot/Makefile
 lib/thin/Makefile
+libdaemon/Makefile
+libdaemon/client/Makefile
+libdaemon/server/Makefile
 libdm/Makefile
 libdm/libdevmapper.pc
 liblvm/Makefile
@@ -1437,17 +1625,23 @@ man/Makefile
 po/Makefile
 scripts/clvmd_init_red_hat
 scripts/cmirrord_init_red_hat
+scripts/lvm2_lvmetad_init_red_hat
+scripts/lvm2_lvmetad_systemd_red_hat.socket
+scripts/lvm2_lvmetad_systemd_red_hat.service
 scripts/lvm2_monitoring_init_red_hat
 scripts/dm_event_systemd_red_hat.service
 scripts/lvm2_monitoring_systemd_red_hat.service
+scripts/lvm2_tmpfiles_red_hat.conf
 scripts/Makefile
 test/Makefile
 test/api/Makefile
+test/unit/Makefile
 tools/Makefile
 udev/Makefile
 unit-tests/datastruct/Makefile
 unit-tests/regex/Makefile
 unit-tests/mm/Makefile
+verity/Makefile
 ])
 AC_OUTPUT
 
This page took 0.04118 seconds and 5 git commands to generate.