Files
MSYS2-packages/filesystem/msystem
Yasuhiro KIMURA 4a6f6a1511 filesystem: Make msystem compatible with POSIX compliant shells. (#2009)
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>
2020-06-23 08:11:26 +03:00

54 lines
1.8 KiB
Plaintext

# MSYSTEM Environment Information
# Copyright (C) 2016 Renato Silva
# Licensed under public domain
# Once sourced, this script provides common information associated with the
# current MSYSTEM. For example, the compiler architecture and host type.
# The MSYSTEM_ prefix is used for avoiding too generic names. For example,
# makepkg is sensitive to the value of CARCH, so MSYSTEM_CARCH is defined
# instead. The MINGW_ prefix does not influence makepkg-mingw variables and
# is not used for the MSYS shell.
export MSYSTEM="${MSYSTEM:-MSYS}"
unset MSYSTEM_PREFIX
unset MSYSTEM_CARCH
unset MSYSTEM_CHOST
unset MINGW_CHOST
unset MINGW_PREFIX
unset MINGW_PACKAGE_PREFIX
unset CONFIG_SITE
case "${MSYSTEM}" in
MINGW32)
MSYSTEM_PREFIX='/mingw32'
MSYSTEM_CARCH='i686'
MSYSTEM_CHOST='i686-w64-mingw32'
MINGW_CHOST="${MSYSTEM_CHOST}"
MINGW_PREFIX="${MSYSTEM_PREFIX}"
MINGW_PACKAGE_PREFIX="mingw-w64-${MSYSTEM_CARCH}"
CONFIG_SITE="${MSYSTEM_PREFIX}/etc/config.site"
export MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE
;;
MINGW64)
MSYSTEM_PREFIX='/mingw64'
MSYSTEM_CARCH='x86_64'
MSYSTEM_CHOST='x86_64-w64-mingw32'
MINGW_CHOST="${MSYSTEM_CHOST}"
MINGW_PREFIX="${MSYSTEM_PREFIX}"
MINGW_PACKAGE_PREFIX="mingw-w64-${MSYSTEM_CARCH}"
CONFIG_SITE="${MSYSTEM_PREFIX}/etc/config.site"
export MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST MINGW_CHOST MINGW_PREFIX MINGW_PACKAGE_PREFIX CONFIG_SITE
;;
*)
MSYSTEM_PREFIX='/usr'
MSYSTEM_CARCH="$(/usr/bin/uname -m)"
MSYSTEM_CHOST="$(/usr/bin/uname -m)-pc-msys"
CONFIG_SITE="/etc/config.site"
export MSYSTEM_PREFIX MSYSTEM_CARCH MSYSTEM_CHOST CONFIG_SITE
;;
esac