bsd.compat.mk Extract _ALL_LIBCOMPATS and add related variables

Adding these to a new bsd.compat.pre.mk will allow other parts of the
tree to iterate over the set of possible libcompats (upper and/or lower)
rather than having to hard-code the list.

Reviewed by:	brooks, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D41178
This commit is contained in:
Jessica Clarke 2023-07-27 05:10:43 +01:00
parent e3ba0d6add
commit 5d6cb793d0
2 changed files with 14 additions and 1 deletions

View File

@ -3,7 +3,7 @@
.if !targets(__<${_this:T}>__)
__<${_this:T}>__:
_ALL_LIBCOMPATS:= 32
.include <bsd.compat.pre.mk>
.if defined(_LIBCOMPATS)
COMPAT_ARCH?= ${TARGET_ARCH}

View File

@ -0,0 +1,13 @@
.if !targets(__<${_this:T}>__)
__<${_this:T}>__:
_ALL_LIBCOMPATS:= 32
_ALL_libcompats:= ${_ALL_LIBCOMPATS:tl}
# List of LIBCOMPAT libcompat pairs to avoid repeating this ugly expression.
# Can be used as: .for LIBCOMPAT libcompat in ${_ALL_LIBCOMPATS_libcompats}
_ALL_LIBCOMPATS_libcompats:= \
${_ALL_LIBCOMPATS:range:@i@${_ALL_LIBCOMPATS:[$i]} ${_ALL_libcompats:[$i]}@}
.endif