summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2016-03-16 10:46:21 +0100
committerMichele Calgaro <[email protected]>2016-03-16 10:46:21 +0100
commit5207ad8904c322cfe04ffb0d2ecb011ca4444dd3 (patch)
tree7a5caaa7e45e80d66ecc55e0f84c67f04bd0175a
parente850ed29f0767f07eb8b18ee6271cd6f5aa514c8 (diff)
downloadkcmldapcontroller-5207ad8904c322cfe04ffb0d2ecb011ca4444dd3.tar.gz
kcmldapcontroller-5207ad8904c322cfe04ffb0d2ecb011ca4444dd3.zip
Fix krb5 library detection. This resolves FTBFS with heimdal-krb5.
Based on similar patch for libraries/libtdeldap from Slavek Banko. Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r--acl-updater/plugin/Makefile.am4
-rw-r--r--cert-updater/Makefile.am4
-rw-r--r--configure.in.in37
-rw-r--r--src/Makefile.am4
-rw-r--r--src/primaryrealmwizard/Makefile.am2
-rw-r--r--src/secondaryrealmwizard/Makefile.am2
6 files changed, 45 insertions, 8 deletions
diff --git a/acl-updater/plugin/Makefile.am b/acl-updater/plugin/Makefile.am
index ea1c02a..e0a1924 100644
--- a/acl-updater/plugin/Makefile.am
+++ b/acl-updater/plugin/Makefile.am
@@ -1,7 +1,7 @@
-INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir)
+INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir) $(KRB5_CFLAGS)
lib_LTLIBRARIES = slapi-acl-manager.la
slapi_acl_manager_la_SOURCES = interface.c plugin.cpp plugin.h
slapi_acl_manager_la_LIBADD = -ltqt-mt -ltdeldap
-slapi_acl_manager_la_LDFLAGS = -module -avoid-version $(all_libraries) \ No newline at end of file
+slapi_acl_manager_la_LDFLAGS = -module -avoid-version $(all_libraries) $(KRB5_LIBS) \ No newline at end of file
diff --git a/cert-updater/Makefile.am b/cert-updater/Makefile.am
index 7b9c261..bf6707a 100644
--- a/cert-updater/Makefile.am
+++ b/cert-updater/Makefile.am
@@ -1,10 +1,10 @@
-INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde
+INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde $(KRB5_CFLAGS)
bin_PROGRAMS = primaryrccertupdater
primaryrccertupdater_SOURCES = main.cpp
primaryrccertupdater_METASOURCES = AUTO
-primaryrccertupdater_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap
+primaryrccertupdater_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap $(KRB5_LIBS)
KDE_OPTIONS = nofinal \ No newline at end of file
diff --git a/configure.in.in b/configure.in.in
index 18b1486..03cae23 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -4,3 +4,40 @@ AM_INIT_AUTOMAKE(autostart, 0.1)
AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN
+
+PKG_CHECK_MODULES(KRB5, krb5, have_krb5=yes, have_krb5=no)
+if test "x$have_krb5" = "xno"; then
+ # Try to find krb5 without pkg-config file
+ AC_MSG_CHECKING(krb5)
+ AC_FIND_FILE(krb5.h, [\
+ /usr/local/include/heimdal /usr/local/include \
+ /usr/include/heimdal /usr/include \
+ ], krb5_includes)
+ if test "x$krb5_includes" != "xNO"; then
+ krb5_multiarch="`gcc -print-multiarch 2>/dev/null`"
+ AC_FIND_FILE(libkrb5.so, [\
+ /usr/local/lib/$krb5_multiarch/heimdal /usr/local/lib64/heimdal /usr/local/lib/heimdal \
+ /usr/local/lib/$krb5_multiarch /usr/local/lib64 /usr/local/lib \
+ /usr/lib/$krb5_multiarch/heimdal /usr/lib64/heimdal /usr/lib/heimdal \
+ /usr/lib/$krb5_multiarch /usr/lib64 /usr/lib \
+ ], krb5_libs)
+ if test "x$krb5_libs" != "xNO"; then
+ AC_MSG_RESULT([libraries $krb5_libs, headers $krb5_includes])
+ CPPFLAGS="$CPPFLAGS -I$krb5_includes"
+ CFLAGS="$CFLAGS -I$krb5_includes"
+ LDFLAGS="$LDFLAGS -L$krb5_libs"
+ AC_CHECK_HEADER(krb5.h, have_krb5=yes)
+ fi
+ fi
+ if test "x$have_krb5" != "xno"; then
+ KRB5_CFLAGS="-I$krb5_includes"
+ KRB5_LIBS="-L$krb5_libs -lkrb5"
+ AC_SUBST(KRB5_CFLAGS)
+ AC_SUBST(KRB5_LIBS)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+if test "x$have_krb5" = "xno"; then
+ AC_MSG_ERROR([krb5 library is needed but not found on our system])
+fi
diff --git a/src/Makefile.am b/src/Makefile.am
index e0e84a3..a859966 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde
+INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde $(KRB5_CFLAGS)
METASOURCES = AUTO
SUBDIRS = primaryrealmwizard secondaryrealmwizard
@@ -7,7 +7,7 @@ kde_module_LTLIBRARIES = kcm_ldapcontroller.la
kcm_ldapcontroller_la_SOURCES = ldapcontroller.cpp ldapcontrollerconfigbase.ui processingdialog.cpp sha1.cc multimasterreplicationconfigbase.ui multimasterreplicationconfigdlg.cpp
kcm_ldapcontroller_la_LIBADD = primaryrealmwizard/libprimaryrealmwizard.la secondaryrealmwizard/libsecondaryrealmwizard.la $(LIB_TDEIO) $(LIB_TDEUI) -ltdeldap
-kcm_ldapcontroller_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries)
+kcm_ldapcontroller_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries) $(KRB5_LIBS)
xdg_apps_DATA = ldapcontroller.desktop
diff --git a/src/primaryrealmwizard/Makefile.am b/src/primaryrealmwizard/Makefile.am
index 8f61131..05d02e5 100644
--- a/src/primaryrealmwizard/Makefile.am
+++ b/src/primaryrealmwizard/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir)/src
+INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir)/src $(KRB5_CFLAGS)
METASOURCES = AUTO
noinst_LTLIBRARIES = libprimaryrealmwizard.la
diff --git a/src/secondaryrealmwizard/Makefile.am b/src/secondaryrealmwizard/Makefile.am
index 883f260..62223f4 100644
--- a/src/secondaryrealmwizard/Makefile.am
+++ b/src/secondaryrealmwizard/Makefile.am
@@ -1,4 +1,4 @@
-INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir)/src
+INCLUDES = $(all_includes) $(KDE_INCLUDES)/tde -I$(top_srcdir)/src $(KRB5_CFLAGS)
METASOURCES = AUTO
noinst_LTLIBRARIES = libsecondaryrealmwizard.la