>From 8b4746d7e2d5c53cbe5d29f1ce984a16aefb5a54 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 15 Oct 2013 10:27:36 +0200 Subject: [PATCH 1/2] BUILD: Explicitly link libsss_ad.so with sasl libs If openldap is not built with sasl support libsss_ad.so will not be linked with libsasl2 although sasl_client_init is called by function ad_sasl_initialize. --- Makefile.am | 2 ++ configure.ac | 3 +-- src/external/sasl.m4 | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/external/sasl.m4 diff --git a/Makefile.am b/Makefile.am index e9bed47e3454867dadf7a2afdf90513c6bd0a796..0d795971f547e92740ca072942c1874d594035bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1760,12 +1760,14 @@ libsss_ad_la_CFLAGS = \ $(AM_CFLAGS) \ $(SYSTEMD_LOGIN_CFLAGS) \ $(LDAP_CFLAGS) \ + $(SASL_CFLAGS) \ $(DHASH_CFLAGS) \ $(KRB5_CFLAGS) \ $(NDR_NBT_CFLAGS) libsss_ad_la_LIBADD = \ $(SYSTEMD_LOGIN_LIBS) \ $(OPENLDAP_LIBS) \ + $(SASL_LIBS) \ $(DHASH_LIBS) \ $(KEYUTILS_LIBS) \ $(KRB5_LIBS) \ diff --git a/configure.ac b/configure.ac index 9934b50b90591cc46867fbb17a84a9aada2cd25e..93038204fad6f2f52bc741cfcc3aebc9bdecb988 100644 --- a/configure.ac +++ b/configure.ac @@ -158,6 +158,7 @@ m4_include([src/external/cifsidmap.m4]) m4_include([src/external/signal.m4]) m4_include([src/external/inotify.m4]) m4_include([src/external/libndr_nbt.m4]) +m4_include([src/external/sasl.m4]) WITH_UNICODE_LIB if test x$unicode_lib = xlibunistring; then @@ -262,8 +263,6 @@ fi AM_CHECK_INOTIFY -AC_CHECK_HEADERS([sasl/sasl.h],,AC_MSG_ERROR([Could not find SASL headers])) - AC_CACHE_CHECK([whether compiler supports __attribute__((destructor))], sss_client_cv_attribute_destructor, [AC_COMPILE_IFELSE( diff --git a/src/external/sasl.m4 b/src/external/sasl.m4 new file mode 100644 index 0000000000000000000000000000000000000000..5980624af359557575c93032b470653b84c74c55 --- /dev/null +++ b/src/external/sasl.m4 @@ -0,0 +1,17 @@ +SASL_OBJ="" +AC_SUBST(SASL_OBJ) +AC_SUBST(SASL_LIBS) +AC_SUBST(SASL_CFLAGS) + +PKG_CHECK_MODULES([SASL], [libsasl2], [found_sasl=yes], [found_sasl=no]) + +SSS_AC_EXPAND_LIB_DIR() +AS_IF([test x"$found_sasl" != xyes], + [AC_CHECK_HEADERS([sasl/sasl.h], + [AC_CHECK_LIB([sasl2], + [sasl_client_init], + [SASL_LIBS="-L$sss_extra_libdir -lsasl2"], + [AC_MSG_ERROR([SASL library must support sasl_client_init])], + [-L$sss_extra_libdir])], + [AC_MSG_ERROR([SASL header files are not installed])])] +) -- 1.8.3.1