Index: trunk/scconfig/Makefile =================================================================== --- trunk/scconfig/Makefile (revision 2984) +++ trunk/scconfig/Makefile (revision 2985) @@ -64,7 +64,14 @@ CFLAGS = $(USER_CFLAGS) $(DEFAULT_CFLAGS) $(SCRIPT_CFLAGS) $(PARSER_CFLAGS) $(GENERATOR_CFLAGS) $(TMPASM_CFLAGS) $(C99_CFLAGS) $(PARSGEN_CFLAGS) $(MATH_CFLAGS) $(SOCKET_CFLAGS) $(USERPASS_CFLAGS) $(GUI_CFLAGS) $(SUL_CFLAGS) $(MENULIB_CFLAGS) -Isrc/default LDFLAGS = $(USER_LDFLAGS) $(DEFAULT_LDFLAGS) $(SCRIPT_LDFLAGS) $(PARSER_LDFLAGS) $(GENERATOR_LDFLAGS) $(TMPASM_LDFLAGS) $(C99_LDFLAGS) $(PARSGEN_LDFLAGS) $(MATH_LDFLAGS) $(SOCKET_LDFLAGS) $(USERPASS_LDFLAGS) $(GUI_LDFLAGS) $(SUL_LDFLAGS) $(MENULIB_LDFLAGS) +all: configure revtest +revtest: revtest.o + $(CC) -o revtest revtest.o + +revtest.o: revtest.c Rev.h + $(CC) -c $(CFLAGS) -o revtest.o revtest.c + configure: $(OBJS) $(DEFAULT_MAIN_OBJS) $(CC) -o configure $(OBJS) $(DEFAULT_MAIN_OBJS) @@ -77,7 +84,7 @@ menucfg.o: menucfg.c $(CC) -c $(CFLAGS) -o menucfg.o menucfg.c -hooks.o: plugin_3state.h plugins.h +hooks.o: plugin_3state.h plugins.h Rev.h cquote: cquote.c Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (nonexistent) +++ trunk/scconfig/Rev.h (revision 2985) @@ -0,0 +1 @@ +static const int myrev = 2984; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (nonexistent) +++ trunk/scconfig/Rev.tab (revision 2985) @@ -0,0 +1 @@ +2984 configure Introduction of the config-rev system. Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 2984) +++ trunk/scconfig/hooks.c (revision 2985) @@ -8,6 +8,7 @@ #include "tmpasm.h" #include "tmpasm_scconfig.h" #include "util/arg_auto_set.h" +#include "Rev.h" #define version "1.1.1" @@ -581,9 +582,18 @@ #define plugin_dep(plg, on) #include "plugins.h" - if (repeat != NULL) + if (repeat != NULL) { printf("\n%s\n", repeat); } + + { + FILE *f; + f = fopen("Rev.stamp", "w"); + fprintf(f, "%d", myrev); + fclose(f); + } + + } else fprintf(stderr, "Error generating some of the files\n"); Index: trunk/scconfig/revtest.c =================================================================== --- trunk/scconfig/revtest.c (nonexistent) +++ trunk/scconfig/revtest.c (revision 2985) @@ -0,0 +1,76 @@ +#include +#include +#include +#include "Rev.h" + +const char *act_names[] = { + "distclean", + "configure", + "make clean", + NULL +}; + +int act_needed[16]; + +int main(int argc, char *argv[]) +{ + char line[8192]; + int res = 0, stamp = 0, banner = 0; + FILE *f; + + f = fopen(argv[1], "r"); + if (f != NULL) { + fscanf(f, "%d", &stamp); + fclose(f); + } + + while(fgets(line, sizeof(line), stdin) != NULL) { + char *end; + int rev; + + if (*line == '#') + continue; + rev = strtol(line, &end, 10); + if (*end != '\t') + continue; + + if (rev > stamp) { + char *act, *txt; + const char **a; + int idx; + res = 1; + act = end; + while(*act == '\t') + act++; + txt = strchr(act, '\t'); + if (txt != NULL) { + *txt = '\0'; + txt++; + while(*txt == '\t') + txt++; + } + if (!banner) { + fprintf(stderr, "\nYour source tree is stale (last configured at r%d). Recent new features:\n", stamp); + banner = 1; + } + fprintf(stderr, "\nr%d: %s\n", rev, txt); + for(idx = 0, a = act_names; *a != NULL; idx++, a++) + if (strstr(act, *a) != NULL) + act_needed[idx]++; + } + } + + if (res) { + const char **a; + int idx; + + fprintf(stderr, "(Stamp: %d myrev: %d)\n", stamp, myrev); + fprintf(stderr, "\nBefore running make, please do the following actions in this order:\n"); + for(idx = 0, a = act_names; *a != NULL; idx++, a++) + if (act_needed[idx]) + fprintf(stderr, " run %s\n", *a); + fprintf(stderr, "\n"); + } + + return res; +}