From b1ce544568eff89f2263ae180e323f263f1cff3a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 8 Jan 2016 10:56:17 -0500 Subject: [PATCH 10/19] Secrets: Add autoconf macros to build with secrets Prepares autoconf for the new Secrets Provider Related: https://fedorahosted.org/sssd/ticket/2913 Reviewed-by: Jakub Hrozek --- configure.ac | 3 +++ src/conf_macros.m4 | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/configure.ac b/configure.ac index dbfdeb40fdfbf0765ffad3b8848ca7c039c679ec..ef3d19bf377dc474c6e3b7eddd0931822ffa40be 100644 --- a/configure.ac +++ b/configure.ac @@ -147,6 +147,9 @@ WITH_NFS WITH_NFS_LIB_PATH WITH_LIBWBCLIENT WITH_SSSD_USER +SSSD_RUNSTATEDIR +WITH_SECRETS +WITH_SECRETS_DB_PATH m4_include([src/external/pkg.m4]) m4_include([src/external/libpopt.m4]) diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 index eed6508b1335e761aebae00d4ced373b00029f4c..bc295c5e79d3c699b25cebf38e8c0f0112de010d 100644 --- a/src/conf_macros.m4 +++ b/src/conf_macros.m4 @@ -861,3 +861,45 @@ AC_DEFUN([ENABLE_POLKIT_RULES_PATH], AM_CONDITIONAL([HAVE_POLKIT_RULES_D], [test x$HAVE_POLKIT_RULES_D != x]) ]) + +dnl Backwards compat for older autoconf +AC_DEFUN([SSSD_RUNSTATEDIR], + [ + if test x"$runstatedir" = x; then + AC_SUBST([runstatedir], + ["${localstatedir}/run"]) + fi + ]) + +AC_DEFUN([WITH_SECRETS], + [ AC_ARG_WITH([secrets], + [AC_HELP_STRING([--with-secrets], + [Whether to build with secrets support [yes]] + ) + ], + [with_secrets=$withval], + with_secrets=yes + ) + + if test x"$with_secrets" = xyes; then + AC_DEFINE(BUILD_SECRETS, 1, [whether to build with SECRETS support]) + fi + AM_CONDITIONAL([BUILD_SECRETS], [test x"$with_secrets" = xyes]) + ]) + +AC_DEFUN([WITH_SECRETS_DB_PATH], + [ AC_ARG_WITH([secrets-db-path], + [AC_HELP_STRING([--with-secrets-db-path=PATH], + [Path to the SSSD databases [/var/lib/sss/secrets]] + ) + ] + ) + config_secdbpath="\"SSS_STATEDIR\"/secrets" + secdbpath="${localstatedir}/lib/sss/secrets" + if test x"$with_secrets_db_path" != x; then + config_secdbpath=$with_secrets_db_path + secdbpath=$with_secrets_db_path + fi + AC_SUBST(secdbpath) + AC_DEFINE_UNQUOTED(SECRETS_DB_PATH, "$config_secdbpath", [Path to the SSSD Secrets databases]) + ]) -- 2.4.11