Replace all known uses of ln in the build process with appropriate

install -l invocations via new INSTALL_LINK and INSTALL_SYMLINK
variables.

Sponsored by:	DARPA, AFRL
Reviewed by:	ian, ray, rpaulo
This commit is contained in:
Brooks Davis 2013-01-21 22:40:39 +00:00
parent aaea79704b
commit 12dd8cb14c
7 changed files with 28 additions and 16 deletions

View File

@ -324,26 +324,29 @@ distrib-dirs:
-f $$m -p $$d; \
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
done; true
ln -sfh usr/src/sys ${DESTDIR}/sys
${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
cd ${DESTDIR}/usr/share/man; \
for mandir in man*; do \
ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
ln -sfh ../$$mandir ${DESTDIR}/usr/share/man/en.UTF-8/; \
${INSTALL_SYMLINK} ../$$mandir \
${DESTDIR}/usr/share/man/en.ISO8859-1/; \
${INSTALL_SYMLINK} ../$$mandir \
${DESTDIR}/usr/share/man/en.UTF-8/; \
done
cd ${DESTDIR}/usr/share/openssl/man; \
for mandir in man*; do \
ln -sfh ../$$mandir \
${INSTALL_SYMLINK} ../$$mandir \
${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
done
set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
while [ $$# -gt 0 ] ; do \
ln -sfh "$$2" "${DESTDIR}/usr/share/man/$$1"; \
ln -sfh "$$2" "${DESTDIR}/usr/share/openssl/man/$$1"; \
${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
${INSTALL_SYMLINK} "$$2" \
"${DESTDIR}/usr/share/openssl/man/$$1"; \
shift; shift; \
done
set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
while [ $$# -gt 0 ] ; do \
ln -sfh "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
shift; shift; \
done

View File

@ -73,7 +73,7 @@ installincludes:
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
ln -fs $$l $$t; \
${INSTALL_SYMLINK} $$l $$t; \
done; true
.endif
.endif # !target(installincludes)

View File

@ -113,7 +113,7 @@ DVIPS2ASCII?= dvips2ascii
.info.html:
${INFO2HTML} ${.IMPSRC}
ln -f ${.TARGET:R}.info.Top.html ${.TARGET}
${INSTALL_LINK} ${.TARGET:R}.info.Top.html ${.TARGET}
.PATH: ${.CURDIR} ${SRCDIR}

View File

@ -184,7 +184,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
@${ECHO} building shared library ${SHLIB_NAME}
@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
.if defined(SHLIB_LINK)
@ln -fs ${SHLIB_NAME} ${SHLIB_LINK}
@${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK}
.endif
.if !defined(NM)
@${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
@ -309,9 +309,9 @@ _libinstall:
${_INSTALLFLAGS} lib${LIB}.ld ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
.else
.if ${SHLIBDIR} == ${LIBDIR}
ln -fs ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
${INSTALL_SYMLINK} ${SHLIB_NAME} ${DESTDIR}${LIBDIR}/${SHLIB_LINK}
.else
ln -fs ${_SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \
${INSTALL_SYMLINK} ${_SHLIBDIRPREFIX}${SHLIBDIR}/${SHLIB_NAME} \
${DESTDIR}${LIBDIR}/${SHLIB_LINK}
.if exists(${DESTDIR}${LIBDIR}/${SHLIB_NAME})
-chflags noschg ${DESTDIR}${LIBDIR}/${SHLIB_NAME}

View File

@ -15,7 +15,7 @@ _installlinks:
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
ln -f $$l $$t; \
${INSTALL_LINK} $$l $$t; \
done; true
.endif
.if defined(SYMLINKS) && !empty(SYMLINKS)
@ -26,6 +26,6 @@ _installlinks:
t=${DESTDIR}$$1; \
shift; \
${ECHO} $$t -\> $$l; \
ln -fs $$l $$t; \
${INSTALL_SYMLINK} $$l $$t; \
done; true
.endif

View File

@ -216,7 +216,7 @@ _maninstall: ${MAN}
t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \
done
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
@set ${MLINKS:C/\.([^.]*)$/.\1 \1/}; \
@ -231,7 +231,7 @@ _maninstall: ${MAN}
t=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
ln $${l}${ZEXT} $${t}${ZEXT}; \
${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \
done
.endif
.endif

View File

@ -181,6 +181,15 @@ NLSMODE?= ${NOBINMODE}
INCLUDEDIR?= /usr/include
#
# install(1) parameters.
#
HRDLINK?= -l h
SYMLINK?= -l s
INSTALL_LINK?= ${INSTALL} ${HRDLINK}
INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
# Common variables
.if !defined(DEBUG_FLAGS)
STRIP?= -s