diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | main.c | 87 | ||||
-rw-r--r-- | makeint.h | 2 |
4 files changed, 59 insertions, 42 deletions
@@ -1,3 +1,13 @@ +2013-06-21 Paul Smith <psmith@gnu.org> + + * main.c (verify_flag): Global variable to determine whether to + verify the database or not. + (decode_debug_flags): If debug mode, enable verify_flag. + (main): If MAKE_MAINTAINTER_MODE, enable verify_flag, otherwise not. + (die): Only verify the database if verify_flag is set. + * file.c (enter_file): Don't check caching unless verify_flag. + * makeint.h: Export verify_flag. + 2013-05-27 Paul Smith <psmith@gnu.org> * variable.c (define_automatic_variables): Create a new variable @@ -153,7 +153,7 @@ enter_file (const char *name) struct file file_key; assert (*name != '\0'); - assert (strcache_iscached (name)); + assert (! verify_flag || strcache_iscached (name)); #if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS) if (*name != '.') @@ -130,6 +130,10 @@ struct stringlist /* The recognized command switches. */ +/* Nonzero means do extra verification (that may slow things down). */ + +int verify_flag; + /* Nonzero means do not print commands to be executed (-s). */ int silent_flag; @@ -649,49 +653,48 @@ decode_debug_flags (void) if (debug_flag) db_level = DB_ALL; - if (!db_flags) - return; + if (db_flags) + for (pp=db_flags->list; *pp; ++pp) + { + const char *p = *pp; - for (pp=db_flags->list; *pp; ++pp) - { - const char *p = *pp; + while (1) + { + switch (tolower (p[0])) + { + case 'a': + db_level |= DB_ALL; + break; + case 'b': + db_level |= DB_BASIC; + break; + case 'i': + db_level |= DB_BASIC | DB_IMPLICIT; + break; + case 'j': + db_level |= DB_JOBS; + break; + case 'm': + db_level |= DB_BASIC | DB_MAKEFILES; + break; + case 'v': + db_level |= DB_BASIC | DB_VERBOSE; + break; + default: + fatal (NILF, _("unknown debug level specification '%s'"), p); + } - while (1) - { - switch (tolower (p[0])) - { - case 'a': - db_level |= DB_ALL; - break; - case 'b': - db_level |= DB_BASIC; - break; - case 'i': - db_level |= DB_BASIC | DB_IMPLICIT; - break; - case 'j': - db_level |= DB_JOBS; - break; - case 'm': - db_level |= DB_BASIC | DB_MAKEFILES; - break; - case 'v': - db_level |= DB_BASIC | DB_VERBOSE; - break; - default: - fatal (NILF, _("unknown debug level specification '%s'"), p); - } + while (*(++p) != '\0') + if (*p == ',' || *p == ' ') + break; - while (*(++p) != '\0') - if (*p == ',' || *p == ' ') + if (*p == '\0') break; + } + } - if (*p == '\0') - break; - - ++p; - } - } + if (db_level) + verify_flag = 1; } static void @@ -1048,7 +1051,10 @@ main (int argc, char **argv, char **envp) /* Needed for OS/2 */ initialize_main (&argc, &argv); - reading_file = 0; +#ifdef MAKE_MAINTAINER_MODE + /* In maintainer mode we always enable verification. */ + verify_flag = 1; +#endif #if defined (__MSDOS__) && !defined (_POSIX_SOURCE) /* Request the most powerful version of 'system', to @@ -3349,7 +3355,8 @@ die (int status) if (print_data_base_flag) print_data_base (); - verify_file_data_base (); + if (verify_flag) + verify_file_data_base (); clean_jobserver (status); @@ -561,7 +561,7 @@ extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag; extern int print_version_flag, print_directory_flag, check_symlink_flag; extern int warn_undefined_variables_flag, trace_flag, posix_pedantic; extern int not_parallel, second_expansion, clock_skew_detected; -extern int rebuilding_makefiles, one_shell, output_sync; +extern int rebuilding_makefiles, one_shell, output_sync, verify_flag; /* can we run commands via 'sh -c xxx' or must we use batch files? */ extern int batch_mode_shell; |