From a2e417f38c57ed87c956ddcecf4dafca93842b65 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 4 Mar 2014 16:40:36 +0100 Subject: BUILD: Make samba4 libraries optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Samba 4 libraries are necessary for building {ad, ipa} provider, but samba4 needn't be available on older distributions. This patch add possibility to build SSSD without {ad, ipa} provider and thus without Samba 4 libraries. The script configure have new argument --with-samba with default value yes. Reviewed-by: Michal Židek --- src/conf_macros.m4 | 16 ++++++++++++++++ src/external/libndr_nbt.m4 | 11 +++++++++-- src/tests/dlopen-tests.c | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 index 1c316266..2c834031 100644 --- a/src/conf_macros.m4 +++ b/src/conf_macros.m4 @@ -651,3 +651,19 @@ AC_DEFUN([WITH_IFP], fi AM_CONDITIONAL([BUILD_IFP], [test x"$with_infopipe" = xyes]) ]) + +AC_DEFUN([WITH_SAMBA], + [ AC_ARG_WITH([samba], + [AC_HELP_STRING([--with-samba], + [Whether to build with samba4 libraries [yes]] + ) + ], + [with_samba=$withval], + [with_samba=yes] + ) + + if test x"$with_samba" = xyes; then + AC_DEFINE(BUILD_SAMBA, 1, [whether to build with samba support]) + fi + AM_CONDITIONAL([BUILD_SAMBA], [test x"$with_samba" = xyes]) + ]) diff --git a/src/external/libndr_nbt.m4 b/src/external/libndr_nbt.m4 index d4d94f2d..bb4f89f1 100644 --- a/src/external/libndr_nbt.m4 +++ b/src/external/libndr_nbt.m4 @@ -1,5 +1,12 @@ AC_SUBST(NDR_NBT_CFLAGS) AC_SUBST(NDR_NBT_LIBS) -PKG_CHECK_MODULES(NDR_NBT, ndr_nbt, , - AC_MSG_ERROR("Please install Samba 4 development libraries")) \ No newline at end of file +if test x"$with_samba" = xyes; then + PKG_CHECK_MODULES(NDR_NBT, ndr_nbt, , + AC_MSG_ERROR([[Please install Samba 4 development libraries. +Samba 4 libraries are necessary for building ad and ipa provider. +If you do not want to build these providers it is possible to build SSSD +without them. In this case, you will need to execute configure script +with argument --without-samba + ]])) +fi diff --git a/src/tests/dlopen-tests.c b/src/tests/dlopen-tests.c index 2396aee8..dc906250 100644 --- a/src/tests/dlopen-tests.c +++ b/src/tests/dlopen-tests.c @@ -74,10 +74,12 @@ struct so { LIBPFX"libsss_util.so", NULL } }, { "libsss_simple.so", { LIBPFX"libdlopen_test_providers.so", LIBPFX"libsss_simple.so", NULL } }, +#ifdef BUILD_SAMBA { "libsss_ad.so", { LIBPFX"libdlopen_test_providers.so", LIBPFX"libsss_ad.so", NULL } }, { "libsss_ipa.so", { LIBPFX"libdlopen_test_providers.so", LIBPFX"libsss_ipa.so", NULL } }, +#endif /* BUILD_SAMBA */ { "libsss_krb5.so", { LIBPFX"libdlopen_test_providers.so", LIBPFX"libsss_krb5.so", NULL } }, { "libsss_krb5_common.so", { LIBPFX"libdlopen_test_providers.so", -- cgit