Page MenuHomeFreeBSD

bsd.compat.mk: Provide new CPP and sub-make variables
ClosedPublic

Authored by jrtc27 on Jul 7 2023, 11:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 17, 6:00 PM
Unknown Object (File)
Fri, May 17, 6:00 PM
Unknown Object (File)
Fri, May 17, 6:00 PM
Unknown Object (File)
Thu, May 16, 1:04 AM
Unknown Object (File)
Sun, May 12, 7:06 AM
Unknown Object (File)
Mon, May 6, 4:30 PM
Unknown Object (File)
Fri, Apr 26, 1:55 AM
Unknown Object (File)
Mar 6 2024, 8:37 PM
Subscribers

Details

Summary

Currently the only way to detect for a libcompat build is to consult
whether COMPAT_32BIT is defined (or equivalent, for downstreams with
other libcompats or past releases with libsoft as COMPAT_SOFTFP). There
are two issues with this:

  1. COMPAT_32BIT is a new naming scheme that doesn't match the libcompat name, which is unnecessary deviation.
  2. When multiple libcompats exist, everywhere that needs to detect a libcompat must check each variable in turn, despite the fact that it normally just wants to know if this is a libcompat build and perhaps what ${LIBCOMPAT} and/or ${libcompat} are for it.

As a result, far too many places in the tree need to know about the set
of possible libcompats.

Instead, introduce two new CPP and sub-make variables, COMPAT_LIBCOMPAT
and COMPAT_libcompat, which give the values for ${LIBCOMPAT} and
${libcompat} respectively, so that uses can be made parameterised. For
when code really does need to know the specific libcompat, Makefiles can
perform a string comparison, but the C preprocessor cannot, so introduce
an additional CPP-only COMPAT_LIB${LIBCOMPAT} which is intended to
replace the inconsistently-named COMPAT_32BIT (which will be removed in
future). Uses of this new variable should still be kept to a minimum,
however, given the code duplication needed for new libcompats.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 8 2023, 12:41 AM