summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-02-04 18:28:58 +0000
committerimp <imp@FreeBSD.org>2014-02-04 18:28:58 +0000
commit5250b91b6882145cf662aaa5303d7e9c0262cdd9 (patch)
treea27c56c853d03f5b8425b0d464c68948cd4ef37d /usr.sbin/config
parentfdc52c1fa04b64b01ee1dd7359d122b2ccb43cea (diff)
downloadFreeBSD-src-5250b91b6882145cf662aaa5303d7e9c0262cdd9.zip
FreeBSD-src-5250b91b6882145cf662aaa5303d7e9c0262cdd9.tar.gz
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.
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/configvers.h2
-rw-r--r--usr.sbin/config/mkmakefile.c21
2 files changed, 18 insertions, 5 deletions
diff --git a/usr.sbin/config/configvers.h b/usr.sbin/config/configvers.h
index 6e044b8..56ca85c 100644
--- a/usr.sbin/config/configvers.h
+++ b/usr.sbin/config/configvers.h
@@ -49,5 +49,5 @@
*
* $FreeBSD$
*/
-#define CONFIGVERS 600012
+#define CONFIGVERS 600013
#define MAJOR_VERS(x) ((x) / 100000)
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index e41fa87..31681a8 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -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 @@ next:
no_obj = 0;
before_depend = 0;
nowerror = 0;
+ not = 0;
filetype = NORMAL;
objprefix = "";
if (eq(wd, "standard"))
@@ -376,13 +377,21 @@ next:
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 @@ next:
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",
OpenPOWER on IntegriCloud