Implement the '!' operator for files* files. It means 'include this

only if the specified option is NOT specified.' Bump version because
old config won't be able to cope with files* files that have this
construct in them.
This commit is contained in:
Warner Losh 2014-02-04 18:28:58 +00:00
parent ab2de2d795
commit ff9aeb4c47
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261493
2 changed files with 18 additions and 5 deletions

View File

@ -49,5 +49,5 @@
*
* $FreeBSD$
*/
#define CONFIGVERS 600012
#define CONFIGVERS 600013
#define MAJOR_VERS(x) ((x) / 100000)

View File

@ -308,7 +308,7 @@ read_file(char *fname)
struct opt *op;
char *wd, *this, *compilewith, *depends, *clean, *warning;
const char *objprefix;
int compile, match, nreqs, std, filetype,
int compile, match, nreqs, std, filetype, not,
imp_rule, no_obj, before_depend, nowerror;
fp = fopen(fname, "r");
@ -366,6 +366,7 @@ read_file(char *fname)
no_obj = 0;
before_depend = 0;
nowerror = 0;
not = 0;
filetype = NORMAL;
objprefix = "";
if (eq(wd, "standard"))
@ -376,13 +377,21 @@ read_file(char *fname)
for (wd = get_word(fp); wd; wd = get_word(fp)) {
if (wd == (char *)EOF)
return;
if (eq(wd, "!")) {
not = 1;
continue;
}
if (eq(wd, "|")) {
if (nreqs == 0)
errout("%s: syntax error describing %s\n",
fname, this);
compile += match;
if (not)
compile += !match;
else
compile += match;
match = 1;
nreqs = 0;
not = 0;
continue;
}
if (eq(wd, "no-obj")) {
@ -471,9 +480,13 @@ read_file(char *fname)
if (op->op_value == 0 && opteq(op->op_name, wd))
goto nextparam;
match = 0;
nextparam:;
nextparam:
not = 0;
}
compile += match;
if (not)
compile += !match;
else
compile += match;
if (compile && tp == NULL) {
if (std == 0 && nreqs == 0)
errout("%s: what is %s optional on?\n",