Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/config Retire optional `rule' argument of `file' com...
details: https://anonhg.NetBSD.org/src/rev/d39278d7135e
branches: trunk
changeset: 340226:d39278d7135e
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Fri Aug 28 09:04:02 2015 +0000
description:
Retire optional `rule' argument of `file' command.
This has existed since Rev. 1.1 of Torek's config(8) [1], but probably has
never been used by anyone.
(I can not imagine how a `file' like look like if `rule' is specified.)
[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.sbin/config.new/Attic/files.c?rev=1.1
diffstat:
usr.bin/config/config.5 | 21 ++-------------------
usr.bin/config/defs.h | 5 ++---
usr.bin/config/files.c | 21 +++------------------
usr.bin/config/gram.y | 13 +++----------
usr.bin/config/mkmakefile.c | 10 +++-------
5 files changed, 13 insertions(+), 57 deletions(-)
diffs (204 lines):
diff -r 43e5851f7cfc -r d39278d7135e usr.bin/config/config.5
--- a/usr.bin/config/config.5 Fri Aug 28 08:56:39 2015 +0000
+++ b/usr.bin/config/config.5 Fri Aug 28 09:04:02 2015 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: config.5,v 1.26 2015/08/28 02:59:09 uebayasi Exp $
+.\" $NetBSD: config.5,v 1.27 2015/08/28 09:04:02 uebayasi Exp $
.\"
.\" Copyright (c) 2006, 2007 The NetBSD Foundation.
.\" All rights reserved.
@@ -471,7 +471,7 @@
.Ar dependencies
list.
.It Ic file Ar path Oo Ar condition Oc Oo Ic needs-count Oc \
- Oo Ic needs-flag Oc Op Ic compile with Ar rule
+ Oo Ic needs-flag Oc
Adds a source file to the list of files to be compiled into the kernel, if the
.Ar conditions
are met.
@@ -509,23 +509,6 @@
.Ic needs-count
case, or to 1 in all the other cases.
.Pp
-The
-.Ar rule
-argument specifies the
-.Xr make 1
-rule that will be used to compile the source file.
-If it is not given, the default rule for the type of the file will be used.
-For a given file, there can be more than one
-.Ic file
-statement, but not from the same configuration source file, and all later
-statements can only specify a
-.Ar rule
-argument, and no
-.Ar conditions
-or flags.
-This is useful when a file needs special consideration from one particular
-architecture.
-.Pp
The path is relative to the top of the kernel source tree, or the inner-most
defined
.Ic prefix .
diff -r 43e5851f7cfc -r d39278d7135e usr.bin/config/defs.h
--- a/usr.bin/config/defs.h Fri Aug 28 08:56:39 2015 +0000
+++ b/usr.bin/config/defs.h Fri Aug 28 09:04:02 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.65 2015/08/20 09:44:24 christos Exp $ */
+/* $NetBSD: defs.h,v 1.66 2015/08/28 09:04:02 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -365,7 +365,6 @@
const char *fi_base; /* tail minus ".c" (or whatever) */
struct condexpr *fi_optx; /* options expression */
struct nvlist *fi_optf; /* flattened version of above, if needed */
- const char *fi_mkrule; /* special make rule, if any */
};
#define fi_srcfile fi_fit.fit_srcfile
#define fi_srcline fi_fit.fit_srcline
@@ -550,7 +549,7 @@
int fixfiles(void); /* finalize */
int fixobjects(void);
int fixdevsw(void);
-void addfile(const char *, struct condexpr *, u_char, const char *);
+void addfile(const char *, struct condexpr *, u_char);
void addobject(const char *, struct condexpr *, u_char);
int expr_eval(struct condexpr *, int (*)(const char *, void *), void *);
diff -r 43e5851f7cfc -r d39278d7135e usr.bin/config/files.c
--- a/usr.bin/config/files.c Fri Aug 28 08:56:39 2015 +0000
+++ b/usr.bin/config/files.c Fri Aug 28 09:04:02 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: files.c,v 1.19 2015/08/28 08:56:39 uebayasi Exp $ */
+/* $NetBSD: files.c,v 1.20 2015/08/28 09:04:02 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: files.c,v 1.19 2015/08/28 08:56:39 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.20 2015/08/28 09:04:02 uebayasi Exp $");
#include <sys/param.h>
#include <errno.h>
@@ -86,7 +86,7 @@
}
void
-addfile(const char *path, struct condexpr *optx, u_char flags, const char *rule)
+addfile(const char *path, struct condexpr *optx, u_char flags)
{
struct files *fi;
const char *dotp, *tail;
@@ -133,20 +133,6 @@
free(fi);
if ((fi = ht_lookup(pathtab, path)) == NULL)
panic("addfile: ht_lookup(%s)", path);
-
- /*
- * If it's a duplicate entry, it is must specify a make
- * rule, and only a make rule, and must come from
- * a different source file than the original entry.
- * If it does otherwise, it is disallowed. This allows
- * machine-dependent files to override the compilation
- * options for specific files.
- */
- if (rule != NULL && optx == NULL && flags == 0 &&
- yyfile != fi->fi_srcfile) {
- fi->fi_mkrule = rule;
- return;
- }
cfgerror("duplicate file %s", path);
cfgxerror(fi->fi_srcfile, fi->fi_srcline,
"here is the original definition");
@@ -166,7 +152,6 @@
fi->fi_suffix = path[fi->fi_len - 1];
fi->fi_optx = optx;
fi->fi_optf = NULL;
- fi->fi_mkrule = rule;
fi->fi_attr = NULL;
TAILQ_INSERT_TAIL(&allfiles, fi, fi_next);
return;
diff -r 43e5851f7cfc -r d39278d7135e usr.bin/config/gram.y
--- a/usr.bin/config/gram.y Fri Aug 28 08:56:39 2015 +0000
+++ b/usr.bin/config/gram.y Fri Aug 28 09:04:02 2015 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: gram.y,v 1.46 2014/11/04 23:01:23 joerg Exp $ */
+/* $NetBSD: gram.y,v 1.47 2015/08/28 09:04:02 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gram.y,v 1.46 2014/11/04 23:01:23 joerg Exp $");
+__RCSID("$NetBSD: gram.y,v 1.47 2015/08/28 09:04:02 uebayasi Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -194,7 +194,6 @@
%type <condexpr> cond_base_expr
%type <str> fs_spec
%type <flag> fflags fflag oflags oflag
-%type <str> rule
%type <attr> depend
%type <devb> devbase
%type <deva> devattach_opt
@@ -338,7 +337,7 @@
/* source file: file foo/bar.c bar|baz needs-flag compile-with blah */
define_file:
- XFILE filename fopts fflags rule { addfile($2, $3, $4, $5); }
+ XFILE filename fopts fflags { addfile($2, $3, $4); }
;
/* object file: object zot.o foo|zot needs-flag */
@@ -459,12 +458,6 @@
| NEEDS_FLAG { $$ = FI_NEEDSFLAG; }
;
-/* extra compile directive for a source file */
-rule:
- /* empty */ { $$ = NULL; }
- | COMPILE_WITH stringvalue { $$ = $2; }
-;
-
/* zero or more flags for an object file */
oflags:
/* empty */ { $$ = 0; }
diff -r 43e5851f7cfc -r d39278d7135e usr.bin/config/mkmakefile.c
--- a/usr.bin/config/mkmakefile.c Fri Aug 28 08:56:39 2015 +0000
+++ b/usr.bin/config/mkmakefile.c Fri Aug 28 09:04:02 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkmakefile.c,v 1.39 2015/08/28 08:31:28 uebayasi Exp $ */
+/* $NetBSD: mkmakefile.c,v 1.40 2015/08/28 09:04:02 uebayasi Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: mkmakefile.c,v 1.39 2015/08/28 08:31:28 uebayasi Exp $");
+__RCSID("$NetBSD: mkmakefile.c,v 1.40 2015/08/28 09:04:02 uebayasi Exp $");
#include <sys/param.h>
#include <ctype.h>
@@ -508,11 +508,7 @@
}
fprintf(fp, "%s.o: %s%s%s%s\n", fi->fi_base, prologue, prefix,
sep, fi->fi_path);
- if (fi->fi_mkrule != NULL) {
- fprintf(fp, "\t%s\n\n", fi->fi_mkrule);
- } else {
- fprintf(fp, "\t${NORMAL_%c}\n\n", toupper(fi->fi_suffix));
- }
+ fprintf(fp, "\t${NORMAL_%c}\n\n", toupper(fi->fi_suffix));
}
}
Home |
Main Index |
Thread Index |
Old Index