Building GCC Dependencies in the MinGW VM

Generally, the process of building of GCC Dependencies in the MinGW VM is very similar to the same process in the Cygwin VM.

  1. Update C:\MinGW\msys\1.0\opt\crosstool\src\build_gcc_cross.sh :

    #!/bin/bash
    cd /opt/crosstool/src/build-gmp
    ../gmp-5.0.1/configure --disable-shared --enable-static
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to configure libgmp ==="
        exit 1
    fi
    make
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to make libgmp ==="
        exit 1
    fi
    make check
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to check libgmp ==="
        exit 1
    fi
    make install
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to install libgmp ==="
        exit 1
    fi
    
    cd /opt/crosstool/src/build-mpfr
    ../mpfr-3.0.1/configure --with-gmp=/usr/local
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to configure libmpfr ==="
        exit 1
    fi
    make
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to make libmpfr ==="
        exit 1
    fi
    make check
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to check libmpfr ==="
        exit 1
    fi
    make install
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to install libmpfr ==="
        exit 1
    fi
    
    cd /opt/crosstool/src/build-mpc
    ../mpc-0.9/configure --with-gmp=/usr/local
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to configure libmpc ==="
        exit 1
    fi
    make
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to make libmpc ==="
        exit 1
    fi
    make check
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to check libmpc ==="
        exit 1
    fi
    make install
    if [ "$?" -ne "0" ]; then
        echo "=== build script: failed to install libmpc ==="
        exit 1
    fi
    
    echo "=== build script: OK ==="
    
    (Newer versions of GCC also require libelf built in similar manner.)

  2. You may need to reapply dos2unix to build_gcc_cross.sh if your text editor does not preserve DOS/Unix line endings.
  3. Run C:\MinGW\msys\1.0\opt\crosstool\src\build_gcc_cross.cmd and wait until it completes.
  4. If there are no errors, shutdown MinGW VM and make snapshot "SNAP-C".


>> Read next section or buy already prepared cross-compiler (€10) to save your time.