>From 66e9118928dd3c6cc4cbb63b417d4b552d7e3b82 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 4 Mar 2014 16:40:36 +0100 Subject: [PATCH] BUILD: Make samba4 libraries optional 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. --- Makefile.am | 15 ++++++++++++--- configure.ac | 1 + src/conf_macros.m4 | 16 ++++++++++++++++ src/external/libndr_nbt.m4 | 11 +++++++++-- src/tests/dlopen-tests.c | 2 ++ 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index c46bba5da0dbd6f14459f0dd5d9c964ab19b263c..483584e5320bfcd8e262ed03d9be7fa670a38932 100644 --- a/Makefile.am +++ b/Makefile.am @@ -177,7 +177,6 @@ if HAVE_CMOCKA test_sss_idmap \ test_ipa_idmap \ test_utils \ - ad_access_filter_tests \ ad_common_tests \ dp_opt_tests \ responder-get-domains-tests \ @@ -188,6 +187,10 @@ if BUILD_IFP non_interactive_cmocka_based_tests += ifp_tests endif # BUILD_IFP +if BUILD_SAMBA +non_interactive_cmocka_based_tests += ad_access_filter_tests +endif + endif # HAVE_CMOCKA check_PROGRAMS = \ @@ -214,10 +217,14 @@ sssdlib_LTLIBRARIES = \ libsss_ldap.la \ libsss_krb5.la \ libsss_proxy.la \ - libsss_ipa.la \ - libsss_ad.la \ libsss_simple.la +if BUILD_SAMBA +sssdlib_LTLIBRARIES += \ + libsss_ipa.la \ + libsss_ad.la +endif + ldblib_LTLIBRARIES = \ memberof.la @@ -1943,7 +1950,9 @@ libsss_ldap_common_la_SOURCES += \ src/providers/ldap/sdap_async_autofs.c endif +if BUILD_SAMBA pkglib_LTLIBRARIES += libsss_ad_common.la +endif libsss_ad_common_la_SOURCES = \ $(libsss_ad_la_SOURCES) libsss_ad_common_la_LDFLAGS = \ diff --git a/configure.ac b/configure.ac index e75816a718a1f9b3a99ea9c8a784213c0bf427ee..c663f5eeee7e2f06473e266cb6fe646b4d07c8d8 100644 --- a/configure.ac +++ b/configure.ac @@ -127,6 +127,7 @@ WITH_SSH WITH_IFP WITH_CRYPTO WITH_SYSLOG +WITH_SAMBA 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 1c316266886051e4841d3eef4c3e594ea7ccd144..2c834031958e261689a84db6662cd108eb1eada3 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 d4d94f2d608454e1df855ab2d2c8396189c0d428..bb4f89f13b119a0eeb95d9304386d1d2f65e6bfa 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 2396aee8a601e53e9d153a69b0a88c0b9fe99a0c..dc9062501c7c73c068dd919de42bf471e4972fa2 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", -- 1.9.0