# directory-specific parameters. General substitutions independent of local
# make variables happen in depfix.sed.
depfix2.sed: Makefile $(SRCTOP)/util/depgen.sed
- echo '# automatically generated, do not edit' > depfix2.tmp
- echo 's;///*;/;g' >> depfix2.tmp
- echo 's; \./; ;g' >> depfix2.tmp
- echo 's; $(SRCTOP)/; $$(SRCTOP)/;g' >> depfix2.tmp
- echo 's; $(srcdir)/; $$(srcdir)/;g' >> depfix2.tmp
- echo 's; $$(srcdir)/\.\./; $(srcdir)/../;g' >> depfix2.tmp
- echo '$(SRCTOP)' '$(myfulldir)' | sed -f $(SRCTOP)/util/depgen.sed >> depfix2.tmp
- echo 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' >> depfix2.tmp
+ echo '$(SRCTOP)' '$(myfulldir)' '$(srcdir)' '$(BUILDTOP)' | sed -f $(SRCTOP)/util/depgen.sed > depfix2.tmp
mv -f depfix2.tmp depfix2.sed
DEPLIBOBJNAMEFIX = sed -e 's;^\$$(OUTPRE)\([a-zA-Z0-9_\-]*\)\.\$$(OBJEXT):;\1.so \1.po &;'
+2002-09-10 Ken Raeburn <raeburn@mit.edu>
+
+ * depgen.sed: Now expects four values passed in; generates
+ complete sed script, with quoting for ".." in pathnames.
+
2002-09-03 Ken Raeburn <raeburn@mit.edu>
* reconf: Give up if autoreconf fails.
-# input srctop myfulldir
+# input srctop myfulldir srcdir buildtop
# something like ../../../../asrc/lib/krb5/asn.1/../../../ lib/krb5/asn.1
#
# output a sequence of sed commands for recognizing and replacing srctop,
# s; $(SRCTOP)/lib/krb5/; $(srcdir)/../;g
# ...
+# Output some mostly-fixed patterns first
+h
+s|^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$|# This file is automatically generated by depgen.sed, do not edit it.\
+#\
+# Parameters used to generate this instance:\
+#\
+# SRCTOP = \1\
+# thisdir = \2\
+# srcdir = \3\
+# BUILDTOP = \4\
+#\
+\
+# First, remove redundant leading "//" and "./" ...\
+s;///*;/;g\
+s; \\./; ;g\
+\
+# Recognize $(SRCTOP) and make it a variable reference.\
+# (Is this step needed, given the substitutions below?)|p
+x
+
+h
+s/ .*$//
+s,\.,\\.,g
+s,^,s; ,
+s,$,/; $(SRCTOP)/;g,
+p
+x
+
+# now recognize $(srcdir) and make it a variable reference
+# too, unless followed by "/../"
+h
+s/^[^ ]* [^ ]* //
+s/[^ ]*$//
+s/\./\\./g
+s|^\(.*\)$|\
+# Now make $(srcdir) variable references, unless followed by "/../".\
+s; \1/; $(srcdir);g\
+s; $(srcdir)/\.\./; \1/../;\
+\
+# Recognize variants of $(SRCTOP).|p
+x
+
# just process first "word"
h
s/ .*$//
}
p
+x
+h
+s|^.*$|\
+# Now try to produce pathnames relative to $(srcdir).|
+p
+
# now process second "word"
x
-s/^.* //
+h
+s/^[^ ]* //
+s/ [^ ]* [^ ]*$//
# treat "." specially
/^\.$/{
p
# strip trailing dirname off first part; append "../" to second part
s,/[a-z][a-zA-Z0-9_.\-]*/; ,/; ,
-s,/;g,/../;g,
+s,/;g,/\.\./;g,
bloop2
}
+
+x
+s/^[^ ]* [^ ]* [^ ]* //
+s/\./\\./g
+s|\(^.*$\)|\
+# Now substitute for BUILDTOP:\
+s; \1/; $(BUILDTOP)/;g|
+p
+
# kill implicit print at end; don't change $(SRCTOP) into .. sequence
-d
+s/^.*$/\
+# end of sed code generated by depgen.sed/