@chenyiliang
2018-07-11T06:53:48.000000Z
字数 7387
阅读 4542
MSYS
## 先执行下面的命令更新MYSYS2系统
pacman -Syu
## 安装 gcc llvm clang 及相关库的命令如下:
pacman -Sy mingw32/mingw-w64-i686-gcc mingw32/mingw-w64-i686-gcc-ada mingw32/mingw-w64-i686-gcc-fortran mingw32/mingw-w64-i686-gcc-libgfortran mingw32/mingw-w64-i686-gcc-libs mingw32/mingw-w64-i686-gcc-objc mingw32/mingw-w64-i686-lcov mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-gcc-ada mingw64/mingw-w64-x86_64-gcc-fortran mingw64/mingw-w64-x86_64-gcc-libgfortran mingw64/mingw-w64-x86_64-gcc-libs mingw64/mingw-w64-x86_64-gcc-objc mingw64/mingw-w64-x86_64-lcov msys/gcc msys/gcc-fortran msys/mingw-w64-cross-gcc mingw32/mingw-w64-i686-clang mingw32/mingw-w64-i686-compiler-rt mingw32/mingw-w64-i686-lld mingw32/mingw-w64-i686-llvm mingw32/mingw-w64-i686-polly mingw64/mingw-w64-x86_64-clang mingw64/mingw-w64-x86_64-compiler-rt mingw64/mingw-w64-x86_64-lld mingw64/mingw-w64-x86_64-llvm mingw64/mingw-w64-x86_64-polly msys/clang-svn msys/lld-svn msys/llvm-svn mingw32/mingw-w64-i686-gdb mingw32/mingw-w64-i686-gdbm mingw64/mingw-w64-x86_64-gdb mingw64/mingw-w64-x86_64-gdbm msys/cgdb msys/gdb msys/gdbm msys/libgdbm msys/libgdbm-devel msys/sharutils msys/perl msys/make msys/icmake msys/cmake mingw32/mingw-w64-i686-cmake mingw32/mingw-w64-i686-dmake mingw32/mingw-w64-i686-make mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-dmake mingw64/mingw-w64-x86_64-make automake autogen python2 python3 mingw32/mingw-w64-i686-binutils mingw64/mingw-w64-x86_64-binutils msys/binutils msys/mingw-w64-cross-binutils mingw32/mingw-w64-i686-clang-analyzer mingw32/mingw-w64-i686-clang-tools-extra mingw64/mingw-w64-x86_64-clang-analyzer mingw64/mingw-w64-x86_64-clang-tools-extra mingw32/mingw-w64-i686-yasm mingw64/mingw-w64-x86_64-yasm msys/yasm msys/yasm-devel mingw32/mingw-w64-i686-nasm mingw64/mingw-w64-x86_64-nasm msys/nasm mingw32/mingw-w64-i686-dbus-glib mingw32/mingw-w64-i686-geocode-glib mingw32/mingw-w64-i686-glib-networking mingw32/mingw-w64-i686-glib2 mingw32/mingw-w64-i686-glibmm mingw32/mingw-w64-i686-json-glib mingw32/mingw-w64-i686-jsonrpc-glib mingw32/mingw-w64-i686-libgda mingw32/mingw-w64-i686-libgit2-glib mingw32/mingw-w64-i686-libgusb mingw32/mingw-w64-i686-libical-glib mingw32/mingw-w64-i686-libvirt-glib mingw32/mingw-w64-i686-taglib mingw32/mingw-w64-i686-template-glib mingw64/mingw-w64-x86_64-dbus-glib mingw64/mingw-w64-x86_64-geocode-glib mingw64/mingw-w64-x86_64-glib-networking mingw64/mingw-w64-x86_64-glib2 mingw64/mingw-w64-x86_64-glibmm mingw64/mingw-w64-x86_64-json-glib mingw64/mingw-w64-x86_64-jsonrpc-glib mingw64/mingw-w64-x86_64-libgda mingw64/mingw-w64-x86_64-libgit2-glib mingw64/mingw-w64-x86_64-libgusb mingw64/mingw-w64-x86_64-libical-glib mingw64/mingw-w64-x86_64-libvirt-glib mingw64/mingw-w64-x86_64-taglib mingw64/mingw-w64-x86_64-template-glib msys/glib2-devel msys/glib2-docs p7zip unrar diffutils subversion git emacs zip mingw32/mingw-w64-i686-libzip mingw64/mingw-w64-x86_64-libzip tar mingw32/mingw-w64-i686-nsis mingw64/mingw-w64-x86_64-nsis msys/autoconf msys/bison msys/cloog-devel msys/diffstat msys/dos2unix msys/gperf msys/groff msys/heimdal-devel msys/icu-devel msys/intltool msys/libbz2-devel msys/libcrypt-devel msys/libcurl-devel msys/libdb-devel msys/libgc-devel msys/libgcrypt-devel msys/libgnutls-devel msys/libnpth-devel msys/ncurses-devel msys/openssl-devel msys/patch msys/patchutils msys/swig mingw32/mingw-w64-i686-ctags mingw64/mingw-w64-x86_64-ctags mingw32/mingw-w64-i686-libtool mingw64/mingw-w64-x86_64-libtool msys/libedit msys/libltdl msys/libtool mingw64/mingw-w64-x86_64-mcpp mingw32/mingw-w64-i686-mcpp mingw32/mingw-w64-i686-cppunit mingw64/mingw-w64-x86_64-cppunit mingw32/mingw-w64-i686-cppcheck mingw32/mingw-w64-i686-antlr4-runtime-cpp mingw32/mingw-w64-i686-cpptest mingw64/mingw-w64-x86_64-cppcheck mingw64/mingw-w64-x86_64-antlr4-runtime-cpp mingw64/mingw-w64-x86_64-cpptest msys/bisonc++ mingw32/mingw-w64-i686-flexdll mingw64/mingw-w64-x86_64-flexdll
pacman -Syu mingw32/mingw-w64-i686-gcc mingw32/mingw-w64-i686-gcc-ada mingw32/mingw-w64-i686-gcc-fortran mingw32/mingw-w64-i686-gcc-libgfortran mingw32/mingw-w64-i686-gcc-libs mingw32/mingw-w64-i686-gcc-objc mingw32/mingw-w64-i686-lcov mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-gcc-ada mingw64/mingw-w64-x86_64-gcc-fortran mingw64/mingw-w64-x86_64-gcc-libgfortran mingw64/mingw-w64-x86_64-gcc-libs mingw64/mingw-w64-x86_64-gcc-objc mingw64/mingw-w64-x86_64-lcov msys/gcc msys/gcc-fortran msys/gcc-libs msys/mingw-w64-cross-gcc mingw32/mingw-w64-i686-clang mingw32/mingw-w64-i686-compiler-rt mingw32/mingw-w64-i686-lld mingw32/mingw-w64-i686-llvm mingw32/mingw-w64-i686-polly mingw64/mingw-w64-x86_64-clang mingw64/mingw-w64-x86_64-compiler-rt mingw64/mingw-w64-x86_64-lld mingw64/mingw-w64-x86_64-llvm mingw64/mingw-w64-x86_64-polly msys/clang-svn msys/lld-svn msys/llvm-svn mingw32/mingw-w64-i686-gdb mingw32/mingw-w64-i686-gdbm mingw64/mingw-w64-x86_64-gdb mingw64/mingw-w64-x86_64-gdbm msys/cgdb msys/gdb msys/gdbm msys/libgdbm msys/libgdbm-devel msys/cmake autogen automake mingw32/mingw-w64-i686-cmake mingw32/mingw-w64-i686-make mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-make git subversion mingw32/mingw-w64-i686-boost mingw64/mingw-w64-x86_64-boost mingw32/mingw-w64-i686-poco mingw64/mingw-w64-x86_64-poco mingw32/mingw-w64-i686-qemu mingw64/mingw-w64-x86_64-qemu mingw32/mingw-w64-i686-soci mingw64/mingw-w64-x86_64-soci mingw32/mingw-w64-i686-libmariadbclient mingw64/mingw-w64-x86_64-libmariadbclient vim mingw32/mingw-w64-i686-freetds mingw32/mingw-w64-i686-nanodbc mingw32/mingw-w64-i686-unixodbc mingw64/mingw-w64-x86_64-freetds mingw64/mingw-w64-x86_64-nanodbc mingw64/mingw-w64-x86_64-unixodbc mingw32/mingw-w64-i686-emacs mingw64/mingw-w64-x86_64-emacs msys/emacs tar p7zip unrar mingw32/mingw-w64-i686-diffutils mingw64/mingw-w64-x86_64-diffutils msys/diffutils mingw32/mingw-w64-i686-mtex2MML mingw64/mingw-w64-x86_64-mtex2MML msys/bison msys/bisonc++ msys/flexc++ mingw32/mingw-w64-i686-cfitsio mingw32/mingw-w64-i686-flexdll mingw64/mingw-w64-x86_64-cfitsio mingw64/mingw-w64-x86_64-flexdll msys/flex msys/libpipeline
wget.exe http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2 && wget.exe http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.bz2 && wget.exe http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.bz2 && wget.exe http://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2 && wget.exe http://ftp.gnu.org/gnu/binutils/binutils-2.28.tar.bz2 && http://ftp.gnu.org/gnu/binutils/binutils-2.29.tar.bz2
../binutils-2.24/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --with-arch=i686 --with-tune=generic --enable-shared --enable-static --enable-libatomic --enable-threads=win32 --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv
mkdir /lib
echo "C:/MSYS/MSYS32/mingw32/bin /lib" >> /etc/fstab