Commit Graph

24 Commits

Author SHA1 Message Date
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
christos 57a881013d Define ecalloc() and use it when initializing data structures. 2003-11-24 21:44:37 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
gehenna c8d83dee30 Accept the block-device-only devices.
Reported by ragge.
2003-01-23 15:05:45 +00:00
gehenna d0c0162e9c Not necessary to put fixdevmtab in global section. 2003-01-23 15:03:44 +00:00
gehenna 02681cddbc check the duplication or the inconsistency before evaluating fopts. 2003-01-23 15:01:54 +00:00
gehenna 27e67caceb reject the duplication of the same device-major lines. 2003-01-23 14:57:40 +00:00
gehenna 2c4d3430fb fix typo. 2003-01-23 14:55:39 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
lukem 90028da4e1 Functionality improvements:
- Add `no' keyword, which can be used in the following ways:
	no file-system SOMEFS
	no makeoptions FOO
	no options OPT1[,OPT2[,...]]
	no pseudo-device somepseudo
  This turns off a previous file-system/makeoptions/options/pseudo-device
  entry for the same item.
  Grammar support for 'no device DEV at ATTACH' added, but not
  implemented yet.

Code changes:
- Convert many simple lists to TAILQs
- Convert prefix to SLIST
- Remove argument names from prototypes.
- Don't bother with custom alloc code for hashtables; just use emalloc()
  like everything else.
- Implement ht_remove(), to remove an entry from a hash table.
  Add removed entries to a freelist for later reuse.
- Don't selectbase() devices and pseudo-devices at definition time; instead
  do it at one pass after the config file has been parsed in fixdevis().
- Rename nvhead to nvfreelist; a more apt name...
- Minor code cleanups.
2002-06-05 10:56:17 +00:00
tv a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +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
cgd c026189f76 do that previous differently. only allow redefinitions if: in different
file, make command specified, and no flags or attrs-which-cause-inclusion
are spec'd.  The notion is, if you change either of the last 2, it will
probably have very undesirable results, so only allow the make command to
be changed.  override by clobbering the make command in the previous entry.
also, fix a bug where line number of original entry would get clobbered on
dup entry, so that if you had multiple dups the later ones would get bogus
initial definition info.
2000-06-09 05:06:12 +00:00
eeh e5cf411171 Allow MD files files to override settings in MI files files. (From Chris Torek). 2000-06-08 21:22:55 +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
lukem 73d91b2129 WARNSify, deprecate register, remove unused functions 1997-10-18 07:58:56 +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
gwr 26793c36d4 Minor changes to support building on other systems (i.e. SunOS). 1996-11-07 22:59:39 +00:00
cgd 3ac7667c57 add BSDI-style expression support to optional file specifiers. Code mostly
taken from the parts of BSDI's 'config' which are freely-distributable
(under the LBL/UC Regents license), and adjusted to fit into our version.
1996-03-17 13:18:15 +00:00
cgd 9c4f9d2daa spaces vs. tabs, spaces/tabs at EOL bogons. 1996-03-17 06:29:19 +00:00
cgd dfbb6d0884 fix a bug where definitions to be placed in headers wouldn't be
right/consistent.  If you had something like:

file	file.c		foo bar baz needs-flag

and any one of foo, bar, or baz caused it to be brought into the compile,
in the header you'd end up with:

#define NFOO	1
#define NBAR	1
#define NBAZ	1

even if only one of them were selected.  Other headers might have had a
different (inconsistent) set of definitions, depending on whether any of
their components were included, and any files necessary for the unspecified
options would not actually be present in the Makefile files list.  The
correct behaviour for the example above if only 'foo' is selected by
the config file is:

#define NFOO	1
#define NBAR	0
#define NBAZ	0

which is what config now does.  This bug has been present for a while.
(I don't know for sure that it was present in 4.4-Lite2, but from looking
at the Lite2 config sources, it appears to be there.)
1996-03-17 03:21:21 +00:00
thorpej c5f7cf3a9e RCS id police. 1996-03-03 17:21:25 +00:00
scottr de8fcf0996 Spelling correction 1996-02-13 23:08:24 +00:00
cgd 064307e690 config.new has been moved here. names updated to match. 1995-04-28 06:54:58 +00:00