Add CMake toolchain script for mingw32/64 compilation, and update documentation
[freeglut] / README.mingw_cross
1 Cross-compilation from GNU/Linux (static and shared DLL)
2 ========================================================
3
4 Install MinGW, and specify which MinGW you're using:
5
6 - on Debian/Ubuntu, mingw-w64, 32-bit executables:
7
8   apt-get install mingw-w64
9   GNU_HOST=i686-w64-mingw32
10
11 - on Debian/Ubuntu, mingw-w64, 64-bit executables:
12
13   apt-get install mingw-w64
14   GNU_HOST=x86_64-w64-mingw32
15
16 - on Fedora, mingw32, 32-bit executables:
17
18   yum install mingw32-gcc
19   GNU_HOST=i686-pc-mingw32
20
21 - on Debian/Ubuntu, mingw32 (deprecated):
22
23   apt-get install mingw32
24   GNU_HOST=i586-mingw32msvc
25
26
27 With the GNU Autotools
28 ----------------------
29
30 Cross-compile with:
31
32   ./configure --host=$GNU_HOST --prefix=/freeglut
33   make -j4
34   make install DESTDIR=$(pwd)
35
36 Everything is now in the new 'freeglut/' directory.
37 The .dll is in 'freeglut/bin/'.
38
39
40 With CMake
41 ----------
42
43 Cross-compile with:
44
45   cmake \
46     -D GNU_HOST=$GNU_HOST \
47     -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain.cmake \
48     -D CMAKE_INSTALL_PREFIX=/freeglut \
49     .
50   make -j4
51   make install DESTDIR=$(pwd)
52
53 Everything is now in the new 'freeglut/' directory.
54 The .dll is in 'freeglut/lib/'.
55
56
57 Compiling your code
58 -------------------
59
60 Compilation of your own programs is done as usual.
61 See README.cygwin_mingw for details.