Skip Menu |
 

Download (untitled) / with headers
text/plain 2.7KiB
From amu@ucko.debian.net Fri Jan 11 11:09:30 2002
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76])
by rt-11.mit.edu (8.9.3/8.9.3) with ESMTP id LAA09459
for <bugs@RT-11.mit.edu>; Fri, 11 Jan 2002 11:09:25 -0500 (EST)
Received: from tux.internal.ucko.debian.net (pool-138-88-107-173.res.east.verizon.net [138.88.107.173])
by fort-point-station.mit.edu (8.9.2/8.9.2) with ESMTP id LAA12452
for <krb5-bugs@mit.edu>; Fri, 11 Jan 2002 11:09:24 -0500 (EST)
Received: from amu by tux.internal.ucko.debian.net with local (Exim 3.33 #1 (Debian))
id 16P4FA-0007Wu-00
for <krb5-bugs@mit.edu>; Fri, 11 Jan 2002 11:09:24 -0500
Message-Id: <E16P4FA-0007Wu-00@tux.internal.ucko.debian.net>
Date: Fri, 11 Jan 2002 11:09:24 -0500
From: amu@alum.mit.edu
Sender: "Aaron M. Ucko" <amu@ucko.debian.net>
To: krb5-bugs@mit.edu
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
>Last-Modified:
>Originator: Aaron M. Ucko
>Organization:
individual
Show quoted text
>Release: krb5-1.2.3
>Environment:
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
>Description:
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
>How-To-Repeat:
Install Kerberos in /usr and run krb5-config --cflags

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

--- krb5-config.in.dist Wed Jan 9 17:26:46 2002
+++ krb5-config.in Fri Jan 11 11:05:42 2002
@@ -162,16 +162,21 @@
$all_exit
fi

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


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
>Audit-Trail:
>Unformatted:
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
packages.
Download krb5.diff
text/x-patch 386B
Index: src/krb5-config.in
===================================================================
--- src/krb5-config.in (revision 1789)
+++ src/krb5-config.in (working copy)
@@ -165,7 +165,11 @@
fi

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


From: Russ Allbery <rra@stanford.edu>
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/krb5-config.in