[SSSD] [PATCH] use proper Kerberos CFLAGS

Alexander Bokovoy abokovoy at redhat.com
Wed Feb 5 13:31:55 UTC 2014


Hi,

thanks to Alexey Shabalin (ALT Linux Team), following patch makes sure
SSSD will compile against MIT Kerberos with headers installed in a
subdirectory of /usr/include (/usr/include/krb5 in ALT Linux).

Please apply.

-- 
/ Alexander Bokovoy
-------------- next part --------------
>From 09893453dadca3488185142b6fef0df455fdbe69 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Wed, 5 Feb 2014 15:27:37 +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)
---
 Makefile.am          | 7 ++++++-
 src/external/krb5.m4 | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 9c155d6..3d8f689 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -981,6 +981,7 @@ strtonum_tests_SOURCES = \
     src/util/strtonum.c
 strtonum_tests_CFLAGS = \
     $(AM_CFLAGS) \
+    $(KRB5_CFLAGS) \
     $(CHECK_CFLAGS)
 strtonum_tests_LDADD = \
     $(SSSD_LIBS) \
@@ -1276,6 +1277,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 +1676,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 +1738,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