Disable database verification unless debug enabled.

The database verification can take a long time.  Only enable it if debug mode
is enabled.  If MAKE_MAINTAINER_MODE is set, it's also enabled by default.
This commit is contained in:
Paul Smith 2013-06-21 23:59:38 -04:00
parent 353fcfdb30
commit bee4d93a59
4 changed files with 59 additions and 42 deletions

View file

@ -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

2
file.c
View file

@ -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 != '.')

21
main.c
View file

@ -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,9 +653,7 @@ 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;
@ -688,10 +690,11 @@ decode_debug_flags (void)
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,6 +3355,7 @@ die (int status)
if (print_data_base_flag)
print_data_base ();
if (verify_flag)
verify_file_data_base ();
clean_jobserver (status);

View file

@ -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;