aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-10-22 00:38:48 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-10-22 00:38:48 +0000
commit463fb43b0a92551296d2e723432f61f7ca521cd7 (patch)
treea1226f2668814f8f3292d6f6df892960628a4749 /usr.sbin/config/mkmakefile.c
parentbaa42bb2cc3b66fea0484a28a66c6bd900a69795 (diff)
downloadsrc-463fb43b0a92551296d2e723432f61f7ca521cd7.tar.gz
src-463fb43b0a92551296d2e723432f61f7ca521cd7.zip
Recognize a %VERSREQ=nnnnn string in the system Makefile. Both config(8)
and the kernel will have a 'config interface version number'. If an incompatable change is made to the kernel that requires a rebuild of config(8) (such as the cam devtab stuff), then the version number would be bumped in both places. If a user neglects to rebuild config, then they will get a nagging (but non-fatal) warning that they need to rebuild config.
Notes
Notes: svn path=/head/; revision=30638
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index d1d758516cf4..852f86ea2780 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: mkmakefile.c,v 1.22 1997/09/15 06:37:09 charnier Exp $";
#endif /* not lint */
/*
@@ -51,6 +51,7 @@ static const char rcsid[] =
#include <string.h>
#include "y.tab.h"
#include "config.h"
+#include "configvers.h"
#define next_word(fp, wd) \
{ register char *word = get_word(fp); \
@@ -162,6 +163,7 @@ makefile()
struct opt *op;
struct users *up;
int warn_make_clean = 0;
+ int versreq;
read_files();
strcpy(line, "Makefile.");
@@ -242,7 +244,14 @@ makefile()
do_load(ofp);
else if (eq(line, "%CLEAN\n"))
do_clean(ofp);
- else
+ else if (strncmp(line, "%VERSREQ=", sizeof("%VERSREQ=") - 1) == 0) {
+ versreq = atoi(line + sizeof("%VERSREQ=") - 1);
+ if (versreq != CONFIGVERS) {
+ fprintf(stderr, "WARNING: version of config(8) does not match kernel!\n");
+ fprintf(stderr, "config version = %d, ", CONFIGVERS);
+ fprintf(stderr, "version required = %d\n", versreq);
+ }
+ } else
fprintf(stderr,
"Unknown %% construct in generic makefile: %s",
line);