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.
This commit is contained in:
Joerg Wunsch 1997-10-28 07:21:04 +00:00
parent cf57a56c94
commit cea24a2b2e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30796
3 changed files with 31 additions and 6 deletions

View File

@ -91,6 +91,8 @@ struct file_list {
#define SWAPSPEC 6
#define COMPDEVICE 7
#define COMPSPEC 8
#define DEVDONE 0x80000000
#define TYPEMASK 0x7fffffff
/*
* Attributes (flags).

View File

@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
"$Id$";
"$Id: mkheaders.c,v 1.6 1997/09/15 06:37:09 charnier Exp $";
#endif /* not lint */
/*
@ -59,10 +59,19 @@ void
headers()
{
register struct file_list *fl;
struct device *dp;
for (fl = ftab; fl != 0; fl = fl->f_next)
if (fl->f_needs != 0)
do_count(fl->f_needs, fl->f_needs, 1);
for (dp = dtab; dp != 0; dp = dp->d_next)
if ((dp->d_type & TYPEMASK) == PSEUDO_DEVICE) {
if (!(dp->d_type & DEVDONE))
printf("Warning: pseudo-device \"%s\" is unknown\n",
dp->d_name);
else
dp->d_type &= TYPEMASK;
}
}
/*
@ -87,6 +96,7 @@ do_count(dev, hname, search)
if (dp->d_type == PSEUDO_DEVICE) {
count =
dp->d_slave != UNKNOWN ? dp->d_slave : 1;
dp->d_type |= DEVDONE;
break;
}
count++;

View File

@ -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 @@ read_files()
}
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 @@ read_files()
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 @@ read_files()
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);