Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/mk When handling ELF library symlinks, rather than rem...



details:   https://anonhg.NetBSD.org/src/rev/e401a6a32c74
branches:  trunk
changeset: 500123:e401a6a32c74
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Dec 05 22:12:37 2000 +0000

description:
When handling ELF library symlinks, rather than removing and recreating the
symlink, instead create a temporary one ending in `.tmp' and `mv -f' it.
This way there is no window where libc isn't loadable (and thus
`make -j 100 install' works for libc).

diffstat:

 share/mk/bsd.lib.mk |  20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diffs (43 lines):

diff -r 13d02106fb5b -r e401a6a32c74 share/mk/bsd.lib.mk
--- a/share/mk/bsd.lib.mk       Tue Dec 05 21:57:20 2000 +0000
+++ b/share/mk/bsd.lib.mk       Tue Dec 05 22:12:37 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.lib.mk,v 1.176 2000/08/09 23:41:24 gmcgarry Exp $
+#      $NetBSD: bsd.lib.mk,v 1.177 2000/12/05 22:12:37 mycroft Exp $
 #      @(#)bsd.lib.mk  8.3 (Berkeley) 4/22/94
 
 .if !target(__initialized__)
@@ -347,10 +347,10 @@
            ${SHLIB_LDENDFILE}
 .endif
 .if ${OBJECT_FMT} == "ELF"
-       rm -f lib${LIB}.so.${SHLIB_MAJOR}
-       ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}
-       rm -f lib${LIB}.so
-       ln -s lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so
+       ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.${SHLIB_MAJOR}.tmp
+       mv -f lib${LIB}.so.${SHLIB_MAJOR}.tmp lib${LIB}.so.${SHLIB_MAJOR}
+       ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} lib${LIB}.so.tmp
+       mv -f lib${LIB}.so.tmp lib${LIB}.so
 .endif
 
 LLIBS?=                -lc
@@ -440,12 +440,14 @@
        /sbin/ldconfig -m ${LIBDIR}
 .endif
 .if ${OBJECT_FMT} == "ELF"
-       rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
-       ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
+       ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} \
+           ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp
+       mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}.tmp \
            ${DESTDIR}${LIBDIR}/lib${LIB}.so.${SHLIB_MAJOR}
-       rm -f ${DESTDIR}${LIBDIR}/lib${LIB}.so
 .if ${MKLINKLIB} != "no"
-       ln -s lib${LIB}.so.${SHLIB_FULLVERSION} \
+       ln -sf lib${LIB}.so.${SHLIB_FULLVERSION} \
+           ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp
+       mv -f ${DESTDIR}${LIBDIR}/lib${LIB}.so.tmp \
            ${DESTDIR}${LIBDIR}/lib${LIB}.so
 .endif
 .endif



Home | Main Index | Thread Index | Old Index