--- a/rakelib/setup.rake Wed Jun 27 21:21:19 2018 +0100
+++ b/rakelib/setup.rake Mon Aug 20 15:22:44 2018 +0200
@@ -14,11 +14,21 @@
# Guess the value of BUILD_TARGET for system on which we're currently
# running in form of GNU target triplet, such as `x86_64-pc-linux-gnu`.
# Essentially a wrapper for config.guess used with autotools.
-def build_target_guess()
- return `./config.guess`.chop()
+def build_target_guess
+ target = `sh config.guess`.chop
+ # Workaround for MSYS2 / MINGW environment. When using MSYS2 environment to build
+ # Smalltalk/X, GNU config.guess reports `x86_64-pc-msys` rather than `i686-pc-mingw32`
+ # or `x86_64-w64-mingw32` which are the values used by CI and/or third-party libraries.
+ # Therefore we unify the value here (at least for now).
+ case target
+ when 'x86_64-pc-msys'
+ target = 'x86_64-w64-mingw32'
+ end
+ # /Workaround
+ return target
end
-unless defined? BUILD_TARGET; BUILD_TARGET = ENV['BUILD_TARGET'] || build_target_guess(); end
+unless defined? BUILD_TARGET; BUILD_TARGET = ENV['BUILD_TARGET'] || build_target_guess; end
unless defined? TOOLCHAIN
if ENV.has_key? 'TOOLCHAIN'