Browse Source

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 <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 3 years ago
parent
commit
d2fb5b21a9
4 changed files with 43 additions and 6 deletions
  1. 2
    2
      cert-updater/Makefile.am
  2. 2
    2
      cmdline/Makefile.am
  3. 37
    0
      configure.in.in
  4. 2
    2
      src/Makefile.am

+ 2
- 2
cert-updater/Makefile.am View File

@@ -1,10 +1,10 @@
1
-INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde
1
+INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde $(KRB5_CFLAGS)
2 2
 
3 3
 bin_PROGRAMS = tdeldapcertupdater
4 4
 
5 5
 tdeldapcertupdater_SOURCES = main.cpp
6 6
 
7 7
 tdeldapcertupdater_METASOURCES = AUTO
8
-tdeldapcertupdater_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap
8
+tdeldapcertupdater_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap $(KRB5_LIBS)
9 9
 
10 10
 KDE_OPTIONS = nofinal

+ 2
- 2
cmdline/Makefile.am View File

@@ -1,10 +1,10 @@
1
-INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde
1
+INCLUDES= $(all_includes) $(KDE_INCLUDES)/tde $(KRB5_CFLAGS)
2 2
 
3 3
 bin_PROGRAMS = tdeldapbonding
4 4
 
5 5
 tdeldapbonding_SOURCES = main.cpp
6 6
 
7 7
 tdeldapbonding_METASOURCES = AUTO
8
-tdeldapbonding_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap
8
+tdeldapbonding_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -ltdeldap $(KRB5_LIBS)
9 9
 
10 10
 KDE_OPTIONS = nofinal

+ 37
- 0
configure.in.in View File

@@ -4,3 +4,40 @@ AM_INIT_AUTOMAKE(autostart, 0.1)
4 4
 AC_C_BIGENDIAN
5 5
 AC_CHECK_KDEMAXPATHLEN
6 6
 
7
+
8
+PKG_CHECK_MODULES(KRB5, krb5, have_krb5=yes, have_krb5=no)
9
+if test "x$have_krb5" = "xno"; then
10
+  # Try to find krb5 without pkg-config file
11
+  AC_MSG_CHECKING(krb5)
12
+  AC_FIND_FILE(krb5.h, [\
13
+    /usr/local/include/heimdal /usr/local/include \
14
+    /usr/include/heimdal /usr/include \
15
+    ], krb5_includes)
16
+  if test "x$krb5_includes" != "xNO"; then
17
+    krb5_multiarch="`gcc -print-multiarch 2>/dev/null`"
18
+    AC_FIND_FILE(libkrb5.so, [\
19
+        /usr/local/lib/$krb5_multiarch/heimdal /usr/local/lib64/heimdal /usr/local/lib/heimdal \
20
+        /usr/local/lib/$krb5_multiarch /usr/local/lib64 /usr/local/lib \
21
+        /usr/lib/$krb5_multiarch/heimdal /usr/lib64/heimdal /usr/lib/heimdal \
22
+        /usr/lib/$krb5_multiarch /usr/lib64 /usr/lib \
23
+        ], krb5_libs)
24
+    if test "x$krb5_libs" != "xNO"; then
25
+      AC_MSG_RESULT([libraries $krb5_libs, headers $krb5_includes])
26
+      CPPFLAGS="$CPPFLAGS -I$krb5_includes"
27
+      CFLAGS="$CFLAGS -I$krb5_includes"
28
+      LDFLAGS="$LDFLAGS -L$krb5_libs"
29
+      AC_CHECK_HEADER(krb5.h, have_krb5=yes)
30
+    fi
31
+  fi
32
+  if test "x$have_krb5" != "xno"; then
33
+    KRB5_CFLAGS="-I$krb5_includes"
34
+    KRB5_LIBS="-L$krb5_libs -lkrb5"
35
+    AC_SUBST(KRB5_CFLAGS)
36
+    AC_SUBST(KRB5_LIBS)
37
+  else
38
+    AC_MSG_RESULT(no)
39
+  fi
40
+fi
41
+if test "x$have_krb5" = "xno"; then
42
+  AC_MSG_ERROR([krb5 library is needed but not found on our system])
43
+fi

+ 2
- 2
src/Makefile.am View File

@@ -1,4 +1,4 @@
1
-INCLUDES    = $(all_includes) $(KDE_INCLUDES)/tde
1
+INCLUDES    = $(all_includes) $(KDE_INCLUDES)/tde $(KRB5_CFLAGS)
2 2
 METASOURCES = AUTO
3 3
 
4 4
 # Install this plugin in the KDE modules directory
@@ -7,7 +7,7 @@ kde_module_LTLIBRARIES = kcm_ldapbonding.la
7 7
 kcm_ldapbonding_la_SOURCES = tdeumaskinput.cpp ldapbonding.cpp ldapconfigbase.ui realmpropertiesdialog.cpp bondintropage.cpp bondintropagedlg.ui bondrealmpage.cpp bondrealmpagedlg.ui bondfinishpage.cpp bondfinishpagedlg.ui bondwizard.cpp ldappasswddlg.cpp
8 8
 kcm_ldapbonding_la_LIBADD = $(LIB_TDEIO) $(LIB_TDEUI) -ltdeldap
9 9
 kcm_ldapbonding_la_LDFLAGS = -avoid-version -module -no-undefined \
10
-	$(all_libraries)
10
+	$(all_libraries) $(KRB5_LIBS)
11 11
 
12 12
 
13 13
 xdg_apps_DATA = ldapbonding.desktop

Loading…
Cancel
Save