Building GCC Dependencies in the Cygwin VM

  1. Update C:\Cygwin\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:\Cygwin\opt\crosstool\src\build_gcc_cross.cmd and wait until it completes.
  4. If there are no errors, shutdown Cygwin VM and make snapshot "SNAP-3".


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