Behavior about the value of HOSTTYPE and MACHTYPE is not compatible
between various POSIX compliant shells. For example zsh doesn't set
HOSTTYPE at all and set MACHTYPE to that of HOSTTYPE in bash. I
checked source tree of bash and found that HOSTTYPE is set to the
result of `uname -m` and that MACHTYPE is set to the result of `uname
-m` plus "-pc-msys".So change code accordingly.
This fixes issue #2008.
Co-authored-by: Yasuhiro KIMURA <yasu@utahime.org>
Now users don't need to override installation prefix for MinGW programs and
'configure' scripts use more compatible triplet 'x86_64-w64-mingw32`
automatically instead of 'x86_64-pc-mingw64`.
MSYSTEM now defaults to MSYS when not specified, and there is no
different behavior anymore between empty value and MSYS, for example
/opt/bin was not being added to path when not setting MSYSTEM. This
removes the need for explicitly setting the variable, since a default
value is now implied.
* New script /etc/msystem providing information associated with the
current MSYSTEM. This is sourced by /etc/profile but can be used by
non-login scripts for getting information such as the current
compiler architecture or mount point.
* New script /usr/bin/shell for switching between shells without
restarting MSYS2. This can be used in interactive sessions but also
from shell scripts for switching the MSYSTEM without restarting bash
or spawning a subshell.
* Allow /etc/profile to be sourced multiple times without continuously
appending stuff to PATH or losing track of the original Windows TEMP.
Also implemented for /etc/profile.d/perlbin.sh, so perl path is not
repeatedly appended.