Date: Fri, 13 Jun 2025 20:58:13 GMT From: Olivier Certner <olce@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 1bdf1b818635 - main - config.5: Document CONF_CFLAGS under 'makeoptions' Message-ID: <202506132058.55DKwDQR087074@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1bdf1b8186359d4ea26e26de03e03b7c1543b707 commit 1bdf1b8186359d4ea26e26de03e03b7c1543b707 Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2025-05-27 07:41:19 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2025-06-13 20:57:51 +0000 config.5: Document CONF_CFLAGS under 'makeoptions' This variable serves to tweak CFLAGS from the kernel configuration file, easing some custom kernel builds. It was introduced by bde@ in 1999. The description has been kept simple on purpose. It does not completely reflect reality as the build infrastructure actually appends variables to CFLAGS after CONF_CFLAGS has been processed in a few cases. However, these cases do not collide with expected common uses of CONF_CFLAGS, so have not been mentioned. Reviewed by: markj (older version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50544 --- usr.sbin/config/config.5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index 93d65819d1d8..134afb17f9a4 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -316,11 +316,28 @@ variable is specified, .Ar value is assumed to be the empty string. .Pp +Note that, as the common makefiles overwrite the +.Va CFLAGS +variable after having processed the configuration file, +customizing +.Va CFLAGS +directly via +.Ic makeoptions +is not possible. +Nonetheless, custom compiler flags can be specified using the +.Va CONF_CFLAGS +variable instead. +Its content is appended to +.Va CFLAGS +after the common makefiles have set the latter, allowing to override their +compilation flags. +.Pp Example: .Bd -literal -offset indent -compact makeoptions MYMAKEOPTION="foo" makeoptions MYMAKEOPTION+="bar" makeoptions MYNULLMAKEOPTION +makeoptions CONF_CFLAGS+="-DSOME_CONTROLLING_MACRO" .Ed .\" -------- MAXUSERS -------- .Pp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506132058.55DKwDQR087074>