Home | History | Annotate | Download | only in config
History log of /src/usr.bin/config/util.c
RevisionDateAuthorComments
 1.23  07-Jan-2025  joe clear: trailing whitespaces
 1.22  18-Jan-2024  thorpej 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
 1.21  07-Mar-2020  christos Keep track where more objects are declared so that we can print where things
have been redefined.
 1.20  01-Sep-2015  uebayasi branches: 1.20.16; 1.20.18;
Introduce a new syntax, "buildprefix", to specify prefix of files under kernel
build subdirectory. This is not used now that everything is built at the
top of kernel build directory. It will become mandatory for source/object
files put out of kernel source tree to specify corresponding build subdirectory.
Only ``no dots'' relative path is accepted as "buildprefix".
 1.19  29-Oct-2014  christos - add RCSID's
- fix -Wconversion (except scanner)
 1.18  11-Oct-2014  uebayasi Enable debug for tools.
 1.17  09-Oct-2014  uebayasi Add debug print function.
 1.16  01-Nov-2013  christos branches: 1.16.4;
go back to using file:line: from uwe.
 1.15  01-Nov-2013  christos make config errors look more like other programs: <file>,<line>:
instead of <file>:<line>:
 1.14  12-Mar-2012  dholland Give option definitions their own data structure instead of using nvlists.
(and using messy hacks to make up for nvlists not holding quite the right
things)
 1.13  11-Mar-2012  dholland Move locator lists to their own data structure. This can use more tidying;
it is not clear to me at the moment what the "string" and "num" values
pushed around in locator lists are supposed to actually mean.
 1.12  11-Mar-2012  dholland Add some organizational comments
 1.11  11-Mar-2012  dholland Create a struct condexpr type to hold condition expressions, instead
of abusing struct nvlist to make trees.

(These are the a|b and a&b constructs.)
 1.10  11-Mar-2012  dholland Create a new type struct attrlist to manage lists of attributes,
instead of using struct nvlist.

(struct nvlist holds lists (or trees!) of semi-arbitrary stuff with no
structure and almost no type safety; it should go away.)
 1.9  10-Mar-2012  dholland Use __printflike. Build products unchanged.
 1.8  28-Dec-2008  christos branches: 1.8.8;
rename nv_int -> nv_num and make it long long, so that dev_t will fit when
we change it.
 1.7  12-Dec-2007  lukem Use a common function to generate the "MACHINE GENERATED" comment,
and ensure mkswap.c adds it too.
 1.6  13-Jan-2007  christos branches: 1.6.4;
- rename {x,}error -> cfg{x,}error and {x,}warn -> cfg{x,}warn so that we
can use err(3) and warn(3) to display errors instead of using inconsistent
fprintf's.
- remove emalloc/estrdup etc. We have them in libutil.
 1.5  12-Jan-2007  cube Handle defopt lists properly, as ':=' syntax introduce an additional
element... For that, introduce nvcat(nv1, nv2).
 1.4  03-Sep-2006  dsl There isn't really any point in the 'union' for nv_str and nv_ptr, all it
does is cause confusion when I try to add default values for defparam.
Also if malloc()/free() aren't efficient enough for us, we ought to fix
them rather than having local free list - so kill the local free lists.
 1.3  26-Aug-2006  christos Now that this is part of tools, we don't need the extra build glue.
 1.2  04-Oct-2005  cube - Keep track of the file in which we find the device instance
- Introduce xwarn() for delayed warnings
- Use xerror() and xwarn() in fixdevis() to notify about orphans

That way the correct file is printed when listing orphaned devices.

Reported by Juergen Hannken-Illjes in private mail.
 1.1  05-Jun-2005  thorpej config and genassym are not sysadmin tools, they are development tools.
As such, they don't belong in /usr/sbin, but rather /usr/bin. Move them
there.
 1.6.4.1  09-Jan-2008  matt sync with HEAD
 1.8.8.1  17-Apr-2012  yamt sync with head
 1.16.4.1  06-Mar-2015  snj Pull up following revision(s) (requested by mrg in ticket #572):
usr.bin/config/Makefile: up to 1.10
usr.bin/config/TODO: up to 1.14
usr.bin/config/config.1: up to 1.17
usr.bin/config/config.5: up to 1.25
usr.bin/config/defs.h: up to 1.64
usr.bin/config/files.c: up to 1.18
usr.bin/config/gram.y: up to 1.46
usr.bin/config/hash.c: up to 1.11
usr.bin/config/lint.c: up to 1.15
usr.bin/config/main.c: up to 1.74
usr.bin/config/mkdevsw.c: up to 1.12
usr.bin/config/mkheaders.c: up to 1.26
usr.bin/config/mkioconf.c: up to 1.28
usr.bin/config/mkmakefile.c: up to 1.37
usr.bin/config/mkswap.c: up to 1.8
usr.bin/config/pack.c: up to 1.9
usr.bin/config/scan.l: up to 1.22
usr.bin/config/sem.c: up to 1.71
usr.bin/config/sem.h: up to 1.19
usr.bin/config/util.c: up to 1.19
sync config(1) with HEAD.
 1.20.18.1  09-Mar-2020  martin Pull up the following, requested by christos in ticket #776:

usr.bin/config/TODO up to 1.32
usr.bin/config/defs.h up to 1.105
usr.bin/config/files.c up to 1.37
usr.bin/config/gram.y up to 1.55
usr.bin/config/main.c up to 1.99
usr.bin/config/scan.l up to 1.30
usr.bin/config/sem.c up to 1.84
usr.bin/config/util.c up to 1.21

config(1): fix issue with incorrect handling of elifdef statements.
 1.20.16.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed