Commit Graph

56 Commits

Author SHA1 Message Date
uwe 016b4f04fa Add debug output for ENDDEFS.
This makes it more clear in the debug output where config switched
from definitions to selections.
2020-07-26 22:40:52 +00:00
christos 202553924e Keep track where more objects are declared so that we can print where things
have been redefined.
2020-03-07 19:26:13 +00:00
christos f138f6c50d Accept "-no" as a "no" that does not cause errors if the object deleted
does not exist.
2016-08-07 10:37:24 +00:00
mlelstv 6fc95ff617 Extend syntax of config phrase, a quoted string instead of a device name
is passed as root specification string. This can be used to specify a
wedge by name.
2016-04-29 18:18:22 +00:00
uebayasi 2cb009cdd9 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".
2015-09-01 13:42:48 +00:00
uebayasi 0b130540fb Merge struct objects into struct files. Keep per-suffix file lists. 2015-09-01 11:22:59 +00:00
uebayasi b877b4042a Restore the old behavior of "maxusers" to allow the value to be overriden.
Problem reported by John D. Baker.
2015-08-31 02:58:25 +00:00
uebayasi 75298111a7 Convert MAXUSERS, take 2.
Define MAXUSERS in opt_param.h and include it from sys/param.h, for more
accurate dependency.  Don't define -DMAXUSERS and add it to ${CPPFLAGS}.
config(5)'s "maxusers" syntax doesn't change.

(The version just before revert was OK, but I had something bad in my obj
dirs.)
2015-08-29 14:07:45 +00:00
uebayasi ca847f032e Revert "Retire optional `rule' argument of `file' command". It is still used
in m68k ports.
2015-08-29 02:54:07 +00:00
uebayasi 54e231918a Retire optional `rule' argument of `file' command.
This has existed since Rev. 1.1 of Torek's config(8) [1], but probably has
never been used by anyone.

(I can not imagine how a `file' like look like if `rule' is specified.)

[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/config.new/Attic/files.c?rev=1.1
2015-08-28 09:04:02 +00:00
joerg fdcb5b3398 makedev returns ~uint64_t, but val is int64_t. Cast for -Wconversion. 2014-11-04 23:01:23 +00:00
uebayasi c42523f496 config(1), config(5): Introduce "select"
o Introduce a new selection directive "select" to select an attribute (as a
  module) and its dependencies.
o Support "no select" too.
o Stop abusing "options" to select an attribute.
o Bump config(1) version.
2014-10-31 07:38:36 +00:00
christos d12b0036c5 - add RCSID's
- fix -Wconversion (except scanner)
2014-10-29 17:14:50 +00:00
uebayasi d23bf64337 Allow dependency on undefined attributes, so that attribute definitions can
be written out-of-order, like:

	# b is not defined yet
	define	a: b
	file	a.c	a

	# b is defined here
	define	b
	fine	b.c
2014-10-10 11:09:50 +00:00
uebayasi bd3d511493 Split plain/interface/devclass attribute initializers. 2014-10-10 06:13:30 +00:00
uebayasi 567430ccec Sort definition/selection rules to clarify which is which. 2014-10-09 09:39:24 +00:00
uebayasi fc2a41ac40 The word "configuration" is too ambiguous; use "selection" meaning that
user selects some of provided "definitions".
2014-10-09 07:05:01 +00:00
mrg ebf7669ed7 implement "no ident". 2014-05-29 07:47:45 +00:00
pooka 26b4d3d169 ioconf/pseudo-root have been in here unchanged for 3+ years and their use
has spread from rump kernels into dozens of kernel modules.  Let's pretend
we don't want to see config yell about them being experimental every time.
2013-08-11 10:37:08 +00:00
dholland cb79ede2d1 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)
2012-03-12 02:58:55 +00:00
dholland f5d4142b2d 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.
2012-03-11 21:16:07 +00:00
dholland 237116305d More naming improvements. 2012-03-11 19:27:26 +00:00
dholland a551c5e8b7 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.)
2012-03-11 08:21:53 +00:00
dholland 4fbb702df0 Rename a few more things; try to use the same terminology as config(5). 2012-03-11 07:46:47 +00:00
dholland bbe96a5ad8 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.)
2012-03-11 07:32:41 +00:00
dholland 720c7fbc2a Strengthen the logic that wraps allocations going on the parser stack.
(This allows cleaning up when a syntax error occurs, because yacc just
dumps the parser stack on the floor.)

The new logic can handle arbitrary data types instead of being limited
to struct nvlist.
2012-03-11 07:27:02 +00:00
dholland cfffb8a2c1 Write out the expression grammar for dependency constraints instead of
using precedence rules. Precedence rules (besides being a hack) often
lead to unexpected/unwanted behavior in corner cases.
2012-03-11 02:56:25 +00:00
dholland 6df4c5ae47 Sort productions in grammar. No functional change. 2012-03-11 02:43:33 +00:00
dholland 70f2148fe7 Simplify some things. Rename some productions for clarity. 2012-03-11 02:21:04 +00:00
dholland 60c605bb74 A bit more of previous. 2012-03-11 01:09:42 +00:00
dholland 540fdf9f5e Reformat according to (my) basic standards for yacc grammars.
No functional change.
2012-03-11 00:57:44 +00:00
dholland f3063ae30c Comments. 2012-03-11 00:14:20 +00:00
pooka 3da3ab250b For the simple cases, augment device-major with information on how
a driver expects /dev/node -> minor mappings to go and include that
information in devsw_conv.
(no, I didn't plow through all the MD majors files)
2010-04-30 20:47:17 +00:00
pooka 523c21179c print ioconf WARNING in caps too 2010-03-08 11:12:32 +00:00
pooka 90ac64de16 Add a highly experimental pseudo-root feature to be used in conjuction
with the also-experimental ioconf keyword.  pseudo-root allows to
specify a root at any point in the device tree without having
attachments from the actual root.

For example, instead of having a config file like this:
mainbus0 at root
bus_a? at mainbus0
bus_b? at bus_a*
device7 at bus_b?

You can have one like this:
pseudo-root bus_b*
device7 at bus_b?

This will produce the relevant ioconf.c glue for device number 7
only instead of the whole 9 yards from root.  Perhaps needless to
say, this can be used to generate snippets of config glue for
modules and, let's not deny that my main motivation for doing this,
rump components.

This is part 2/3 of my modifications to config (the last part is
autogenerating source file lists and component Makefiles).

No strong objection from cube (after a little pressuring ;), but
like he said, the implementation will most likely need some more
tweaking and may not work correctly under all pseudo-root uses yet.
2010-03-08 10:19:14 +00:00
pooka c96070654c Remove fs_foo.h support from deffs now that nothing uses it. 2010-03-03 13:53:22 +00:00
pooka e239742f9b Introduce experimental support for ioconf-only configuration files.
This is done by giving the "ioconf" keyword in the config file.
As a result, config produces only ioconf.c and locators.h.  Currently,
only "monolithic" configurations with the device path starting from
root are supported.  Eventually, the goal is to support a local
root in the input file from any point along the device tree using
files.* in our kernel tree.  This will make autogenerating the
config glue for device modules possible instead of having to write
it by hand like is currently required (yes, it sounds simple to
implement, but ...).

reviewed by cube.
(the next part will demand major discussions with you, so prepare ;)
2010-02-03 21:00:49 +00:00
cube a16a636500 Actually allow a full expression for the condition for "makeoptions" in
files.*

Patch from Yorick Hardy.
2009-03-13 18:24:41 +00:00
christos 0001b92828 rename nv_int -> nv_num and make it long long, so that dev_t will fit when
we change it.
2008-12-28 01:23:46 +00:00
drochner b66156c7c9 Disable use of pseudo-devices defined "defpseudo" with interface
attributes, but provide compatibility for older source trees (according
to the "version" in conf/files and other files.*.
reviewed by cube
2008-06-10 18:11:31 +00:00
drochner 8456b350de Seperate pseudo-devs which don't use device_t et al. (the classical
ones, mostly network pseudo interfaces) and those which use autoconf
to attach instances dynamically, or to attach child devices.
Use a new keyword "defpseudodev" for the latter.
Issue a warning if interface attributes are used with "old" pseudodevs,
but let it work as before for now. This will be removed soon.
approved by cube
2008-06-10 12:35:32 +00:00
cube 66a59dcc4f Don't defattr machinearch if it's NULL. Pointed out by
Juergen Hannken-Illjes.
2007-11-11 17:35:27 +00:00
cube 66796c65e4 Make the "machine" statement define attributes for `machine', `arch' and
all the `subarch' given as parameters.  This is useful in combination with
ifdef...
2007-11-10 00:15:43 +00:00
christos c7295a4c51 - 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.
2007-01-13 23:47:36 +00:00
cube 718ffd7615 Handle defopt lists properly, as ':=' syntax introduce an additional
element...  For that, introduce nvcat(nv1, nv2).
2007-01-12 21:49:51 +00:00
cube 904262675b Add new syntaxic sugar to provide a value in lint (i.e., config -L)
configurations for defparams.  It will be used _only_ by config -L.

This will greatly help automating tests with lint configurations,
hopefully.
2007-01-09 13:03:47 +00:00
dsl 6467d53e48 Add support for specifying a default value on a 'defparam' line.
If a default is specified then the option is always defined in the
corresponding .h file.
Particularly useful for parameters where the default action isn't the
same a defining the value zero, given that the current use of #if defined(opt)
is open to problems wehere the relevant .h file isn't actually included, so
requiring an option to always have a value makes sense.
Also included (but commented out) is code that adds a global symbol to
the object file to stop objects compiled with different values for the
same option being linked together - I'm not quite happy with it yet!
2006-09-04 06:45:14 +00:00
matt 4a82747a8f Allow deffs to take dependencies like defflag and defopt 2006-08-30 10:12:25 +00:00
christos d0fb89015b Now that this is part of tools, we don't need the extra build glue. 2006-08-26 18:17:13 +00:00
cube 87ab9060e2 D'uh. Forgot the file name argument in the "obsolete" statements. 2006-06-04 13:07:24 +00:00