summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2001-09-01 04:06:44 +0000
committerKen Raeburn <raeburn@mit.edu>2001-09-01 04:06:44 +0000
commit0dd83f2cad522db21affaaadc0c97e0d7e2ffa93 (patch)
treea174d07a2aecad4355079638ec518b05ea1ecde5 /src
parent72d7904bdd87c02c0160809b2f1b19e607f7b4e3 (diff)
downloadkrb5-0dd83f2cad522db21affaaadc0c97e0d7e2ffa93.tar.gz
krb5-0dd83f2cad522db21affaaadc0c97e0d7e2ffa93.tar.xz
krb5-0dd83f2cad522db21affaaadc0c97e0d7e2ffa93.zip
* 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13718 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/config/ChangeLog7
-rw-r--r--src/config/post.in22
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