Module Name: src
Committed By: uebayasi
Date: Fri Aug 28 09:04:02 UTC 2015
Modified Files:
src/usr.bin/config: config.5 defs.h files.c gram.y mkmakefile.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/config/config.5
cvs rdiff -u -r1.65 -r1.66 src/usr.bin/config/defs.h
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/config/files.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/config/gram.y
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/config/mkmakefile.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/config/config.5
diff -u src/usr.bin/config/config.5:1.26 src/usr.bin/config/config.5:1.27
--- src/usr.bin/config/config.5:1.26 Fri Aug 28 02:59:09 2015
+++ src/usr.bin/config/config.5 Fri Aug 28 09:04:02 2015
@@ -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 @@ Interface attributes can also be defined
.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 @@ instances of the device in the
.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 .
Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.65 src/usr.bin/config/defs.h:1.66
--- src/usr.bin/config/defs.h:1.65 Thu Aug 20 09:44:24 2015
+++ src/usr.bin/config/defs.h Fri Aug 28 09:04:02 2015
@@ -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 @@ struct files {
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 @@ void checkfiles(void);
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 *);
Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.19 src/usr.bin/config/files.c:1.20
--- src/usr.bin/config/files.c:1.19 Fri Aug 28 08:56:39 2015
+++ src/usr.bin/config/files.c Fri Aug 28 09:04:02 2015
@@ -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 @@ initfiles(void)
}
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 @@ addfile(const char *path, struct condexp
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 @@ addfile(const char *path, struct condexp
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;
Index: src/usr.bin/config/gram.y
diff -u src/usr.bin/config/gram.y:1.46 src/usr.bin/config/gram.y:1.47
--- src/usr.bin/config/gram.y:1.46 Tue Nov 4 23:01:23 2014
+++ src/usr.bin/config/gram.y Fri Aug 28 09:04:02 2015
@@ -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 @@ static struct loclist *namelocvals(const
%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 @@ definition:
/* 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 @@ fflag:
| 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; }
Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.39 src/usr.bin/config/mkmakefile.c:1.40
--- src/usr.bin/config/mkmakefile.c:1.39 Fri Aug 28 08:31:28 2015
+++ src/usr.bin/config/mkmakefile.c Fri Aug 28 09:04:02 2015
@@ -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 @@ emitrules(FILE *fp)
}
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));
}
}