summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config/ChangeLog2
-rw-r--r--src/config/post.in3
-rw-r--r--src/util/ChangeLog5
-rw-r--r--src/util/depfix.sed67
-rw-r--r--src/util/depfix2.pl62
5 files changed, 69 insertions, 70 deletions
diff --git a/src/config/ChangeLog b/src/config/ChangeLog
index c30b6896d3..1faba7cdb5 100644
--- a/src/config/ChangeLog
+++ b/src/config/ChangeLog
@@ -1,5 +1,7 @@
2005-10-27 Ken Raeburn <raeburn@mit.edu>
+ * post.in (.depend): Don't run sed, just use perl.
+
* shlib.conf: Set DYNOBJ_EXPDEPS and DYNOBJ_EXPFLAGS.
(*-*-darwin*): Change MAKE_DYNOBJ_COMMAND definition to use
DYNOBJ_EXPFLAGS and DYNOBJ_LOADER_PROG instead of SHLIB_EXPFLAGS
diff --git a/src/config/post.in b/src/config/post.in
index 457449b18e..76cf59910a 100644
--- a/src/config/post.in
+++ b/src/config/post.in
@@ -86,8 +86,7 @@ depend-dependencies:
x=`$(CC) -print-libgcc-file-name` ; \
perl $(SRCTOP)/util/depfix2.pl \
'$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' "$$x" '$(STLIBOBJS)' \
- < .d | sed -f $(SRCTOP)/util/depfix.sed | \
- sed -e '/^$$/d' > .depend
+ < .d > .depend
depend-update-makefile: .depend depend-recurse
if test -n "$(SRCS)" ; then \
diff --git a/src/util/ChangeLog b/src/util/ChangeLog
index 432fa5f988..3f1f287d35 100644
--- a/src/util/ChangeLog
+++ b/src/util/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-27 Ken Raeburn <raeburn@mit.edu>
+
+ * depfix2.pl: Incorporate all substitutions from depfix.sed.
+ * depfix.sed: Deleted.
+
2005-10-25 Tom Yu <tlyu@mit.edu>
* ac_check_krb5.m4: Set LIBS rather than LDFLAGS.
diff --git a/src/util/depfix.sed b/src/util/depfix.sed
deleted file mode 100644
index 1db3b0c869..0000000000
--- a/src/util/depfix.sed
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# Insert the header.....
-#
-1i\
-# +++ Dependency line eater +++\
-# \
-# Makefile dependencies follow. This must be the last section in\
-# the Makefile.in file\
-#
-
-#
-# Remove line continuations....
-#
-:FIRST
-y/ / /
-s/^ *//
-/\\$/{
-N
-y/ / /
-s/\\\n */ /
-bFIRST
-}
-# for simplicity, always have a trailing space
-s/$/ /
-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 from list
-s;/os/usr/include/[^ ]* ;;g
-s;/usr/include/[^ ]* ;;g
-s;/usr/lib/[^ ]* ;;g
-
-# remove foo/../ sequences
-:dotdot
-/\/[a-z][a-z0-9_.\-]*\/\.\.\// {
-s;/[a-z][a-z0-9_.\-]*/\.\./;/;g
-bdotdot
-}
-
-# rely on VPATH for $(srcdir) files
-s;\$(srcdir)/\([^ /]* \);\1;g
-
-# allow override of some util dependencies in case local tools are used
-s;\$(BUILDTOP)/include/com_err.h ;$(COM_ERR_DEPS) ;g
-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
-
-# Some krb4 dependencies should only be present if building with krb4 enabled
-s;\$(BUILDTOP)/include/kerberosIV/krb_err.h ;$(KRB_ERR_H_DEP) ;g
-
-# now delete trailing whitespace
-s; *$;;g
-
-# Split lines if they're too long.
-s/\(.\{50\}[^ ]*\) /\1 \\\
- /g
-
-
-#
-# Now insert a trailing newline...
-#
-$a\
-
diff --git a/src/util/depfix2.pl b/src/util/depfix2.pl
index 0e11b0fde0..b17bf9fc20 100644
--- a/src/util/depfix2.pl
+++ b/src/util/depfix2.pl
@@ -101,8 +101,68 @@ sub do_subs {
return $_;
}
+sub do_subs_2 {
+ local($_) = @_;
+ # Add a trailing space.
+ 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;
+ # Remove foo/../ sequences.
+ while (m/\/[a-z][a-z0-9_.\-]*\/\.\.\//) {
+ s//\//g;
+ }
+ # Use VPATH.
+ s;\$\(srcdir\)/([^ /]* );$1;g;
+
+ # Allow override of some util dependencies in case local tools are used.
+ s;\$\(BUILDTOP\)/include/com_err.h ;\$(COM_ERR_DEPS) ;g;
+ 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;
+
+ # Some krb4 dependencies should only be present if building with krb4
+ # enabled.
+ s;\$\(BUILDTOP\)/include/kerberosIV/krb_err.h ;\$(KRB_ERR_H_DEP) ;g;
+
+ # Delete trailing whitespace.
+ s; *$;;g;
+
+ return $_;
+}
+
+sub split_lines {
+ local($_) = @_;
+ s/(.{50}[^ ]*) /$1 \\\n /g;
+ return $_ . "\n";
+}
+
+print <<EOH ;
+# +++ Dependency line eater +++
+#
+# Makefile dependencies follow. This must be the last section in
+# the Makefile.in file
+#
+EOH
+my $buf = '';
while (<STDIN>) {
+ # Strip newline.
chop;
- print &do_subs($_), "\n";
+ # Do directory-specific path substitutions on each filename read.
+ $_ = &do_subs($_);
+ if (m/\\$/) {
+ chop;
+ $buf .= $_;
+ } else {
+ $buf = &do_subs_2($buf . $_);
+ print &split_lines($buf);
+ $buf = '';
+ }
}
exit 0;