Skip Menu |

Download (untitled) / with headers
text/plain 2.7KiB
From Fri Jan 11 11:09:30 2002
Received: from (FORT-POINT-STATION.MIT.EDU [])
by (8.9.3/8.9.3) with ESMTP id LAA09459
for <>; Fri, 11 Jan 2002 11:09:25 -0500 (EST)
Received: from ( [])
by (8.9.2/8.9.2) with ESMTP id LAA12452
for <>; Fri, 11 Jan 2002 11:09:24 -0500 (EST)
Received: from amu by with local (Exim 3.33 #1 (Debian))
id 16P4FA-0007Wu-00
for <>; Fri, 11 Jan 2002 11:09:24 -0500
Message-Id: <>
Date: Fri, 11 Jan 2002 11:09:24 -0500
Sender: "Aaron M. Ucko" <>
Subject: krb5-config --cflags can produce -I/usr/include
X-Send-Pr-Version: 3.99

Show quoted text
>Number: 1039
>Category: krb5-libs
>Synopsis: krb5-config --cflags can produce -I/usr/include
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: krb5-unassigned
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Fri Jan 11 11:10:00 EST 2002
>Originator: Aaron M. Ucko
Show quoted text
>Release: krb5-1.2.3
Debian/i386 pre-3.0; prefix=/usr
System: Linux tux 2.4.17 #1 SMP Wed Dec 26 20:54:33 EST 2001 i686 unknown
Architecture: i686

Show quoted text
If Kerberos is installed with a prefix of /usr,

krb5-config --cflags

produces "-I/usr/include". This is a problem on machines
which need GCC's fixincludes or the equivalent, because it
causes the original (broken) system headers to shadow the
fixed headers. There is an analogous issue with

krb5-config --libs

and -L/usr/lib; I don't know of a situation where the
redundant library directory is harmful, but it should probably
go away too.

Show quoted text
Install Kerberos in /usr and run krb5-config --cflags

Show quoted text
Here's a unified diff -b that should make krb5-config avoid
mentioning /usr/include and /usr/lib:

--- Wed Jan 9 17:26:46 2002
+++ Fri Jan 11 11:05:42 2002
@@ -162,16 +162,21 @@

-if test -n "$do_cflags"; then
+if test -n "$do_cflags" -a "x$includedir" != "x/usr/include"; then
echo "-I${includedir}"

if test -n "$do_libs"; then
# Ugly gross hack for our build tree
+ case "$libdir" in
+ /lib|/usr/lib) lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//'` ;;
+ *)
lib_flags=`echo $CC_LINK | sed -e 's/\$(CC)//' \
-e 's#\$(PROG_RPATH)#'$libdir'#' \
-e 's#\$(PROG_LIBPATH)#-L'$libdir'#'`
+ ;;
+ esac

if test $library = 'kdb'; then
lib_flags="$lib_flags -lkdb5 -ldb"
Show quoted text
Subject: krb5-config should never return -I/usr/include
Adding -I/usr/include to CFLAGS will cause recent gcc's to warn, which
can confuse configure scripts. Worse, it reorders gcc's header search
path in a way that can potentially break things (by searching the system
include files before gcc's own overrides, for instance).

The attached patch changes krb5-config to never return -I/usr/include by
checking includedir against /usr/include before responding to --cflags.
This is the same approach taken by the *-config scripts of many other
Download krb5.diff
text/x-patch 386B
Index: src/
--- src/ (revision 1789)
+++ src/ (working copy)
@@ -165,7 +165,11 @@

if test -n "$do_cflags"; then
- echo "-I${includedir}"
+ if test x"$includedir" != x"/usr/include" ; then
+ echo "-I${includedir}"
+ else
+ echo ''
+ fi

From: Russ Allbery <>
Subject: CVS Commit
Never return -I/usr/include from --cflags. It's already in the default
compiler search path, causes gcc warnings, and can cause obscure failures
with gcc by including system headers before gcc's internal headers.

Commit By: rra

Revision: 18116
Changed Files:
U trunk/src/