svn rev #3277: trunk/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Nov 18 10:53:49 EST 2009


Commit By: ghudson
Log Message:
Simplify depfix.pl by removing all dependencies external to the source
and build tree (anything still beginning with a / after substitution).
Solves the problem of external krb5 headers showing up in the output.



Changed Files:
U   trunk/depfix.pl
U   trunk/post.in
Modified: trunk/depfix.pl
===================================================================
--- trunk/depfix.pl	2009-11-18 05:07:46 UTC (rev 3276)
+++ trunk/depfix.pl	2009-11-18 15:53:49 UTC (rev 3277)
@@ -27,7 +27,7 @@
   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 @@
 # 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($SRCTOP,$thisdir,$srcdir,$BUILDTOP,$libgccpath,$STLIBOBJS) = @ARGV;
+my($SRCTOP,$thisdir,$srcdir,$BUILDTOP,$STLIBOBJS) = @ARGV;
 
 if (0) {
     print STDERR "SRCTOP = $SRCTOP\n";
@@ -49,15 +48,8 @@
     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 @@
     } 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 $(SRCTOP) and variants.
     my($srct) = $SRCTOP . "/";
     $_ = strrep(" $srct", " \$(SRCTOP)/", $_);
@@ -140,14 +126,8 @@
     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;

Modified: trunk/post.in
===================================================================
--- trunk/post.in	2009-11-18 05:07:46 UTC (rev 3276)
+++ trunk/post.in	2009-11-18 15:53:49 UTC (rev 3277)
@@ -68,9 +68,8 @@
 # references in rules for non-library objects in a directory where
 # library objects happen to be built.  It's mostly harmless.
 .depend: .d $(SRCTOP)/depfix.pl
-	x=`$(CC) -print-libgcc-file-name` ; \
 	perl $(SRCTOP)/depfix.pl \
-		'$(SRCTOP)' '$(mydir)' '$(srcdir)' '$(BUILDTOP)' "$$x" '$(STLIBOBJS)' \
+		'$(SRCTOP)' '$(mydir)' '$(srcdir)' '$(BUILDTOP)' '$(STLIBOBJS)' \
 		< .d > .depend
 
 # Temporarily keep the rule for removing the dependency line eater




More information about the Krb5-appl-commits mailing list