aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2018-06-29 16:07:56 +0000
committerBrooks Davis <brooks@FreeBSD.org>2018-06-29 16:07:56 +0000
commitfa8c921e3f372be81d07f7e2fb6f05186557a651 (patch)
tree94c8e8f1e0aec0698d2cb2b87b957bc995d53534
parent5b2b45a421e8c680b6381735ad7cf16263ebca43 (diff)
downloadsrc-fa8c921e3f372be81d07f7e2fb6f05186557a651.tar.gz
src-fa8c921e3f372be81d07f7e2fb6f05186557a651.zip
Notes
-rw-r--r--share/mk/bsd.README40
-rw-r--r--share/mk/bsd.lib.mk11
-rw-r--r--share/mk/bsd.man.mk2
-rw-r--r--share/mk/bsd.own.mk28
-rw-r--r--share/mk/bsd.prog.mk4
5 files changed, 78 insertions, 7 deletions
diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index 4e0a02dcbf41..471a146eb659 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -225,6 +225,24 @@ MANMODE Manual mode.
MANOWN Manual owner.
+INSTALL_LINK Command to install a hard link.
+
+INSTALL_SYMLINK Command to install a symbolic link.
+
+INSTALL_RSYMLINK Command to install a relative symbolic link.
+
+LINKOWN Owner of hard links created by INSTALL_LINK.
+
+LINKGRP Group of hard links created by INSTALL_LINK.
+
+LINKMODE Mode of hard links created by INSTALL_LINK.
+
+SYMLINKOWN Owner of hard links created by INSTALL_[R]SYMLINK.
+
+SYMLINKGRP Group of hard links created by INSTALL_[R]SYMLINK.
+
+SYMLINKMODE Mode of hard links created by INSTALL_[R]SYMLINK.
+
This file is generally useful when building your own Makefiles so that
they use the same default owners etc. as the rest of the tree.
@@ -320,6 +338,13 @@ LINKS The list of binary links; should be full pathnames, the
LINKS= /bin/test /bin/[
+LINKOWN Owner of links created with LINKS [${BINOWN}].
+
+LINKGRP Group of links created with LINKS [${BINGRP}].
+
+LINKMODE Mode of links created with LINKS [${BINMODE}].
+
+
MAN Manual pages. If no MAN variable is defined,
"MAN=${PROG}.1" is assumed. See bsd.man.mk for more details.
@@ -529,6 +554,21 @@ LIB_CXX The name of the library to build. It also causes
will be built. NO_PIC can be set to only build a static
library.
+LINKS The list of binary links; should be full pathnames, the
+ linked-to file coming first, followed by the linked
+ file. The files are hard-linked. For example, to link
+ /bin/test and /bin/[, use:
+
+ LINKS= /bin/test /bin/[
+
+LINKOWN Owner of links created with LINKS [${LIBOWN}].
+
+LINKGRP Group of links created with LINKS [${LIBGRP}].
+
+LINKMODE Mode of links created with LINKS [${LIBMODE}].
+
+LINTLIBDIR Target directory for lint libraries.
+
MAN The manual pages to be installed. See bsd.man.mk for more
details.
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index d8356ceb84ca..5f937d02a13d 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -275,7 +275,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
@${ECHO} building shared library ${SHLIB_NAME}
@rm -f ${SHLIB_NAME} ${SHLIB_LINK}
.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no"
- @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
+ @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
.endif
${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} \
@@ -291,7 +291,7 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \
${SHLIB_NAME_FULL} ${.TARGET}
.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld)
- @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
+ @${INSTALL_LIBSYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK}
.endif
${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
@@ -398,7 +398,7 @@ _libinstall:
${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
- ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
+ ${INSTALL_LIBSYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
.endfor
.else
.if ${_SHLIBDIR} == ${_LIBDIR}
@@ -437,6 +437,11 @@ _libinstall:
.include <bsd.confs.mk>
.endif
+LINKOWN?= ${LIBOWN}
+LINKGRP?= ${LIBGRP}
+LINKMODE?= ${LIBMODE}
+SYMLINKOWN?= ${LIBOWN}
+SYMLINKGRP?= ${LIBGRP}
.include <bsd.links.mk>
.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index eca01391b6f9..1e67928a2754 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -227,7 +227,7 @@ maninstall: ${MAN}
.endif
.for l t in ${_MANLINKS}
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \
- ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
+ ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.endfor
manlint:
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 644e54f1bceb..b76922ce466b 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -124,6 +124,18 @@
#
# PKG_CMD Program for creating and manipulating packages.
# [pkg]
+#
+# LINKOWN Hard link owner [${BINOWN}]
+#
+# LINKGRP Hard link group [${BINGRP}]
+#
+# LINKMODE Hard link mode [${NOBINMODE}]
+#
+# SYMLINKOWN Symbolic link owner [${BINOWN} or ${LIBOWN}]
+#
+# SYMLINKGRP Symbolic link group [${BINGRP} or ${LIBGRP}]
+#
+# SYMLINKMODE Symbolic link mode [755]
.if !target(__<bsd.own.mk>__)
__<bsd.own.mk>__:
@@ -217,12 +229,22 @@ INCLUDEDIR?= /usr/include
#
# install(1) parameters.
#
-HRDLINK?= -l h
-SYMLINK?= -l s
-RSYMLINK?= -l rs
+_LINKOWN?= ${LINKOWN:U${BINOWN}}
+_LINKGRP?= ${LINKGRP:U${BINGRP}}
+_LINKMODE?= ${LINKMODE:U${NOBINMODE}}
+_SYMLINKOWN?= ${SYMLINKOWN:U${BINOWN}}
+_SYMLINKGRP?= ${SYMLINKGRP:U${BINGRP}}
+_SYMLINKMODE?= ${SYMLINKMODE:U755}
+HRDLINK?= -l h -o ${_LINKOWN} -g ${_LINKGRP} -m ${_LINKMODE}
+MANHRDLINK?= -l h -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+SYMLINK?= -l s -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
+LSYMLINK?= -l s -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE}
+RSYMLINK?= -l rs -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
INSTALL_LINK?= ${INSTALL} ${HRDLINK}
+INSTALL_MANLINK?= ${INSTALL} ${MANHRDLINK}
INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
+INSTALL_LIBSYMLINK?= ${INSTALL} ${LSYMLINK}
INSTALL_RSYMLINK?= ${INSTALL} ${RSYMLINK}
# Common variables
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index c88742aff1e7..a0fdea5b01ab 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -285,6 +285,10 @@ NLSNAME?= ${PROG}
.include <bsd.confs.mk>
.include <bsd.files.mk>
.include <bsd.incs.mk>
+
+LINKOWN?= ${BINOWN}
+LINKGRP?= ${BINGRP}
+LINKMODE?= ${BINMODE}
.include <bsd.links.mk>
.if ${MK_MAN} != "no"