summaryrefslogtreecommitdiff
path: root/share/mk/bsd.obj.mk
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-10 10:39:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-10 10:39:40 +0000
commit5776ce82f92d17b6c72e7054bbb11ec8f3396afe (patch)
tree7eda01e71ad4f5c7d35a7248fa851e04ad60ea3a /share/mk/bsd.obj.mk
parenteaefca0a509d6924ec863203463bad280c8e94c1 (diff)
if generating obj@ links, check if the existing obj@ link points to the
same path we want to make it point to later. If it does, leave the link as-is and do not attempt to recreate it. read-only /usr/src with obj@ links will work much better with this. Fix from Niklas -- anyone who figures out a way to do this without using perl gets a cookie.
Diffstat (limited to 'share/mk/bsd.obj.mk')
-rw-r--r--share/mk/bsd.obj.mk10
1 files changed, 7 insertions, 3 deletions
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk
index 1a65ba386e7..dc6e6cd9e2a 100644
--- a/share/mk/bsd.obj.mk
+++ b/share/mk/bsd.obj.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.obj.mk,v 1.5 1996/08/23 22:42:41 niklas Exp $
+# $OpenBSD: bsd.obj.mk,v 1.6 1997/04/10 10:39:39 deraadt Exp $
# $NetBSD: bsd.obj.mk,v 1.9 1996/04/10 21:08:05 thorpej Exp $
.if !target(obj)
@@ -36,8 +36,12 @@ obj! _SUBDIRUSE
if test $$here != $$subdir ; then \
dest=${__usrobjdir}/$$subdir${__usrobjdirpf} ; \
echo "$$here/${__objdir} -> $$dest"; \
- rm -rf ${__objdir}; \
- ln -s $$dest ${__objdir}; \
+ if test ! -L ${__objdir} -o \
+ X`perl -e "print readlink('${__objdir}')"` != X$$dest; \
+ then \
+ test -e ${__objdir} && rm -rf ${__objdir}; \
+ ln -s $$dest ${__objdir}; \
+ fi; \
if test -d ${__usrobjdir} -a ! -d $$dest; then \
mkdir -p $$dest; \
else \