Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/usr.bin/config



Module Name:    src
Committed By:   thorpej
Date:           Thu Jan 18 04:41:38 UTC 2024

Modified Files:
        src/usr.bin/config: config.5 defs.h gram.y main.c mkmakefile.c scan.l
            util.c

Log Message:
With config(1) as it exists today, a kernel Makefile is able to implement
logic on kernel options so long as those options are not defflag'd or
defparam'd.  This works because such options are automatally added to the
IDENT var in the kernel Makefile as a preprocessor define, and the Makefile
can then do an operation like:

.if !empty(IDENT:M-DSOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif

Unfortunately, this precludes making it possible to generate a compile-time
dependency on SOMECOOLCPUOPTION, or having SOMECOOLCPUOPTION imply another
kernel config option using the normal config(1) option dependency function.

Fix this by introducing a new option description keyword: mkflagvar.  This
keyword marks an already defflag'd option as wanting a kernel Makefile var
defined if that option is selected in the kernel config file.  So:

defflag opt_coolcpu.h SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION
mkflagvar SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION

will cause:

KERNEL_OPT_SOMECOOLCPUOPTION="1"
KERNEL_OPT_ANOTHERCOOLCPUOPTION="1"

...to be emitted into the kernel Makefile if those options are, in fact,
selected with "options ..." in the kernel config file, thus allowing for
a compile-time dependency on the option to be generated in addition to
Makefile logic, which now looks like:

.if !empty(KERNEL_OPT_SOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/config/config.5
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/config/defs.h
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/config/gram.y
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/config/main.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/config/mkmakefile.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/config/scan.l
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/config/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index