- old yacc(1) use to magicially append stdlib.h, while new one don't
- new yacc(1) do declare yyparse by itself, fix redundant declaration of
'yyparse'
Approved by: des (mentor)
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.
This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
- Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename
i to len to make it slightly more descriptive and prevent negative
indexing of the array.
- Replace index() by strchr().
This supposedly fixes compilation on GNU systems.
Submitted by: Robert Millan <rmh debian org> (original patch)
MFC after: 3 weeks
extra MACHINE_ARCH symlink for certain platforms (such as pc98). The
support for creating these symlinks was added to sys/conf/kern.post.mk in
changeset 152964. The intention of that commit was to remove this code
from config(8), but config(8) was never updated.
Approved by: imp
- Passing -m to config will now print the MACHINE and MACHINE_ARCH
given in the passed kernel configuration file and then exit.
- If an option is defined in options.MACHINE with the same name as the
architecture of the kernel being configured, that option will be
considered set. This allows conditional compilation based on CPU
architecture.
Config version is now 600010.
Reviewed by: imp
section holding the config file to sh_addralign bytes using NULs.
This bogusly triggers an assert. Break out of the loop when we hit an
NUL within that many bytes of the end.
MFC after: 3 days
we've parsed the config file. Makefile generation is too late if
we've introduce changes to the syntax of the metafiles to warn about
version skew, since we have to try to parse them and we get an parse
error that's rather baffling to the user rather than a 'your config is
too old, upgrade' which we should get.
We have to defer doing it until after we've read the user's config
file because we define machinename there. The version required to
compile the kernel is encoded in Makefile.machinename. There's no
real reason for this to be the case, but changing it now would
introduce some logistical issues that I'd rather avoid for the moment.
I intend to revisit this if we're still using config in FreeBSD 10.
This also means that we cannot introduce any config metafile changes
that result in a syntax error or other error for the user until 9.0 is
released. Otherwise, we break the upgrade path, or at least reduce
the usefulness of the error messages we generate.
# This implies that the config file option mapping will need to be redone.
MFC after: 3 days
doesn't exist, we make a directory and then say "oops, that file isn't
there" leaving the directory behind. Add a stat for the config file
so that we detect this before making the directory. This is
semi-lame, but less lame than having this bug.
-d destdir option. For an automounted src tree using the logical cwd
in the Makefile keeps amd(8)'s mount timeout refreshed. Code to check
$PWD's validity cribbed from pwd(1).
Discussed on hackers@.
this bug and submitted these patches to dunstan@. He sent them to me
to test, and I discovered they were needed for the atmel kernel config
files. Since we were playing with them in the terminal room after the
developer's summit today, I thought I'd go ahead and commit them to
allow those folks that now have atmel hardware (thanks Andre) a chance
to try it out w/o my help. Since dunstan@ is asleep right now, risk
stepping on his toes a little by going ahead and committing this
change.
Submitted by: dunstan@, bde@
Tested by: bde@
Remember about tricky cases, where options contain unfriendly characters,
from the ANSI-C string point of view ('"' in this case). The x09 build
breakage was caused by SC_CUT_SEPCHARS options.
I did test this patch number of times; each time unprofessionally and
inappropriately.
OKed by: cognet (mentor)
This change will let us to have full configuration of a running kernel
available in sysctl:
sysctl -b kern.conftxt
The same configuration is also contained within the kernel image. It can be
obtained with:
config -x <kernelfile>
Current functionality lets you to quickly recover kernel configuration, by
simply redirecting output from commands presented above and starting kernel
build procedure. "include" statements are also honored, which means options
and devices from included files are also included.
Please note that comments from configuration files are not preserved by
default. In order to preserve them, you can use -C flag for config(8). This
will bring configuration file and included files literally; however,
redirection to a file no longer works directly.
This commit was followed by discussion, that took place on freebsd-current@.
For more details, look here:
http://lists.freebsd.org/pipermail/freebsd-current/2007-March/069994.htmlhttp://lists.freebsd.org/pipermail/freebsd-current/2007-May/071844.html
Development of this patch took place in Perforce, hierarchy:
//depot/user/wkoszek/wkoszek_kconftxt/
Support from: freebsd-current@ (links above)
Reviewed by: imp@
Approved by: imp@
- The code that creates hints.c and env.c from the skeleton files
moved into separate functions.
- Sanity checks for missing "ident" and "cputype" directives moved
into main(), alongside the existing check for "machine".
PR: bin/90310
Submitted by: Matt Emmerton <matt@gsicomp.on.ca>
much later than before, and it is now after we do a mkdir ../compile/FILE.
As a result, if you do 'config DOESNOTEXIST', it now creates the directory
../config/DOESNOTEXIST. It did not do that before. If DEFAULTS does not
exist, it still fails early before any permanent changes.
This shameless hack restores the old behavior of ensuring the config file
actually exists before mkdiring its counterpart directory.
Now I can rmdir ../compile/D and it will stay dead, after my fingers keep
sabotaging me with 'config D<tab><enter>'. (Some of my kernel names
started with D, which used to be 1-character unique and my fingers knew
this very well...)
directory before the specified config file. This is implemented by
opening DEFAULTS as stdin if it exists, and if so resetting stdin to the
actual config file when DEFAULTS is fully parsed via yywrap(). In short,
this lets us create DEFAULTS kernel configs in /sys/<arch>/conf that can
enable certain options or devices by default and allow users to disable
them via 'nooptions' or 'nodevice' rather than having to create kludge
NO_FOO options.
Requested by: scottl
Reviewed by: scottl
allows us to specify the machine_arch as well as machine. If
specified then a second link will be made, similar to machine, from
$MACHINE_ARCH to $S/$MACHINE_ARCH/include.
This is for ports where MACHINE != MACHINE_ARCH (pc98 today, others in
the future?).
Reviewed by: arch@, nyan@
to be included into this one. This works the same way as #include
does in C; as far as the user is concerned, the included file is
inlined into the current one.
Since config(8) is no longer limited to working on one user-supplied
file, printing just a line number in an error message is not
sufficient. The new global variable yyfile represents the file
currently being parsed, and must be printed as well.
Reviewed by: imp
Obtained from: OpenBSD
(I think config(8) source does bad things to your brain :-)
Clean up likely stray *.h files in the build directory.
Eg: if isa.h ceases being generated, zap it.
The heuristics to figure out a 'likely' file are pretty revolting.
FreeBSD 3.x or so when the 'make depend' picked up the opt_foo.h files.
Convert warnings into actual errors in the hope that buildkernel users
will pay more attention. :-(
for your /usr/obj/path/to/my/files path to the kernel, then weird
things happened. make buildkernel would fail because config was
dumping core or generating bad file names (depending on the lenght of
the path).
While I was here, also use strlcpy, strlcat and snprintf (or asprintf)
as necessary. Minor format policing for the snprintf calls as well.