1
1
Compiling the Source Code:
2
2
--------------------------
4
Well, for the moment, zsnes source may be a little hard to compile. Here
4
Well, for the moment, zsnes source may be a little hard to compile. Here
5
5
is a quick guide (based on my own experience and on a doc written by zsKnight)
6
6
explaining how to compile zsnes. With these tools, I can build both dos and
7
7
win version, I hope it will also work for you
9
(slightly updated by stainless)
9
Note to see the bottom of this document if you are compiling releases for
10
distribution as opposed to CVS/SVN/WIP for personal use.
12
12
First, you need the following software:
15
- NASM v0.98.39 or higher
16
- DJGPP v2 or higher, (GCC also installed) : http://www.delorie.com/djgpp/
15
- NASM v0.98.39 or higher : http://nasm.sourceforge.net
16
- DJGPP v2.03 or higher, (GCC also installed) : http://www.delorie.com/djgpp/
17
17
using the zip picker, the default choices are ok if you
18
check C and C++ in the programming languages. You also need
19
to get zlib which is available with the full distribution
20
of djgpp. You can get it at :
21
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2tk/zlib112b.zip
22
- zlib : http://www.info-zip.org/pub/infozip/zlib/
18
check C and C++ in the programming languages.
19
- zlib v1.2.3 or higher : http://www.zlib.net
23
20
- libpng : http://www.libpng.org/
24
21
Build the static versions of both of these libraries using
25
22
DJGPP and do a 'make install' to put them where DJGPP
26
23
can find them. Afterwards you can go ahead and delete
27
24
the source for them from your hard drive.
25
- PDCurses : http://pdcurses.sourceforge.net
26
Only needed if you compile with the debugger.
29
28
Then to build the executable, go to the src directory and type:
30
29
make -f makefile.ms PLATFORM=dos
33
32
it will divide its size by 10.
36
DOS port cross compiling:
35
DOS port cross compiling:
37
36
-You need to get the DJGPP cross compiler and everything else mentioned above.
38
-You might need to edit makefile.ms and change
37
-You might need to edit makefile.ms and change
39
38
i386-pc-msdosdjgpp-gcc and i386-pc-msdosdjgpp-g++ to something else.
41
40
Then to build the executable, go to the src directory and type:
44
43
If you have any problems we will probably not help you as cross compiling
45
44
is an advanced feature only for people who know what they are doing.
49
Windows port with MSVC:
50
- GNU Make : it comes with djgpp
48
Windows port with MSVC:
49
- GNU Make : http://unxutils.sourceforge.net/
51
50
- NASM v0.98.39 : http://nasm.sf.net/
52
51
- MSVC++ 6.0 or higher : not freely available, you'll have to buy it
53
You need to run VCVARS32.BAT. If you get an
54
out of environment space error, type 'command /e:32768'
55
(to create a new command.com entity with more
52
You need to run VCVARS32.BAT. If you get an
53
out of environment space error, type 'command /e:32768'
54
(to create a new command.com entity with more
57
56
I have been able to successfully build ZSNES using the
58
57
Intel C++ drop-in replacement for Microsoft's C++ compiler
61
60
compiler could provide any useful optimizations (maybe
63
62
- DX8.0 SDK or higher : you can get it at microsoft.com. It is quite big.
64
Also, edit makefile.win to set the correct path to your
65
SDK. I also had some problems with vc++ using its own
66
(old) directx headers instead of the sdk headers. I replaced
67
these old headers (in the include directory of vc++ dir)
63
Also, edit makefile.ms to set the correct path to your
64
SDK. I also had some problems with vc++ using its own
65
(old) directx headers instead of the sdk headers. I replaced
66
these old headers (in the include directory of vc++ dir)
68
67
with the newer ones.
69
- zlib : http://www.info-zip.org/pub/infozip/zlib/
70
you need the Win9x/WinNT static library (the dll version
71
doesn't seem to work with zsnes). Rename the static version
72
to zlib.lib and put it somewhere where vc++ will find it
68
- zlib v1.2.3 or higher : http://www.zlib.net
69
you need the Win9x/WinNT static library (the dll version
70
doesn't seem to work with zsnes). Rename the static version
71
to zlib.lib and put it somewhere where vc++ will find it
73
72
(for example, the lib directory in vc++ dir).
74
73
- libpng : http://www.libpng.org/
75
74
I'm not sure if the dynamically linked version of libpng
77
76
go ahead and build the static version. Rename it to libpng.lib
78
77
and put it somewhere where MSVC++ will find it (usually the
79
78
lib subdirectory of your main MSVC++ directory).
79
- PDCurses : http://pdcurses.sourceforge.net
81
81
Then to build the executable, go to the src directory and type:
82
82
make -f makefile.ms PLATFORM=msvc
89
89
Windows port with MinGW:
90
- GNU Make : it comes with djgpp
91
- NASM v0.98.39 : http://nasm.sf.net/
92
You will need to add the GNUWIN32 patch.
93
To find the patch though, you'll have to do some searching.
90
- GNU Make (don't use included in mingw): http://unxutils.sourceforge.net/
91
- NASM v0.98.39 : http://nasm.sf.net/
94
92
- MinGW : http://www.mingw.org
95
93
- Latest Win32API : http://www.mingw.org
96
- zlib : http://www.info-zip.org/pub/infozip/zlib/
94
- DirectX 8+ for MinGW : Parts of it are included with Win32API, parts aren't.
95
Check http://www.talula.demon.co.uk/allegro/wip.html
96
and http://www.talula.demon.co.uk/allegro/wip.html
97
for the rest of DirectX for MinGW.
98
- zlib v1.2.3 or higher : http://www.zlib.net
97
99
- libpng : http://www.libpng.org/
100
- PDCurses : http://pdcurses.sourceforge.net
101
Only needed if you compile with the debugger.
99
103
Then to build the executable, go to the src directory and type:
100
104
make -f makefile.ms PLATFORM=win32
103
107
it will divide its size by 10.
106
Windows port cross compiling:
110
Windows port cross compiling:
107
111
-You need to get the MinGW cross compiler and everything else mentioned above.
108
-You might need to edit makefile.ms and change
109
i586-mingw32msvc-gcc, i586-mingw32msvc-g++, and i586-mingw32msvc-windres
112
-You might need to edit makefile.ms and change
113
i586-mingw32-gcc, i586-mingw32-g++, and i586-mingw32-windres
110
114
to something else.
112
116
Then to build the executable, go to the src directory and type:
115
119
If you have any problems we will probably not help you as cross compiling
116
120
is an advanced feature only for people who know what they are doing.
120
124
Linux/SDL/POSIX port:
121
125
I assume the standard development tools are installed (gcc, make, ...)
123
127
- SDL (Simple DirectMedia Layer) : check www.libsdl.org to grab SDL 1.2.0 or
124
128
later. If you are using rpm packages, don't
125
129
forget the -devel package.
126
130
- NASM v0.98.39 : http://nasm.sf.net/
127
- zlib : http://www.info-zip.org/pub/infozip/zlib/
128
it is probably already installed on your
129
system, maybe you are just missing the
130
development headers. Check in the
131
packages available with your distribution
131
- zlib v1.2.3 or higher : http://www.zlib.net
132
it is probably already installed on your
133
system, maybe you are just missing the
134
development headers. Check in the
135
packages available with your distribution
132
136
or go to the page above
133
137
- libpng : http://www.libpng.org/
134
138
You might also need libpng, ZSNES will compile without
136
140
unstable for some weird reason. If you don't have
137
141
libpng, either get it and install it or pass the
138
142
--without-png option to the 'configure' script.
144
Check your distro. One of these is needed if you compile with
145
the debugger enabled. You may also have to symlink ncurses.h
146
to curses.h in your include directory.
140
148
Then to build the executable, go to the src directory and type:
141
149
sh ./autogen.sh && gmake && gmake install
143
Note: you require root to install zsnes to the the default (/usr/local/*)
151
Note: This only covers SVN/WIP builds, for releases see instructions below.
153
Note: autogen.sh requires automake and autoconf installed. Any parse errors
154
you recieve about configure.in are due to those not being installed.
156
Note: you require root to install zsnes to the the default (/usr/local/*)
146
Also Note: libpng (optional) needs to be recent, or zsnes will not use it
159
Also Note: libpng (optional) needs to be recent, or zsnes will not use it
148
161
You may also want to compress the zsnes executable with upx
149
162
(http://upx.sourceforge.net), it will divide its size by 10.
165
Compiling for official builds:
166
Windows - MSVC: make -f makefile.ms PLATFORM=msvc RELEASE=yes
167
Windows - MinGW: make -f makefile.ms PLATFORM=win32 RELEASE=yes
168
DOS: make -f makefile.ms PLATFORM=dos RELEASE=yes
169
SDL - Package Maintainers: ./configure --enable-release --disable-cpucheck force_arch=i586
170
SDL - Personal: ./configure --enable-release
172
Note this is important to remove certain debug messages, as well
173
as provide heavy optimization (which could take up to an hour
174
to compile). It also ensures the builds will work with CPUs
175
matching i586 or higher.
176
If compiling for personal use, on DOS and Windows-MinGW, add
177
CPU=your_cpu, where your_cpu matches a GCC -march option.
178
You can use the archopt utility in tools/ to tell you what is
179
best. For SDL, remove --disable-cpucheck force_arch=i586.
181
If you are providing an SDL package for a particular arch
182
greater than i586, replace force_arch=i586 with the proper