diff options
-rw-r--r-- | usr.sbin/config/configvers.h | 11 | ||||
-rw-r--r-- | usr.sbin/config/mkmakefile.c | 13 |
2 files changed, 22 insertions, 2 deletions
diff --git a/usr.sbin/config/configvers.h b/usr.sbin/config/configvers.h new file mode 100644 index 0000000..8a14166 --- /dev/null +++ b/usr.sbin/config/configvers.h @@ -0,0 +1,11 @@ +/* + * 6 digits of version. The most significant are branch indicators + * (eg: RELENG_2_2 = 22, -current presently = 30 etc). The least + * significant digits are incremented for each incompatable change. + * + * The numbering scheme is inspired by the sys/conf/newvers.sh RELDATE + * and <osreldate.h> system. + * + * $Id$ + */ +#define CONFIGVERS 300002 diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index d1d7585..852f86e 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); |