From: Ken Raeburn Date: Thu, 22 Dec 2005 05:08:11 +0000 (+0000) Subject: Looks like the current Red Hat gcc on Athena emits duplicates and "./foo.h", X-Git-Tag: ms-bug-test-20060525~30 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a2a85a79776e323461cfd6a0b60bd9c9bdd33c3f;p=krb5.git Looks like the current Red Hat gcc on Athena emits duplicates and "./foo.h", neither of which we've properly addressed before. * depfix.pl (uniquify): New subroutine. (do_subs_2): Use it. (do_subs): Fix substitution pattern for " ./". git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17573 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/ChangeLog b/src/util/ChangeLog index c3f031cef..a306f5d92 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,9 @@ +2005-12-22 Ken Raeburn + + * depfix.pl (uniquify): New subroutine. + (do_subs_2): Use it. + (do_subs): Fix substitution pattern for " ./". + 2005-11-03 Tom Yu * mkrel: Delete .svn directories to avoid pathname length bloat. diff --git a/src/util/depfix.pl b/src/util/depfix.pl index b17bf9fc2..09a15dd57 100644 --- a/src/util/depfix.pl +++ b/src/util/depfix.pl @@ -62,7 +62,7 @@ sub strrep { sub do_subs { local($_) = @_; s,\\$, \\,g; s, + \\$, \\,g; - s,//+,/,g; s, \\./, ,g; + s,//+,/,g; s, \./, ,g; if ($STLIBOBJS ne "") { # Only care about the additional prefixes if we're building # shared libraries. @@ -127,6 +127,8 @@ sub do_subs_2 { s;\$\(BUILDTOP\)/include/ss/ss.h \$\(BUILDTOP\)/include/ss/ss_err.h ;\$(SS_DEPS) ;g; s;\$\(BUILDTOP\)/include/db.h \$\(BUILDTOP\)/include/db-config.h ;\$(DB_DEPS) ;g; + $_ = &uniquify($_); + # Some krb4 dependencies should only be present if building with krb4 # enabled. s;\$\(BUILDTOP\)/include/kerberosIV/krb_err.h ;\$(KRB_ERR_H_DEP) ;g; @@ -137,6 +139,25 @@ sub do_subs_2 { return $_; } +sub uniquify { + # Apparently some versions of gcc -- like + # "gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)" + # -- will sometimes emit duplicate header file names. + local($_) = @_; + my(@words) = split " ", $_; + my($w); + my($result) = ""; + my(%seen); + undef %seen; + foreach $w (@words) { + next if defined($seen{$w}); + $seen{$w} = 1; + if ($result ne "") { $result .= " "; } + $result .= $w; + } + return $result . " "; +} + sub split_lines { local($_) = @_; s/(.{50}[^ ]*) /$1 \\\n /g;