Commit Graph

55 Commits

Author SHA1 Message Date
cgd c2bdafab79 use getprogname() 2001-02-20 23:51:59 +00:00
cgd fdfcf1962d labels (even default:) _must_ be followed by statements! usr.bin/fgen/fgen.l 2001-01-16 02:43:37 +00:00
lukem 1d0a6f62b8 revert 1.51 and 1.52 (_KERNEL_foo stuff), due to loud objections from
a couple of people.  we'll just have to go back to adding this manually
to our config files...
2000-12-14 22:14:45 +00:00
lukem ea03d7ba8e change KERNEL_foo -> _KERNEL_foo, as suggested by matt green 2000-12-12 17:49:20 +00:00
lukem f125ced5a1 Add option `KERNEL_foo', where `foo' is the basename of the build directory.
This will get added to the Makefile's IDENT= as -DKERNEL_foo.
2000-12-12 08:46:02 +00:00
bjh21 23dc98ae44 Don't try to use yydebug when we're building on a foreign system. Not all
yaccs provide it (notably GNU Bison 1.28).
Fixes the final part of PR#9112 (building under GNU/Linux).
2000-10-08 11:33:40 +00:00
cgd da723c733f include copyright notice in binary even if bootstrapping. 2000-10-02 19:57:23 +00:00
cgd 463d864ef0 nuke __P, and convert all functions to use ANSI-style declarations.
Also, do a few trivial KNF cleanups (e.g. newline at start of fn if no
locals).  Verified to have no effect via diff on new and old compiled
binaries.
2000-10-02 19:48:34 +00:00
simonb fd4ede242b Don't declare 'extern opt*' getopt variables. 2000-04-14 06:26:52 +00:00
enami 0d45936ccf Please pay an attention to the existing code and not to introduce
different coding style.
2000-01-25 01:16:00 +00:00
hubertf 764307a5a1 Keeping my kernel config files under RCS control, I always wished to
have a way to embed the revision number into the kernel's "uname -v"
output. The patch below does this, by generating a new keyword "ident"
that can be followed by any string, e.g.

        ident   "NOON-$Revision$"

will lead to
                                           vvvvvvvvvvvvvvvvvvvvvv
        char version[] =     "NetBSD 1.4P (NOON-$Revision: 1.21 $) #37: Thu Jan
20 02:01:23 MET 2000\n    feyrer@noon:/usr/cvs.local/src-current/sys/arch/i386/c
ompile/NOON\n";

This will lead to a version of "MYMACHINE-$Revision$" instead of the
kernel config file name. If "ident" is not present, the current behaviour
of using the kernel config file's name as identifier is used.

Implement by writing the ident to a file ("ident") in the compile dir,
which newvers.sh will pick up for generating the ident.
2000-01-23 23:37:42 +00:00
enami 532da8eb1c Remove redundant declaration of firstfile(). 1999-09-24 04:23:36 +00:00
ws b17a1042ba Allow mutual dependencies.
Output string-valued options reasonably to option files.
1999-09-22 14:23:03 +00:00
thorpej 8c134b93a0 If unlink() fails w/ ENOENT, don't display an error message. 1999-07-31 05:22:05 +00:00
hubertf b0f5059f43 Don't ignore the return value of two unlink() commands, and print
some warnings instead, if unlinking fails.

Fixes PR 4634 by myself.
1999-07-29 20:08:59 +00:00
thorpej 152af09e65 Add a mechanism to specify prefixes that are transparently prepended
to file specifications.  The prefixes are arranged in a stack, and
nest, so that file, object, and include specifications are normalized,
and all end up relative to the kernel compile directory.

For example, in the kernel config file:

# Pull in config fragments for kernel crypto
prefix ../crypto-us/sys 			# push it
cinclude "conf/files.crypto-us"			# include it if it's there
prefix						# pop it

and in files.crypto-us:

file netinet6/esp_core.c                ipsec & ipsec_esp
file netinet6/esp_output.c              ipsec & ipsec_esp
file netinet6/esp_input.c               ipsec & ipsec_esp

...generates the following in the kernel Makefile:

        $S/../crypto-us/sys/netinet6/esp_core.c \
        $S/../crypto-us/sys/netinet6/esp_output.c \
        $S/../crypto-us/sys/netinet6/esp_input.c \

By placing this all in the kernel config file, all the magic involved in
reaching into non-standard kernel source directories is placed into a file
that the user is expected to edit anyway, and reasonable examples (and
sane defaults, for typical source checkouts) can be provided.
1999-07-09 06:44:58 +00:00
gwr 5a4e7b6de7 Make this build on Solaris (make -f Makefile.boot) 1999-04-02 06:36:30 +00:00
mjl 99d17e2ca4 Mention -v in usage. Fixes PR 6262 by Erik Bertelsen. 1999-02-08 22:32:58 +00:00
itohy ec8a0e8dad Eliminate a memory leak. 1998-10-05 19:50:40 +00:00
jonathan eaa351c789 * Check that any declared option (def{opt,param,flag}, filesystem
is declared at most once.
* Do option dependency across all def{opt,param, flag}.
* Make the default value of otherwise-unspecified defopt's be 1,
  for consistency with non-defopt'ed options.
* Wrap an abstraction layer (macros) around tests for defopt, filesystem,
  defparam, etc. to catch outdated  defopt-vs-filesystem tests.
1998-06-30 03:30:56 +00:00
scottr a5427da04d Add and document the -v flag, and only print option-related warnings
if this flag is specified.
1998-06-28 04:41:36 +00:00
jonathan 0925cf4fda Stronger checking of options:
* machinery for nonfatal warnings.
* new backend config-file keywords:
     defparam -- like defopt, but each defparam option is required
		 to have a value when configured via "options".
     defflag -- like defopt, but defflag options may not have a value.
		 Also, on "option FOO",  a needs-count style flag
		 (NFOO, either 0 or 1)  is emitted to the .h file.

* Warn about old-style options that aren't defined via def{opt,param,flag}
  and which are  added to IDENT. (These behave subtly differently
  to defopt options when  no explicit value is given.)
1998-06-24 11:20:54 +00:00
scottr e6eb7d0530 Implement option dependencies as part of the defopt action. We currently
restrict depended-on (or "implied") options to those that have been
previously defopt'ed, which inherently eliminates any cycles in the option
graph.
1998-06-10 04:33:31 +00:00
tv 2c23336179 Add missing colon in error message. 1998-05-22 19:29:00 +00:00
thorpej 129a20a049 Fix a think'o that caused "config netbsd root on ? type ffs" to fail.
Fixes PR #5021.
1998-02-20 00:11:02 +00:00
thorpej a522c869e5 Fix a few semantic problems wrt. file-system, deffs, and options, pointed
out by Chris Demetriou.
1998-02-19 06:13:51 +00:00
thorpej d12d850cfe Add a "deffs" keyword, similar to "defopt", that defines file systems.
Only things defined with this keyword will be allowed on "file-system"
lines in the kernel config files.

By default, -D... directives for file systems are not generated, since
they are not needed for most file systems now that vfs_conf.c is gone.
However, some file systems must have dependencies generated on them
(e.g. NFS, UNION).  So, provide a way to specify an option file for
these file systems.
1998-02-19 00:27:00 +00:00
thorpej bc1733bc88 Add code to emit the cfdriver structures into ioconf.c. This requires
a change to the config grammar, to specify a device's class (i.e. DV_xxx)
like:

device	sd class disk: ...

Also emit an ioconf.h, which contains extern declarations of the
cfdriver structures.

While I'm here, add support for specifying multiple options per defopt
line, as well as specifying the file name in which the options will
appear.

defopt	foo bar baz

generates "opt_foo.h", "opt_bar.h", and "opt_baz.h"

defopt	opt_mumble.h foo bar baz

generates "opt_mumble.h" which contains all three options.

Also, clean up and fix some bugs in the code that generates header files.
1998-01-12 07:37:40 +00:00
lukem 73d91b2129 WARNSify, deprecate register, remove unused functions 1997-10-18 07:58:56 +00:00
lukem 2c30449e9c getopt returns -1 not EOF, turn off WARNS 1997-10-18 04:08:12 +00:00
mycroft 7d58ce9471 Add `object' and `library' keywords to pull in precompiled .o and .a files.
Syntax is like the `file' keyword; e.g.:
object	arch/i386/i386/mumble.o		[mumble] [needs-flag]
Largely from Michael Richardson in PR 3833, with some changes by me.
1997-10-10 10:27:53 +00:00
mrg 7d9c89b0ce remove "swap" configuration. 1997-06-12 15:03:09 +00:00
thorpej 267e8357fc Implement an unfortunate, and temporary, kludge to address the problem
reported in PR #3668 from maximum entropy <entropy@tanstaafl.bernstein.com>.

The problem: The unit number is not being conveyed to the configuration
crosscheck with root is a network interface; the device number is set
to NODEV, which sets up the (correct) defaults for swap/dump devices.
We can't change NODEV to a unit number, as the PR's patch suggests, as
this breaks the swap/dump defaults.  Rewriting that code is not really
justified, since it's soon to be obsoleted.

The kludge: add an "nv_ifunit" member to struct nvlist, which convey's
a network interface's unit number to the crosscheck routine.  It's not
pretty, but it's not terribly invasive, and can be garbage-collected
easily when the swap/dump goo is obsoleted.
1997-05-25 18:42:54 +00:00
thorpej e14a0d029f Add support for generating "option headers". These allow options to
be included in object dependencies.  config(8) is told to generate
a header for a particular option with the new "defopt" keyword, used
in the files.* system description files.  Options that are placed in
header files are not given -D... cpp flags.

This approach allows options to be turned into headers incrementally,
rather than all at once, and allows for non-header options, as well.
1997-02-02 21:12:30 +00:00
thorpej 07c71aa7f7 Implement new grammar and semantics for specifying file systems
and the root device:

- New "file-system" keyword is used to configure file systems into
  the kernel.
- New way of specifying root device, which allows root file system
  type to always be specified.  Examples:

	config gennetbsd swap generic
	config sdnetbsd root on sd0a swap on sd0b
	config nfsnetbsd root on nfs

  are replaced by:

	config gennetbsd root on ? type ?
	config sdnetbsd root on sd0a type ffs swap on sd0b
	config nfsnetbsd root on ? type nfs
	config lenetbsd root on le0 type nfs

  Note that specific network interfaces may now be specified as
  the root device.
- swapgeneric.c is no longer used; generate a swap*.c file for each
  "config" line in the kernel configuration file.
1997-01-31 03:12:30 +00:00
gwr 91118cc6ae Move setupdirs() here -- it is now called from scan.l (include). 1996-11-11 23:41:54 +00:00
cgd 42b8d1922d correct a comment: profiled kernels go in FOO.PROF, not FOO.prof 1996-11-02 01:02:56 +00:00
mycroft ab6ebadde6 Add `source' and `build' directives, and corresponding options, per discussion
on tech-kern.  (See man page.)  Implementation by Greg Hudson.
Also, remove special case for i386 in vector handling, although this code isn't
actually used any more.
1996-08-31 20:58:16 +00:00
cgd 50b3b61ea3 simplify nvlist creation slightly; change newnv() to take another arg: next 1996-03-17 11:50:09 +00:00
cgd 2dd7a7984c Fix PR 2218. As noted (both in mail from me included in the PR, and
in XXX-marked comments in the recent attachment changes), this was a
long-standing bug in config.

The problem: If a device is attached to a device via an attribute exported
by that device (i.e. foo* at bar0, where 'bar' exports an attribute that
'foo' attaches to), but the device attached to is not present in the
kernel configuration file, AND another device which exports an attribute
that 'foo' attaches to _is_ present (e.g. a device baz0, if one could
specify 'foo0 at baz0'), then: the configuration file will (incorrectly)
be accepted by config, and the resulting ioconf.c will include a bogus
cfdata entry for the device (in the example, 'foo*').  This typically
causes the resulting kernel to crash during autoconfiguration.

The solution: Be much more careful about keeping track of where a device
was attached, and, in particular, if a device was attached to another device,
_always_ keep track of what device it was attached to.  Then, when
cross-checking, if the attached-to device isn't present, give up and do not
check attributes.  Also, document the process much more thoroughly.
1996-03-17 07:05:50 +00:00
cgd 9c4f9d2daa spaces vs. tabs, spaces/tabs at EOL bogons. 1996-03-17 06:29:19 +00:00
thorpej cb6211e540 New device attachment scheme:
- split softc size and match/attach out from cfdriver into
	  a new struct cfattach.

	- new "attach" directive for files.*.  May specify the name of
	  the cfattach structure, so that devices may be easily attached
	  to parents with different autoconfiguration semantics.
1996-03-17 02:08:22 +00:00
thorpej c5f7cf3a9e RCS id police. 1996-03-03 17:21:25 +00:00
cgd 064307e690 config.new has been moved here. names updated to match. 1995-04-28 06:54:58 +00:00
hpeyerl 9cbb13a30b Config support for ccd driver. (from 4.4Lite) 1994-06-24 14:22:08 +00:00
mycroft 508ba10f66 Rename vector() to i386_vector(), to avoid any confusion. 1994-02-23 00:23:20 +00:00
cgd 91068203d6 changes for amiga 1994-02-01 02:07:11 +00:00
cgd 2dae0c7cb0 add support for "machinearch" internal variable. if "machinearch"
is different than the "machinename" internal variable, read
machinearch's files.${machinearch} and add it to the list of files
for the machine.  Also, regardless of whether or not they're different,
create a ${machinearch} sylink (or directory) pointing to the machinearch
include files (or containing them).
1994-01-08 10:33:43 +00:00
deraadt 9ae8a636f9 Add MACHINE_PMAX support from rick & ralph. 1993-10-14 01:22:27 +00:00
phil 4c44872dde Adding changes for the pc532 machine. The NO_SYMLINK is for compilation
under Minix on the pc532, which has no symlinks.
1993-09-15 21:15:19 +00:00