equal
deleted
inserted
replaced
12 |
12 |
13 |
13 |
14 # Guess the value of BUILD_TARGET for system on which we're currently |
14 # Guess the value of BUILD_TARGET for system on which we're currently |
15 # running in form of GNU target triplet, such as `x86_64-pc-linux-gnu`. |
15 # running in form of GNU target triplet, such as `x86_64-pc-linux-gnu`. |
16 # Essentially a wrapper for config.guess used with autotools. |
16 # Essentially a wrapper for config.guess used with autotools. |
17 def build_target_guess() |
17 def build_target_guess |
18 return `./config.guess`.chop() |
18 target = `sh config.guess`.chop |
19 end |
19 # Workaround for MSYS2 / MINGW environment. When using MSYS2 environment to build |
20 |
20 # Smalltalk/X, GNU config.guess reports `x86_64-pc-msys` rather than `i686-pc-mingw32` |
21 unless defined? BUILD_TARGET; BUILD_TARGET = ENV['BUILD_TARGET'] || build_target_guess(); end |
21 # or `x86_64-w64-mingw32` which are the values used by CI and/or third-party libraries. |
|
22 # Therefore we unify the value here (at least for now). |
|
23 case target |
|
24 when 'x86_64-pc-msys' |
|
25 target = 'x86_64-w64-mingw32' |
|
26 end |
|
27 # /Workaround |
|
28 return target |
|
29 end |
|
30 |
|
31 unless defined? BUILD_TARGET; BUILD_TARGET = ENV['BUILD_TARGET'] || build_target_guess; end |
22 |
32 |
23 unless defined? TOOLCHAIN |
33 unless defined? TOOLCHAIN |
24 if ENV.has_key? 'TOOLCHAIN' |
34 if ENV.has_key? 'TOOLCHAIN' |
25 TOOLCHAIN = ENV['TOOLCHAIN'] |
35 TOOLCHAIN = ENV['TOOLCHAIN'] |
26 else |
36 else |