diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config/ChangeLog | 7 | ||||
-rw-r--r-- | src/config/post.in | 22 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/config/ChangeLog b/src/config/ChangeLog index 1471def05e..beb6138fcf 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,3 +1,10 @@ +2001-09-01 Ken Raeburn <raeburn@mit.edu> + + * post.in (.depend): Refuse to do anything if srcdir is ".". Find + a shortcut name for SRCTOP to eliminate "foo/.." subsequences, in + case the compiler does the same. Run depfix.sed after the + directory-specific substitutions, not before. + 2001-08-07 Ezra Peisach <epeisach@mit.edu> * post.in (all-recurse clean-recurse distclean-recurse diff --git a/src/config/post.in b/src/config/post.in index e0ea7213da..9e27de8206 100644 --- a/src/config/post.in +++ b/src/config/post.in @@ -3,13 +3,25 @@ check-windows:: .depend: $(SRCS) $(SRCTOP)/util/depfix.sed + if test "$(srcdir)" = "." ; then \ + echo 1>&2 error: cannot build dependencies with srcdir=. ; \ + echo 1>&2 "(can't distinguish generated files from source files)" ; \ + exit 1 ; \ + fi if test -n "$(SRCS)" ; then \ + r="$(SRCTOP)" ; oldr=hello ; \ + while test "$$r" != "$$oldr" ; do \ + oldr="$$r" ; \ + r=`echo "$$oldr" | sed -e 's;/[a-z][a-z0-9_\-]*/../;/;g' -e 's;/[a-z][a-z0-9_\-]*/..$$;;g'` ; \ + done ; \ $(CC) -M $(ALL_CFLAGS) $(SRCS) | \ - sed -f $(SRCTOP)/util/depfix.sed | \ - sed -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' | \ - sed -e 's; $(srcdir)/; $$(srcdir)/;g' | \ - sed -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \ - sed -e 's; \./; ;g' > .depend; \ + sed -e 's; \./; ;g' \ + -e "s; $$r/"'; $$(SRCTOP)/;g' \ + -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' \ + -e 's; $(srcdir)/; $$(srcdir)/;g' \ + -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \ + sed -f $(SRCTOP)/util/depfix.sed \ + > .depend; \ else :; fi depend:: .depend |