_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
makeoptions selector FOO+=bar
"selector" may be anything used as a key in the selecttab, i.e. an option,
a "device" name, an "attach" name, a file system, etc.
Semantics: FOO+=bar when the selector is set. For example, if you have:
makeoptions pickle CPPFLAGS+=-I${S}/picklesrc
then "options PICKLE" will cause "CPPFLAGS+=-I${S}/picklesrc" to be
added to the Makefile.
Suggested by Matt Thomas.
makeoptions FOO+=bar
Multiple appending makeoptions are allowed. These are then emitted at
the %MAKEOPTIONSAPPEND token in the Makefile template.
Syntax suggested by Matt Thomas.
* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h
* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.
These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
included. This is done by tracking the current directory for the
file being parsed, and constructing a path relative to that directory
when an include directive's file name begins with "./".
a simple print statement showing the build directory location after
running config and creating a usage() function instead of using the
goto usage statement. Approved by christos@ and thanks to Tor for
the suggestions and patch.
the kernel is missing the newline at the end of the file, the string
doesn't get closed properly, resulting in a message from the compiler
about a missing #endif. It's somewhat misleading, so config will now
point it out and compensate for the missing newline.
Addresses PR kern/21920: including kernel config fails in some cases.
with either "options INCLUDE_CONFIG_FILE" or "options INCLUDE_JUST_CONFIG".
The program can now be invoked like:
- config -b objdir -s srcdir /netbsd
This will use configuration data from /netbsd to automatically create the
build directory of the new kernel.
- config -x /netbsd > CONFFILE
This will store configuration data from /netbsd in the CONFFILE file for
further editing.
such pseudo-devices, create cfdrivers for them which carry the appropriate
attributes. This allows devices in the config file to be attached to
pseudo-devices.