summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-03-15 18:23:03 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2016-03-15 18:23:03 (GMT)
commitf642cc77d7376de144d8fb31bc723926d62e7aa9 (patch)
tree793200734262339006e6874276dad195d5cb0bf2
parent7b0e95f329aa2a4df8e58682d607f604c97aaf3b (diff)
downloadlibtdeldap-f642cc77.zip
libtdeldap-f642cc77.tar.gz
Fix krb5 library detection
This resolves FTBFS with heimdal-krb5 Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--configure.in.in37
-rw-r--r--src/Makefile.am4
2 files changed, 39 insertions, 2 deletions
diff --git a/configure.in.in b/configure.in.in
index 3b3f6bf..1a5cd4a 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -13,3 +13,40 @@ lt_age="0"
AC_SUBST(lt_current)
AC_SUBST(lt_revision)
AC_SUBST(lt_age)
+
+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 (required for older distros)
+ 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 46bf90e..44d6871 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
KDE_CXXFLAGS = $(ENABLE_PERMISSIVE_FLAG)
-INCLUDES = $(all_includes)
+INCLUDES = $(all_includes) $(KRB5_CFLAGS)
METASOURCES = AUTO
# Create a shared library file
@@ -11,5 +11,5 @@ include_HEADERS = libtdeldap.h ldappasswddlg.h
libtdeldap_la_SOURCES = libtdeldap.cpp ldaplogindlgbase.ui ldaplogindlg.cpp ldappasswddlg.cpp
libtdeldap_la_LIBADD = -ltdeio $(LIB_TDEUI) -lldap $(LIB_QT) $(LIB_TDECORE) -ltdesu -llber -lkadm5clnt -lkadm5srv
libtdeldap_la_LDFLAGS = -version-info $(lt_current):$(lt_revision):$(lt_age) -no-undefined \
- $(all_libraries)
+ $(all_libraries) $(KRB5_LIBS)