From af744cea8013bb50a297928da974d30d24ede283 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 27 Sep 2019 17:01:22 +0200 Subject: [PATCH] build system: verify configured host type is same as current host type --- Rakefile | 1 + rake.d/helpers.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Rakefile b/Rakefile index 816a578da..a8e7f83fc 100644 --- a/Rakefile +++ b/Rakefile @@ -277,6 +277,7 @@ def define_default_task end # main +verify_current_host_is_same_as_configured setup_globals setup_overrides import_dependencies diff --git a/rake.d/helpers.rb b/rake.d/helpers.rb index fde8267f9..da20ddbdd 100644 --- a/rake.d/helpers.rb +++ b/rake.d/helpers.rb @@ -287,6 +287,13 @@ def update_version_number_include end end +def verify_current_host_is_same_as_configured + current_host = `#{$source_dir}/config.guess 2> /dev/null`.chomp + return if !current_host || (current_host == c(:host)) + + fail "Error: The source tree was configured on a different host system type (#{c(:host)}) than the current one (#{current_host}). This is not supported." +end + class Rake::Task def mo_all_prerequisites todo = [name]