summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2014-03-04 16:40:36 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-05-16 15:53:50 +0200
commitd1da6541423bcb0e587939945572d29060d0b6a0 (patch)
tree4e78f3d9ad3d5025b2d8f3999507edaf5dd064e6
parent1f5eca38ab43953aacb89a4f6dc4c550a0baef9b (diff)
downloadsssd-d1da6541423bcb0e587939945572d29060d0b6a0.tar.gz
sssd-d1da6541423bcb0e587939945572d29060d0b6a0.tar.xz
sssd-d1da6541423bcb0e587939945572d29060d0b6a0.zip
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. Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r--Makefile.am8
-rw-r--r--configure.ac1
-rw-r--r--src/conf_macros.m416
-rw-r--r--src/external/libndr_nbt.m411
-rw-r--r--src/tests/dlopen-tests.c2
5 files changed, 34 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index cbd549a77..154bf38a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -181,10 +181,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
diff --git a/configure.ac b/configure.ac
index b7601317d..57829b7c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,7 @@ WITH_SUDO_LIB_PATH
WITH_AUTOFS
WITH_SSH
WITH_CRYPTO
+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 b4db0b4a2..554e303b6 100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -592,3 +592,19 @@ AC_DEFUN([WITH_SSH],
fi
AM_CONDITIONAL([BUILD_SSH], [test x"$with_ssh" = 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 d4d94f2d6..bb4f89f13 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 71b79f9e2..d80f0b1bc 100644
--- a/src/tests/dlopen-tests.c
+++ b/src/tests/dlopen-tests.c
@@ -71,10 +71,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_ldap.so", { LIBPFX"libdlopen_test_providers.so",