diff options
author | Peter Powell <petpow@saberuk.com> | 2014-10-01 19:52:26 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2014-12-07 22:36:42 +0000 |
commit | 133b110534ec3386d8735020e8679236002b6ed1 (patch) | |
tree | d4850417eb23a175e68a20ab70b5b9912a242e44 /configure | |
parent | 500a0524d94d596b327ed9aaa17fd0a8ce9ebf96 (diff) |
Improve configure cache file handling.
- Add a version number to the configure cache file.
- Disable configure cache file in non-interactive mode.
- Rename configure cache file to .configure.cache to avoid 2.0 files.
- Use run_test to produce the "reading .configure.cache" message.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -119,10 +119,17 @@ our $interactive = !( my %version = get_version(); print_format "<|BOLD Configuring InspIRCd $version{MAJOR}.$version{MINOR}.$version{PATCH}+$version{LABEL} on $^O.|>\n"; -our %config = read_configure_cache(); - -print "Checking for cache from previous configure... "; -print %config ? "found\n" : "not found\n"; +our %config; +if ($interactive) { + %config = read_configure_cache(); + run_test CONFIGURE_CACHE_FILE, %config; + if (!defined $config{VERSION}) { + $config{VERSION} = CONFIGURE_CACHE_VERSION; + } elsif ($config{VERSION} != CONFIGURE_CACHE_VERSION) { + print_warning "ignoring contents of ${\CONFIGURE_CACHE_FILE} as it was generated by an incompatible version of $0!"; + %config = ('VERSION', CONFIGURE_CACHE_VERSION); + } +} $config{CXX} = defined $ENV{CXX} && !system("$ENV{CXX} -v > /dev/null 2>&1") ? $ENV{CXX} : find_compiler(); if ($config{CXX} eq "") { @@ -290,7 +297,7 @@ if (<src/modules/m_ssl_*.cpp> && prompt_bool $interactive, 'Would you like to ge system './tools/genssl', 'auto'; } -write_configure_cache %config; +write_configure_cache %config if $interactive; parse_templates \%config, \%compiler; print_format <<"EOM"; |