diff options
author | ru <ru@FreeBSD.org> | 2005-12-30 15:29:50 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-12-30 15:29:50 +0000 |
commit | 9d1801a10554429dd1cfce2268b2f14d02e25509 (patch) | |
tree | 89491ff57608e5c7f7419acbfdb5462531473285 /usr.sbin/config/main.c | |
parent | e1d71bf7ffd9ed8d01e36055fb6e58ec68e88197 (diff) | |
download | FreeBSD-src-9d1801a10554429dd1cfce2268b2f14d02e25509.zip FreeBSD-src-9d1801a10554429dd1cfce2268b2f14d02e25509.tar.gz |
Clean up most of the "XXX"-tagged items:
- 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>
Diffstat (limited to 'usr.sbin/config/main.c')
-rw-r--r-- | usr.sbin/config/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c index e7f270e..d485e91 100644 --- a/usr.sbin/config/main.c +++ b/usr.sbin/config/main.c @@ -162,10 +162,23 @@ main(int argc, char **argv) STAILQ_INIT(&ftab); if (yyparse()) exit(3); + + /* + * Ensure that required elements (machine, cpu, ident) are present. + */ if (machinename == NULL) { printf("Specify machine type, e.g. ``machine i386''\n"); exit(1); } + if (ident == NULL) { + printf("no ident line specified\n"); + exit(1); + } + if (SLIST_EMPTY(&cputype)) { + printf("cpu type must be specified\n"); + exit(1); + } + /* * make symbolic links in compilation directory * for "sys" (to make genassym.c work along with #include <sys/xxx>) @@ -194,6 +207,8 @@ main(int argc, char **argv) } options(); /* make options .h files */ makefile(); /* build Makefile */ + makeenv(); /* build env.c */ + makehints(); /* build hints.c */ headers(); /* make a lot of .h files */ configfile(); /* put config file into kernel*/ cleanheaders(p); |