summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure17
1 files changed, 12 insertions, 5 deletions
diff --git a/configure b/configure
index 55880fab6..de45bdc79 100755
--- a/configure
+++ b/configure
@@ -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";