diff options
author | Paul Smith <psmith@gnu.org> | 2013-06-21 23:59:38 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2013-06-21 23:59:38 -0400 |
commit | bee4d93a591f7f729717f6079f7d62ef555d9887 (patch) | |
tree | cc35fa6eb6d54f4d733b39283985b3fdf9d6c43b /main.c | |
parent | 353fcfdb30c96f14c550656f068b6d2c4ad88a86 (diff) | |
download | gunmake-bee4d93a591f7f729717f6079f7d62ef555d9887.tar.gz |
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.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 87 |
1 files changed, 47 insertions, 40 deletions
@@ -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); |