From: Greg Hudson Date: Mon, 23 Nov 2009 20:52:16 +0000 (+0000) Subject: Simplify depfix.pl by assuming that all files outside of the source X-Git-Tag: krb5-1.8-alpha1~157 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5761ae0613b4c2cf79c995bffd5421690575ca52;p=krb5.git Simplify depfix.pl by assuming that all files outside of the source and build directory (after substitutions) are external headers which should not be tracked. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23314 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/config/post.in b/src/config/post.in index d5d2967db..9c03e73f5 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -88,10 +88,8 @@ depend-dependencies: # references in rules for non-library objects in a directory where # library objects happen to be built. It's mostly harmless. .depend: .d $(top_srcdir)/util/depfix.pl - x=`$(CC) -print-libgcc-file-name` ; \ perl $(top_srcdir)/util/depfix.pl '$(top_srcdir)' '$(mydir)' \ - '$(srcdir)' '$(BUILDTOP)' "$$x" '$(STLIBOBJS)' \ - < .d > .depend + '$(srcdir)' '$(BUILDTOP)' '$(STLIBOBJS)' < .d > .depend # Temporarily keep the rule for removing the dependency line eater # until we're sure we've gotten everything converted and excised the diff --git a/src/util/depfix.pl b/src/util/depfix.pl index 835188586..4dec8879a 100644 --- a/src/util/depfix.pl +++ b/src/util/depfix.pl @@ -27,7 +27,7 @@ eval 'exec perl -S $0 ${1+"$@"}' if 0; $0 =~ s/^.*?(\w+)[\.\w+]*$/$1/; -# Input: srctop thisdir srcdir buildtop libgccfilename stlibobjs +# Input: srctop thisdir srcdir buildtop stlibobjs # Notes: myrelativedir is something like "lib/krb5/asn.1" or ".". # stlibobjs will usually be empty, or include spaces. @@ -38,10 +38,9 @@ $0 =~ s/^.*?(\w+)[\.\w+]*$/$1/; # thisdir = util/et # srcdir = ../../../util/et # BUILDTOP = ../.. -# libgcc file name = /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/libgcc.a # STLIBOBJS = error_message.o et_name.o com_err.o -my($top_srcdir,$thisdir,$srcdir,$BUILDTOP,$libgccpath,$STLIBOBJS) = @ARGV; +my($top_srcdir,$thisdir,$srcdir,$BUILDTOP,$STLIBOBJS) = @ARGV; if (0) { print STDERR "top_srcdir = $top_srcdir\n"; @@ -49,15 +48,8 @@ if (0) { print STDERR "STLIBOBJS = $STLIBOBJS\n"; } -$libgccincdir = $libgccpath; -$libgccincdir =~ s,libgcc\.[^ ]*$,include,; -$libgccincdir = quotemeta($libgccincdir); #$srcdirpat = quotemeta($srcdir); -# Tweak here if you need to ignore additional directories. -#my(@ignoredirs) = ( $libgccincdir, "/var/raeburn/openldap/Install/include" ); -my(@ignoredirs) = ( $libgccincdir ); - my($extrasuffixes) = ($STLIBOBJS ne ""); sub my_qm { @@ -100,12 +92,6 @@ sub do_subs { } else { s,^([a-zA-Z0-9_\-]*)\.o:,\$(OUTPRE)$1.\$(OBJEXT):,; } - # Drop GCC include files, they're basically system headers. - my ($x); - foreach $x (@ignoredirs) { - s,$x/[^ ]* ,,g; - s,$x/[^ ]*$,,g; - } # Recognize $(top_srcdir) and variants. my($srct) = $top_srcdir . "/"; $_ = strrep(" $srct", " \$(top_srcdir)/", $_); @@ -140,14 +126,8 @@ sub do_subs_2 { s/$/ /; # Remove excess spaces. s/ */ /g; - # Delete Tcl-specific headers. - s;/[^ ]*/tcl\.h ;;g; - s;/[^ ]*/tclDecls\.h ;;g; - s;/[^ ]*/tclPlatDecls\.h ;;g; - # Delete system-specific or compiler-specific files. - s;/os/usr/include/[^ ]* ;;g; - s;/usr/include/[^ ]* ;;g; - s;/usr/lib/[^ ]* ;;g; + # Delete headers external to the source and build tree. + s; /[^ ]*;;g; # Remove foo/../ sequences. while (m/\/[a-z][a-z0-9_.\-]*\/\.\.\//) { s//\//g;