summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1997-10-28 07:21:04 +0000
committerjoerg <joerg@FreeBSD.org>1997-10-28 07:21:04 +0000
commit5c37a12152dcd7c9ea69865faa6b23c106931489 (patch)
treea44cd0af96e0712bbfe1a65954e66e6030955cd9 /usr.sbin/config/mkmakefile.c
parent5865a758bc78459ebe30511ab97dd81b2aa8597f (diff)
downloadFreeBSD-src-5c37a12152dcd7c9ea69865faa6b23c106931489.zip
FreeBSD-src-5c37a12152dcd7c9ea69865faa6b23c106931489.tar.gz
Allow for a keyword in the "files" file named "mandatory". The first
candidate for this is "npx0", more are likely to follow. Check for pseudo-devices that are being configured, but don't appear in any "files" file. The ``pseudo-device bpf 2'' already hit me too often.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index 852f86e..93674d2 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mkmakefile.c,v 1.22 1997/09/15 06:37:09 charnier Exp $";
+ "$Id: mkmakefile.c,v 1.23 1997/10/22 00:38:48 peter Exp $";
#endif /* not lint */
/*
@@ -285,7 +285,7 @@ read_files()
char *wd, *this, *needs, *special, *depends, *clean;
char fname[80];
int nreqs, first = 1, configdep, isdup, std, filetype,
- imp_rule, no_obj, before_depend;
+ imp_rule, no_obj, before_depend, mandatory;
ftab = 0;
(void) snprintf(fname, sizeof fname, "../../conf/files");
@@ -299,7 +299,7 @@ openit:
}
next:
/*
- * filename [ standard | optional ] [ config-dependent ]
+ * filename [ standard | mandatory | optional ] [ config-dependent ]
* [ dev* | profiling-routine ] [ device-driver] [ no-obj ]
* [ compile-with "compile rule" [no-implicit-rule] ]
* [ dependency "dependency-list"] [ before-depend ]
@@ -354,15 +354,23 @@ next:
clean = 0;
configdep = 0;
needs = 0;
- std = 0;
+ std = mandatory = 0;
imp_rule = 0;
no_obj = 0;
before_depend = 0;
filetype = NORMAL;
if (eq(wd, "standard"))
std = 1;
+ /*
+ * If an entry is marked "mandatory", config will abort if it's
+ * not called by a configuration line in the config file. Apart
+ * from this, the device is handled like one marked "optional".
+ */
+ else if (eq(wd, "mandatory"))
+ mandatory = 1;
else if (!eq(wd, "optional")) {
- printf("%s: %s must be optional or standard\n", fname, this);
+ printf("%s: %s must be optional, mandatory or standard\n",
+ fname, this);
exit(1);
}
nextparam:
@@ -440,6 +448,11 @@ nextparam:
dp->d_slave = 1;
goto nextparam;
}
+ if (mandatory) {
+ printf("%s: mandatory device \"%s\" not found\n",
+ fname, wd);
+ exit(1);
+ }
if (std) {
dp = (struct device *) malloc(sizeof *dp);
bzero(dp, sizeof *dp);
OpenPOWER on IntegriCloud