Module Name: src
Committed By: riastradh
Date: Fri Jun 28 21:58:24 UTC 2024
Modified Files:
src/share/mk: bsd.README bsd.lib.mk
Log Message:
bsd.lib.mk: Resolve VERSION_MAP like a target prerequisite.
Not sure what I did before to make ${${VERSION_MAP}:P} fail to work;
can't reproduce it any more!
PR lib/58376
To generate a diff of this commit:
cvs rdiff -u -r1.448 -r1.449 src/share/mk/bsd.README
cvs rdiff -u -r1.406 -r1.407 src/share/mk/bsd.lib.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.448 src/share/mk/bsd.README:1.449
--- src/share/mk/bsd.README:1.448 Fri Jun 28 20:45:26 2024
+++ src/share/mk/bsd.README Fri Jun 28 21:58:24 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.README,v 1.448 2024/06/28 20:45:26 riastradh Exp $
+# $NetBSD: bsd.README,v 1.449 2024/06/28 21:58:24 riastradh Exp $
# @(#)bsd.README 8.2 (Berkeley) 4/2/94
This is the README file for the make "include" files for the NetBSD
@@ -1014,11 +1014,8 @@ LIB_EXPSYM File listing all symbols expe
from the actual ones with `make update-symbols'.
VERSION_MAP Path to an ld version script to use when linking the
- library. If a relative path, interpreted relative to
- the object directory; use ${.CURDIR}/foo.map if foo.map
- is in the source directory. Interpretation of relative
- path may be changed later to search .PATH like target
- prerequisites.
+ library. Resolved from .PATH like a target
+ prerequisite.
The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.406 src/share/mk/bsd.lib.mk:1.407
--- src/share/mk/bsd.lib.mk:1.406 Fri Jun 28 20:45:26 2024
+++ src/share/mk/bsd.lib.mk Fri Jun 28 21:58:24 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.lib.mk,v 1.406 2024/06/28 20:45:26 riastradh Exp $
+# $NetBSD: bsd.lib.mk,v 1.407 2024/06/28 21:58:24 riastradh Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.include <bsd.init.mk>
@@ -615,36 +615,15 @@ LIBCC:= ${CC}
# VERSION_MAP
#
# Path to an ld version script to use when linking the library.
-# If a relative path, interpreted relative to the object
-# directory; use ${.CURDIR}/foo.map if foo.map is in the source
-# directory. Interpretation of relative path may be changed
-# later to search .PATH like target prerequisites.
+# Resolved from .PATH like a target prerequisite.
#
-# Implemented by adding -Wl,--version-script=${VERSION_MAP} to
-# LDFLAGS.
+# Implemented by adding -Wl,--version-script=${${VERSION_MAP}:P}
+# to LDFLAGS, and by adding ${VERSION_MAP} to DPADD to make it a
+# target prerequisite so :P works.
#
.if !empty(VERSION_MAP)
-# It is tempting to use the make :P modifier here so that you can just
-# write
-#
-# VERSION_MAP= foo.map
-#
-# instead of
-#
-# VERSION_MAP= ${.CURDIR}/foo.map
-#
-# but it appears that :P works _only_ with literal names, not with
-# expansions, so while you could write
-#
-# VERSION_MAP= ${foo.map:P}
-#
-# in the makefile, we can't set
-#
-# LDFLAGS+= -Wl,--version-script=${${VERSION_MAP}:P}
-#
-# here.
DPADD+= ${VERSION_MAP}
-LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
+LDFLAGS+= -Wl,--version-script=${${VERSION_MAP}:P}
.endif
_LDADD.${_LIB}= ${LDADD} ${LDADD.${_LIB}}