~ubuntu-branches/ubuntu/saucy/enigma/saucy

5.2.1 by Erich Schubert
* New upstream milestone 5 for the 1.10 release.
1
Building Enigma for Windows
2
===========================
3
4
This file outlines the steps required to build Enigma versions for
5
Windows.  If you find inaccuracies or omissions in this file, please
6
report them to enigma-devel@nongnu.org.
7
8
9
1) Native compilation
10
---------------------
11
12
It seems no one has managed to build Enigma with Visual Studio yet, so
13
you must resort to MinGW port of GNU C++ and the other GNU build
14
tools.  (Setting up a usable build environment is unfortunately more
15
difficult than the following notes suggest; prepare for a certain
16
amount of "tinkering".  But you can always ask for help on the Enigma
17
mailing list.)
18
19
  - Get and install MinGW from www.mingw.org
20
21
  - Get and install the appropriate development packages of
22
23
      * SDL >= 1.2 (www.libsdl.org)
24
      * SDL_mixer >= 1.2.4 (http://www.libsdl.org/projects/SDL_mixer)
25
      * SDL_image >= 1.2.0 (http://www.libsdl.org/projects/SDL_image)
26
      * SDL_ttf  (http://www.libsdl.org/projects/SDL_ttf)
27
      * zlib
28
      * libpng
29
      * Xerces-C
30
31
  - Build Enigma by invoking "./configure && make" from the Enigma
32
    source directory.
33
34
For a more detailed memory log see appendix A)
35
36
2) Cross compilation
37
--------------------
38
39
You can also build Enigma for Windows from Linux.  Because most
40
development tools are readily available on Linux, this may in fact be
41
easier than the native compilation outlined above.  You need:
42
43
  - A Linux version of the MinGW compiler.  Debian has prebuilt packages 
44
    for this (check gcc -v includes --enable-sjlj-exceptions), 
45
    for other distributions try: 
46
    
47
      /etc/build-cross.sh 
48
    
49
    a updated and modified version of the script from
50
      http://www.libsdl.org/extras/win32/cross/README.txt
51
52
  - Get and install the libraries listed above
53
54
  - Configure the Enigma source code using etc/mingw32-configure.sh.
55
    Depending on your setup, you may have to adapt this little script
56
    a little bit.
57
58
  - Run "make"
59
60
For a more detailed memory log see appendix B)
61
62
3) Packaging
63
------------
64
65
There are two ways to package Enigma: Either as a simple .zip file or
66
as a graphical installer.  The script in etc/mingw32-dist.sh builds a
67
.zip package that includes all necessary files.  It also includes in
68
enigma.nsi a simple NSIS script that can be used to build a graphical
69
installer from the zip file.  Here is how:
70
71
  - Install NSIS 2.0 from www.nsis.org (It also runs under Wine if you
72
    are a Linux user).
73
74
  - Build a .zip package.
75
76
  - Extract the zip file and run the NSIS compiler on the included
77
    .nsi file.
78
79
80
4) Additional Notes
81
-------------------
82
83
A) Native MinGW Compilation
84
---------------------------
85
86
Decide where to install mingw,msys and GnuWin32 - the main restriction is are
87
paths without spaces (f.e. D:\MinGW, D:\msys, D:\GnuWin32).
88
89
Install MinGW-version.exe (includes: runtime+w32api+binutils+gcc-[core+g++]+make)
90
91
Install MinSys-version.exe
92
Install msysDTK-version.exe
93
Install msys-autoconf-2.59.tar.bz2 to msys
94
(Install msys-automake-1.8.2.tar.bz2 to msys)
95
96
Execute all shell commands from now on in msys/bash
97
98
Extract texi2html - ./configure;make;make install
99
100
Add GnuWin32/bin to PATH (either Windows or msys/bash)
101
Extract gettext-bin + dep to GnuWin32
102
Extract zip-bin to GnuWin32
103
104
Install upx anywhere in PATH
105
106
SDL-devel-1.2.14-mingw32.tar.gz
107
  extract to a workdir
108
  cp -rv bin lib share include /mingw/
109
  sed 's|^prefix=.*|prefix=/minw/|' <bin/sdl-config > /mingw/bin/i386-mingw32msvc-sdl-config
110
  cp /mingw/share/aclocal/sdl.m4 /share/aclocal/
111
  cp bin/*.dll to enigma/etc
112
113
SDL_ttf-devel-2.0.9-VC8.zip, SDL_mixer-devel-1.2.11-VC.zip, SDL_image-devel-1.2.10-VC.zip
114
  extract
115
  cp includes to /mingw/include/SDL
116
  cp lib/*.lib to /mingw/lib
117
  cp lib/*.dll to enigma/etc
118
119
libpng-1.2.18.tar.gz
120
  extract to workdir
121
  ./configure --prefix=/mingw
122
  make
123
  make install
124
  
125
zlib-1.2.3-lib.zip
126
  extract
127
  cp includes to /mingw/include
128
  cp lib/libz.dll.a to /mingw/lib 
129
130
curl
131
132
xerces-c
133
  ./configure --prefix=/mingw
134
  make
135
  make install
136
  
137
enigma
138
  ./autogen.sh
139
  ./configure
140
  cd etc
141
  ./mingw32-dist.sh
142
  Install etc/enigma.zip
143
144
B) Cross MinGW Compilation
145
---------------------------
146
147
Decide where to install the cross compiler. The project default is
148
/usr/i586-mingw32msvc with root ownership. If you are sure that you are the
149
only cross compile user you can install it in your homedir, too.
150
151
Let us call the installation base path CROSSPREFIX and TARGET the system we 
1.1.9 by Erich Schubert
Import upstream version 1.10~~pre-alpha+r2236
152
build for (default: i586-mingw32msvc). Then we will define
5.2.1 by Erich Schubert
* New upstream milestone 5 for the 1.10 release.
153
CROSSPATH = CROSSPREFIX/TARGET  (default:/usr/i586-mingw32msvc/i586-mingw32msvc)
154
155
etc/build-cross.sh copy as root or user to a workdir
156
  edit PREFIX to your selected CROSSPATH
157
  edit MINGW_URL if appropriate
158
  execute it - this will take some time
159
  (you may save the downloaded source directory - the rest can be deleted)
160
  chown -R root:root CROSSPATH
161
162
SDL-devel-1.2.11-mingw32.tar.gz
163
  extract to a workdir
164
  move include/* to CROSSPATH/include/SDL
165
  edit Makefile CROSS_PATH to your selected CROSSPATH
166
  edit bin/i386-mingw32msvc-sdl-config  prefix to your selected CROSSPATH
167
  make cross
168
  ln -s CROSSPATH/bin/i386-mingw32msvc-sdl-config CROSSPREFIX/bin/sdl-config
169
  cp bin/*.dll to enigma/etc
170
171
SDL_ttf-devel-2.0.9-VC8.zip, SDL_mixer-devel-1.2.8-VC8.zip, SDL_image-devel-1.2.6-VC8.zip
172
  extract
173
  cp includes to CROSSPATH/include/SDL
174
  cp lib/*.lib to CROSSPATH/lib
175
  cp lib/*.dll to enigma/etc
176
177
zlib-1.2.3-lib.zip
178
  extract
179
  cp includes to CROSSPATH/include
180
  cp lib/libz.dll.a to CROSSPATH/lib 
181
182
curl
183
184
xerces-c
185
  cp etc/xerces-mingw-config.sh to base directory of xerces-c
186
  edit xerces-mingw-config.sh - add your CROSSPREFIX/bin to PATH, 
187
    use your TARGET as commandprefix
188
  execute "xerces-mingw-config.sh --prefix=CROSSPATH --disable-transcoder-icu --disable-netaccessor-curl
189
  PATH=CROSSPREFIX/bin:$PATH (the path defined at the beginning!)
190
  make
191
  make install (as root with PATH=CROSSPREFIX/bin:$PATH)
192
193
libpng, curl
194
  build, install like xerces
195
  cp libpng12.dll to enigma/etc
196
197
enigma
198
  export ENIGMADEVDLLS="SDL SDL_image SDL_mixer SDL_ttf jpeg libpng13 zlib"
199
  export ENIGMADEVCROSSPREFIX=CROSSPREFIX (the path defined at the beginning!)
200
  ./autogen.sh
201
  cd etc
202
  ./mingw32-configure.sh
203
  ./mingw32-dist.sh
204
  install etc/enigma.zip on Windows
205