mingw-w64

Setting up environment.


apt-cache show mingw-w64
 
Development environment targetting 32- and 64-bit Windows
MinGW-w64 provides a development and runtime environment for 32- and
64-bit (x86 and x64) Windows applications using the Windows API and
the GNU Compiler Collection (gcc).
 
This metapackage provides the MinGW-w64 development environment,
including C and C++ compilers. Ada, Fortran, Objective-C and
Objective-C++ compilers are available respectively in the
gnat-mingw-w64, gfortran-mingw-w64, gobjc-mingw-w64 and
gojbc++-mingw-w64 packages.


apt-get install mingw-w64


dpkg -l | grep mingw
   
binutils-mingw-w64-i686
binutils-mingw-w64-x86-64
g++-mingw-w64
g++-mingw-w64-i686
g++-mingw-w64-x86-64
gcc-mingw-w64
gcc-mingw-w64-base
gcc-mingw-w64-i686
gcc-mingw-w64-x86-64
gfortran-mingw-w64
gfortran-mingw-w64-i686
gfortran-mingw-w64-x86-64
gnat-mingw-w64
gnat-mingw-w64-i686
gnat-mingw-w64-x86-64
mingw-w64
mingw-w64-i686-dev
mingw-w64-x86-64-dev


apt-get remove gfortran-mingw-w64 gnat-mingw-w64
apt-get autoremove

Create a minimal build tree in /usr/i686-w64-mingw32/, containing Windows versions of various standard header files, as well as other files required to compile against Windows libraries. http://www.gtk.org/


cd /usr/i686-w64-mingw32
sed -i 's|^prefix=.*$|prefix=/usr/i686-w64-mingw32|g' lib/pkgconfig/*.pc
cd lib
for f in *.lib; do mv $f lib${f%%lib}a; done

mingw-pkg-config


#!/bin/sh
PKG_CONFIG_LIBDIR=/usr/i686-w64-mingw32/lib/pkgconfig \
PKG_CONFIG_PATH=/usr/i686-w64-mingw32/lib/pkgconfig pkg-config $*

.bashrc


alias gcc-win32='i686-w64-mingw32-gcc -g -Wall -Wextra -static-libgcc'
alias g++-win32='i686-w64-mingw32-g++ -g -Wall -Wextra -static-libgcc -static-libstdc++'
alias pkg-config-win32='mingw-pkg-config --cflags --libs gtk+-2.0'