[SSSD] [PATCH] use proper Kerberos CFLAGS
Lukas Slebodnik
lslebodn at redhat.com
Thu Feb 6 15:30:48 UTC 2014
On (06/02/14 16:23), Jakub Hrozek wrote:
>On Thu, Feb 06, 2014 at 04:17:50PM +0100, Lukas Slebodnik wrote:
>> I was not able reproduce compilation failures with custom build of MIT Kerberos
>> installed in /usr/local/. It could not be influenced by libraries installed
>> from rpm, because I remove packages krb5-workstation, krb5-devel, krb5-libs
>> (rpm -e --nodeps). I also tried build sssd on ubuntu (with custom build of MIT
>> Kerberos) and there was not any problem.
>>
>> I had to install MIT Kerberos into different directory
>> (prefix /usr/local/extra/), but your patch did not solve all problem.
>>
>> user at user-virtual-machine:/tmp/sssd$ krb5-config --libs
>> -L/usr/local/extra/lib -Wl,--enable-new-dtags -Wl,-rpath
>> -Wl,/usr/local/extra/lib -lkrb5 -lk5crypto -lcom_err
>> user at user-virtual-machine:/tmp/sssd$ krb5-config --cflags
>> -I/usr/local/extra/include
>> user at user-virtual-machine:/tmp/sssd$ krb5-config --version
>> Kerberos 5 release 1.12.1
>>
>> CCLD sssd_pac_plugin.la
>> /usr/bin/ld: cannot find -lkrb5
>> collect2: error: ld returned 1 exit status
>> make[2]: *** [sssd_pac_plugin.la] Error 1
>> make[2]: Leaving directory `/tmp/sssd'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/tmp/sssd'
>> make: *** [all] Error 2
>>
>> There was hardcoded "-lkrb5" in Makefile, so I changed it into $(KRB5_LIBS)
>>
>> But there was another problem.
>>
>> CC src/providers/ldap/ldap_id.lo
>> In file included from ./src/providers/krb5/krb5_common.h:34:0,
>> from ./src/providers/ldap/ldap_common.h:29,
>> from src/providers/ldap/ldap_id.c:32:
>> ./src/util/sss_krb5.h:30:23: fatal error: krb5/krb5.h: No such file or directory
>> compilation terminated.
>>
>>
>> So I gave up to fix all problems.
>> Do you want to fix them?
>>
>> Thank you very much for your effort in improving sssd build system.
>>
>> LS
>
>I don't think we need to reproduce the failures per se. If the patch
>helps their distribution while not breaking ours, that's good enough for
>me.
In my opinion, Alexander-s patch does not solve all problems.
Adding Alexey Shabalin to CC.
Could you confirm attached patch solves problem on ALT Linux?
LS
-------------- next part --------------
>From 1c777be7783eb46b3c849489c3f80fae1b1a203e Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Wed, 5 Feb 2014 18:56:09 +0200
Subject: [PATCH] Make sure KRB5_CFLAGS is used properly
There are cases when MIT Kerberos is installed with includes
in a subdirectory of /usr/include (or /usr/local/include).
In such case we have to properly use KRB5_CFLAGS to reach them.
Thanks to Alexey Shabalin (a.shabalin at gmail.com)
https://fedorahosted.org/sssd/ticket/2226
---
Makefile.am | 6 +++++-
src/external/krb5.m4 | 5 +++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 9c155d6..efb2028 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1276,6 +1276,7 @@ krb5_child_test_SOURCES = \
$(SSSD_FAILOVER_OBJ)
krb5_child_test_CFLAGS = \
$(AM_CFLAGS) \
+ $(KRB5_CFLAGS) \
-DKRB5_CHILD_DIR=\"$(builddir)\" \
$(CHECK_CFLAGS) \
$(SYSTEMD_LOGIN_CFLAGS)
@@ -1674,6 +1675,8 @@ libsss_krb5_common_la_SOURCES = \
src/providers/krb5/krb5_init_shared.c
libsss_krb5_common_la_LDFLAGS = \
-avoid-version
+libsss_krb5_common_la_CFLAGS = \
+ $(KRB5_CFLAGS)
libsss_ldap_la_SOURCES = \
src/util/find_uid.c \
@@ -1734,7 +1737,8 @@ libsss_krb5_la_SOURCES = \
libsss_krb5_la_CFLAGS = \
$(AM_CFLAGS) \
$(SYSTEMD_LOGIN_CFLAGS) \
- $(DHASH_CFLAGS)
+ $(DHASH_CFLAGS) \
+ $(KRB5_CFLAGS)
libsss_krb5_la_LIBADD = \
$(SYSTEMD_LOGIN_LIBS) \
$(DHASH_LIBS) \
diff --git a/src/external/krb5.m4 b/src/external/krb5.m4
index 1a50bf1..861c8c9 100644
--- a/src/external/krb5.m4
+++ b/src/external/krb5.m4
@@ -67,6 +67,8 @@ AC_CHECK_FUNCS([krb5_get_init_creds_opt_alloc krb5_get_error_message \
krb5_cc_get_full_name])
CFLAGS=$SAVE_CFLAGS
LIBS=$SAVE_LIBS
+CFLAGS="$CFLAGS $KRB5_CFLAGS"
+LIBS="$LIBS $KRB5_LIBS"
if test x$ac_cv_header_krb5_h != xyes -a x$ac_cv_header_krb5_krb5_h != xyes
then
@@ -93,3 +95,6 @@ AM_CONDITIONAL([BUILD_KRB5_LOCATOR_PLUGIN],
[test x$have_locate_plugin = xyes -a x$build_locator = xyes])
AM_COND_IF([BUILD_KRB5_LOCATOR_PLUGIN],
[AC_DEFINE_UNQUOTED(HAVE_KRB5_LOCATOR_PLUGIN, 1, [Build with krb5 locator plugin])])
+
+CFLAGS=$SAVE_CFLAGS
+LIBS=$SAVE_LIBS
--
1.8.4.2
More information about the sssd-devel
mailing list