Package: krb5 / 1.17-3

debian-local/0002-debian-Handle-multi-arch-paths-in-krb5-config.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 8cbb465da2e4ae37b8afd884910506422eadd0f8 Mon Sep 17 00:00:00 2001
From: Sam Hartman <hartmans@debian.org>
Date: Mon, 26 Dec 2011 18:19:53 -0500
Subject: debian: Handle multi-arch paths in krb5-config

We cannot use @libdir@ because that will include the
multi-arch prefix in the built krb5-config, but we want krb5-config to
be identical on all arches so that krb5-multidev can be multi-arch:
same.  So, instead, figure out our multi-arch tripple by calling CC
directly.

Based on an approach suggested by Hugh McMaster.

Also include --deps in the usage output, since it is a valid argument.

Patch-Category: debian-local
---
 src/build-tools/krb5-config.in | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/build-tools/krb5-config.in b/src/build-tools/krb5-config.in
index f6184da3fb..ac2f5827d3 100755
--- a/src/build-tools/krb5-config.in
+++ b/src/build-tools/krb5-config.in
@@ -26,11 +26,18 @@
 
 # Configurable parameters set by autoconf
 version_string="Kerberos 5 release @KRB5_VERSION@"
+CC=${CC-cc}
+tripple=`$CC -print-multiarch 2>/dev/null|| ( $CC -dumpmachine | sed 's/-pc//' )`
+if [ x$tripple = x ]; then
+    echo >&2 Failed to find installation architecture
+    exit 2
+fi
+
 
 prefix=@prefix@
 exec_prefix=@exec_prefix@
-includedir=@includedir@
-libdir=@libdir@
+includedir=@prefix@/include/mit-krb5
+libdir=@prefix@/lib/${tripple}/mit-krb5
 CC_LINK='@CC_LINK@'
 KDB5_DB_LIB=@KDB5_DB_LIB@
 LDFLAGS='@LDFLAGS@'
@@ -138,6 +145,7 @@ if test -n "$do_help"; then
     echo "        [--defktname]     Show built-in default keytab name"
     echo "        [--defcktname]    Show built-in default client keytab name"
     echo "        [--cflags]        Compile time CFLAGS"
+    echo "        [--deps]          Include dependent libraries"
     echo "        [--libs]          List libraries required to link [LIBRARIES]"
     echo "Libraries:"
     echo "        krb5              Kerberos 5 application"
@@ -208,12 +216,7 @@ fi
 
 
 if test -n "$do_libs"; then
-    # Assumes /usr/lib is the standard library directory everywhere...
-    if test "$libdir" = /usr/lib; then
-	libdirarg=
-    else
 	libdirarg="-L$libdir"
-    fi
     # Ugly gross hack for our build tree
     lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
 	    -e 's/\$(PURE)//' \