Important Note: The build environment described here is used for development of the MSYS  product itself; it is not applicable for users who simply wish to use MSYS, as a working environment for developing normal MS-Windows applications, (presumably using MinGW  as the compiler suite). The overwhelming majority of MSYS users do not need to set up any such "MSYS Build Environment".
The MSYS build environment is one whose GNU canonical system name (like returned by "uname -s") will have MSYS_ as the beginning portion of the string. The MSYS build environment is used to build the tools distributed by MSYS. The binaries it creates are dependent on the msys-1.0.dll runtime, which provides thin POSIX layer.
The easiest way to make sure all necessary packages are installed is to let mingw-get do the job:
mingw-get install msys-dvlpr
By default, MSYS gets installed into <MinGW_root>\msys\1.0 and can be entered executing "msys.bat MSYS" from there. That will open new window with MSYS in its title and different color scheme if rxvt is used. In MSYS environment $PATH is set so /bin preceedes /mingw/bin, therefore msys-gcc becomes default compiler (gcc -v should state "msys special").
On the contrary in MinGW environment (entered executing "msys.bat" without parameter) /mingw/bin path preceedes /bin, therefore mingw32-gcc is found first, thus gcc -v states "GCC").
To help identify the runtime build and the the current working directory, following can be added to ~/.profile file.
# Determine windows path W=`pwd -W` # Determine identifying version info V=`echo -n \`uname -r | cut -d \( -f 1\`-\`uname -v | sed -e 's/ /@/'\`` # Reset bash prompt export PS1='\[\033]0;$MSYSTEM-$V($W):\w\007 \033[47m\033[30m\]\u@\h \[\033[47m\033[35m\w\033[0m\] $ '
Similar profile commands can be established on remote systems to help identify the remote window in the task bar.
See also the following for more hints and suggestions:
[FIXME: these references all point to the old, now-deprecated MinGWiki; the original pages need to be migrated].
MinGW/MSYS Source Forge home page: