INSTALLING 64-BIT AND 32-BIT GCC EXECUTABLES THAT CAN COMPILE TO 64-BIT AND 32-BIT CODE,
AKA MY MINGW OMNI-PACKAGE.

A big thank you to Ferreri Gabriele (megasoft78).

July 9, 2011 (updated 11-18-2011)
---------------------------------
Packages are:
   1. mingw-w64-bin_x86_64-mingw_4.5.2_20110222_multilib_megasoft78.7z
   2. mingw-w64-bin_i686-mingw_4.5.2_20110223_megasoft78.7z
   (available from http://sourceforge.net/projects/mingw-w64)

 1. Decompress packages

 2. Re-name 64-bit (package 1) root folder "mingw".
    Re-name 32-bit (package 2) root folder "mingw32".

 3. Remove these folders:
    a. mingw\mingw
    b. mingw\lib64
    c. mingw\include
    d. mingw\x86_64-w64-mingw32\lib

 4. Re-name \mingw32\bin to bin32 and move to \mingw

 5. Move \mingw32\i686-w64-mingw32 to \mingw

 6. Move \mingw32\libexec\gcc\i686-w64-mingw32 to \mingw\libexec\gcc

 7. Move \mingw32\lib\gcc\i686-w64-mingw32 to \mingw\lib\gcc

 8. Re-name \mingw32\share\man to man32 and move to \mingw\share

 9. Remove \mingw32

10. Move \mingw\x86_64-w64-mingw32\include to \mingw\include

11. Delete all libs in \mingw\x86_64-w64-mingw32 except lib64.

12. Make just one lib dir in \mingw\i686-w64\mingw32 called lib32.

13. Symbolically link \mingw\x86_64-w64-mingw32\lib32 to \mingw\i686-w64-mingw32\lib32:
       mklink /d c:\mingw\x86_64-w64-mingw32\lib32 c:\mingw\i686-w64-mingw32\lib32

14. Add make.exe and rsxnt.dll to c:\mingw\bin and c:\mingw\bin32

15. At this point, c:\mingw\i686-w64-mingw32 should have a bin and a lib32
    folder.  c:\mingw\x86_64-w64-mingw32 should have a bin and a lib64 folder
    and a lib32 symbolic link.

16. Environment variables:
    set c_include_path=c:\mingw\include
    set cplus_include_path=c:\mingw\include

TO USE THE 64-BIT COMPILERS:
    Put c:\mingw\bin in your path and compile with -m32 to make 32-bit exes
        or -m64 to make 64-bit exes.

    Example of "go64.bat" to set up for 64-bit compiles using 64-bit gcc:
        @echo off
        repath -e c:\mingw*\bin
        call _repath.bat
        del _repath.bat
        set c_include_path=d:\mylibs\include;c:\mingw\include
        set cplus_include_path=d:\mylibs\include;c:\mingw\include
        set library_path=d:\mylibs\mingw64;c:\mingw\x86_64-w64-mingw32\lib64
        set libdir=d:\mylibs\mingw64
        set cc=gcc
        set cpp=g++
        set f77=gcc
        set cflags=-O3 -Wall -ffast-math -m64
        gcc -v

    Example of "go32.bat" to set up for 32-bit compiles using 64-bit gcc:
        @echo off
        repath -e c:\mingw*\bin
        call _repath.bat
        del _repath.bat
        set c_include_path=d:\mylibs\include;c:\mingw\include
        set cplus_include_path=d:\mylibs\include;c:\mingw\include
        set library_path=d:\mylibs\mingw32;c:\mingw\x86_64-w64-mingw32\lib32
        set libdir=d:\mylibs\mingw32
        set cc=gcc
        set cpp=g++
        set f77=gcc
        set cflags=-O3 -Wall -ffast-math -m32
        gcc -v


TO USE THE 32-BIT COMPILERS:
    Put c:\mingw\bin32 in your path (they only make 32-bit exes).

    Example of "go32.bat" to set up for 32-bit compiles using 32-bit gcc:
        @echo off
        repath -e c:\mingw*\bin32
        call _repath.bat
        del _repath.bat
        set c_include_path=d:\mylibs\include;c:\mingw\include
        set cplus_include_path=d:\mylibs\include;c:\mingw\include
        set library_path=d:\mylibs\mingw32;c:\mingw\x86_64-w64-mingw32\lib32
        set libdir=d:\mylibs\mingw32
        set cc=gcc
        set cpp=g++
        set f77=gcc
        set cflags=-O3 -Wall -ffast-math -m32
        gcc -v

Note:  Win64 version of repath.exe here.