Sophie

Sophie

distrib > Mandriva > cooker > x86_64 > media > plf-non-free-release-binary > by-pkgid > ce786273fe57b4dc401e482e21a4de20 > files > 20

sdlmess-0.140-1plf2011.0.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Cygwin (vers 1st September 2004), see www.w3.org" />
<title>How to compile MESS (Win32)</title>
<link rel="StyleSheet" href="../style.css" type="text/css" />
</head>
<body>
<h1>Compiling MESS</h1>
<p>(This document is based on <a href="http://www.mame.net/compilewin.html">"How to compile MAME (Win32)"</a>. Since the procedure for compiling
<a href="http://www.mame.net/">MAME</a> and <a href="http://www.mess.org/">MESS</a> are virtually identical, these two documents are virtually
identical)</p>
<p><b>Compiling means</b> rebuilding the actual executable program from its source code. <a href="http://www.mess.org/">MESS</a> is almost fully
written in C, with some assembler hacks in speed-critical places. The Win32 version of <a href="http://www.mess.org/">MESS</a> is compiled with
<a href="http://www.mingw.org/">MinGW</a>, which is the minimalist Win32 port of a C compiler called <a href="http://gcc.gnu.org/">GCC</a> and its
libraries.</p>
<p>This particular how-to is written for <a href="http://www.mess.org/">MESS</a> 0.122, but with a bit of luck you can compile other versions with the
help of this page. This how-to tells how to compile the Win32 version of <a href="http://www.mess.org/">MESS</a>, which includes both the command
line and GUI versions.</p>
<p>The MinGW development environment will be installed to <span class="filename">C:\MINGW</span> and <a href="http://www.mess.org/">MESS</a> sources
will be placed into <span class="filename">C:\MINGW\MESS</span>. Before beginning, you should make sure that you do not have the directories
<span class="filename">c:\mingw\</span> and <span class="filename">c:\download\</span> yet. If you do have them, rename them to another name or
simply delete them (if you are sure that there aren't any important files in there).</p>
<p>Remember, when you type commands into the command prompt, you should avoid making typos <span class="fixedsize">;-)</span> In this how-to,
filenames and other static text are marked with the color <span class="filename">brown</span> and command lines or other information that you need to
type in are marked with the color <span class="command">green</span> .</p>
<hr />
<h2>1. Get Unzip</h2>
<p>First of all, most files that are transferred over the Internet are compressed, to minimize download times and bandwidth costs. You might already
have a Windows-based uncompressing utility, but since compiling <a href="http://www.mess.org/">MESS</a> is done in a command prompt, a different kind
of utility is necessary. Download the following file into the directory <span class="filename">c:\windows\command\</span> so that the utility is
accessible from any directory.</p>
<table width="100%" border="2" cellspacing="1" cellpadding="5">
<tr>
<td><span><b>File&nbsp;name</b></span></td>
<td><span><b>File&nbsp;size</b></span></td>
<td><span><b>Description</b></span></td>
</tr>
<tr>
<td><span><b><a href="http://www.mame.net/downmain.html">unzip.exe</a></b></span></td>
<td><span>140kB</span></td>
<td><span>This is the <a href="http://www.info-zip.org/pub/infozip/">Info-ZIP</a> uncompressing utility called UnZip/NT v5.41.</span></td>
</tr>
</table>
<hr />
<h2>2. Get Win32 ports GNU Tar and GNU Unzip</h2>
<p>These utilities are needed by step 4 to properly patch the MinGW toolchain.&nbsp; Again, you may already have&nbsp;an archiver capable
of&nbsp;extracting .tar.gz files.&nbsp;</p>
<table width="100%" border="2" cellspacing="1" cellpadding="5" id="Table1">
<tr>
<td><span><b>File&nbsp;name</b></span></td>
<td><span><b>File&nbsp;size</b></span></td>
<td><span><b>Description</b></span></td>
</tr>
<tr>
<td><span><b><a href="http://www.weihenstephan.de/~syring/win32/UnxUtils.zip">UnxUtils.zip</a></b></span></td>
<td><span>2911kB</span></td>
<td><span>Native Win32 <a href="http://www.weihenstephan.de/~syring/win32/UnxUtils.html">ports</a> of some GNU utilities.</span></td>
</tr>
</table>
<hr />
<h2>3. Get MinGW</h2>
<p>Then you need the MinGW files. Make a new directory, for example <span class="filename">c:\download\</span> and download the following files into
that directory. Note that there may be newer versions of these files, but <a href="http://www.mess.org/">MESS</a> is not verified to compile with any
other versions of the following files.</p>
<table width="100%" border="2" cellspacing="1" cellpadding="5">
<tr>
<td><span><b>File&nbsp;name</b></span></td>
<td><span><b>File&nbsp;size</b></span></td>
<td><span><b>Description</b></span></td>
</tr>
<tr>
<td><span><a href="http://mamedev.org/tools/mingw-mame-20070810.exe">mingw-mame-20070810.exe</a></span></td>
<td><span>6718 kB</span></td>
<td><span>MinGW tools for MAME/MESS.</span></td>
</tr>
<tr>
<td><span><a href="http://alleg.sourceforge.net/files/dx80_mgw.zip">dx80_mgw.zip</a></span></td>
<td><span>451 kB</span></td>
<td><span>DirectX 8.0 headers, required for <a href="http://www.mess.org/">MESS</a> 0.125. Uncompress this over the MinGW directory.</span></td>
</tr>
</table>
<hr />
<h2>4. Uncompress MinGW</h2>
<p>Next we will uncompress the MinGW files and set up some environment variables so that MinGW is functional. First run the MinGW installer, which
will install a fresh MinGW installation.&nbsp; Now you need to add a few associated files to the MinGW installation.&nbsp; Open up a command prompt.
You can find it either from under Start Menu&nbsp;--&gt; Programs, or you can simply select Run and type command.com into the dialog box. When you
have it open, type <span class="command">cd \Program Files\MinGW</span> &nbsp;and hit enter to change to the correct directory. After that, type</p>
<ul>
<li><span class="command"><span class="command">unzip c:\download\dx80_mgw.zip -d c:\</span></span></li>
</ul>
<p>If you do not see the message "1 archive was successfully processed.", re-download the archives. If you get a "Bad command or file name", verify
once again that you have <span class="filename">unzip.exe</span> in <span class="filename">c:\windows\command\</span></p>
<hr />
<h2>5. Set up MinGW</h2>
<p>Next we will have to set up the environment variables. To make the changes permanent, we will have to edit <span class="filename">AUTOEXEC.BAT</span>, 
which is a file that always gets run before Windows starts up. Type <span class="command">edit \autoexec.bat</span>
and hit enter. There might be a lot of things in there, so do not touch anything else than what you are told to.</p>
<p>Find the line which says something like <span class="filename">PATH C:\WIN98;C:\WIN98\COMMAND</span> (there might be some other directories
defined after these two). Add <span class="command">;C:\MINGW\BIN</span> to the end of that line, so that it will look like <span class="filename">
PATH C:\WIN98;C:\WIN98\COMMAND</span><span class="command">;C:\MINGW\BIN</span> (again, there might be something extra in there, leave
them as they are). Take note that if you have added <span class="filename">C:\DJGPP\BIN</span> into that line, you should remove it. Now you can save
the file (<span>ALT-F</span> then <span>S</span>) and quit (<span>ALT-F</span> then <span>X</span> ) (These might differ depending on your language
version of Windows). Then you will need to reboot your computer, to make the changes effective.</p>
<p>With systems that don't use startup files (such as Windows NT, 2000 or XP), you can instead type <span class="command">edit
c:\mingw\mingw.bat</span> and write <span class="command">SET PATH=%PATH%;c:\mingw\bin</span> into it. You'll have to run this file (simply type
<span class="command">c:\mingw\mingw</span> to run it) before being able to use MinGW.</p>
<hr />
<h2>6. Compile MESS</h2>
<p>Now you can compile <a href="http://www.mess.org/">MESS</a>. The <a href="http://www.mess.org/">MESS</a> source is distributed as a source
override on the <a href="http://www.mamedev.org/">MAME</a> source.&nbsp; Therefore you will need to download both the <a href="http://www.mamedev.org/">MAME</a> 
and <a href="http://www.mess.org/">MESS</a> source ZIPs into&nbsp; <span class="filename">c:\download\</span></p>
<table width="100%" border="2" cellspacing="1" cellpadding="5">
<tr>
<td><span><b>File&nbsp;name</b></span></td>
<td><span><b>File&nbsp;size</b></span></td>
<td><span><b>Description</b></span></td>
</tr>
<tr>
<td><a href="http://www.mamedev.org/releases/mame0125s.zip"><b>mame0125s.zip</b></a></td>
<td>12136 kB</td>
<td>This is the source archive of <a href="http://www.mamedev.org/">MAME</a> 0.125.</td>
</tr>
<tr>
<td><a href="http://www.mess.org/files/mess0125s.zip"><b>mess0125s.zip</b></a></td>
<td>10819 kB</td>
<td>This is the source archive of <a href="http://www.mess.org/">MESS</a> 0.125.</td>
</tr>
</table>
<p>Go to the download directory by typing <span class="command">cd \download</span> and uncompress the <a href="http://www.mamedev.org/">MAME</a> and
<a href="http://www.mess.org/">MESS</a> sources by typing the following commands</p>
<ul>
<li><span class="command">unzip mame0125s.zip</span></li>
<li><span class="command">unzip mame.zip -d c:\mingw\mess\</span></li>
<li><span class="command">unzip mess0125s.zip -d c:\mingw\mess\</span> .</li>
</ul>
<p>Then you can compile <a href="http://www.mess.org/">MESS</a>. Type <span class="command">make TARGET=mess</span> and hit enter. This will
finally compile <a href="http://www.mess.org/">MESS</a> itself. If you want to compile the CPU optimized versions, type <span class="command">
make TARGET=mess ARCHOPTS=-march=pentiumpro</span> instead of just <span class="command">make TARGET=mess</span> . It will take a lot of time, 
ranging from 15 minutes to an hour depending on your CPU speed, so go get yourself something to drink. If your computer is dual core, you can 
speed up a bit the compilation using <span class="command">make -j3 TARGET=mess</span>.</p>
<p>When the compilation is done, you can type <span class="command">dir</span>. You should see a brand new <span class="filename">MESS.EXE</span> in
there.</p>
<p>You also need to make the INI file, by typing <span class="command">mess -cc</span> (an abbreviation of -createconfig).</p>
<p>Congratulations, you did it!</p>
<hr />
<h2>7. A new MESS appeared</h2>
<p>To successfully compile a new version of <a href="http://www.mess.org/">MESS</a>, you should NOT uncompress a new set of sources over an old
version of <a href="http://www.mess.org/">MESS</a>. Instead, rename the <a href="http://www.mess.org/">MESS</a> directory to another name or simply
delete it totally (if you are sure that nothing important is there), and then uncompress the new set of sources to an empty directory.</p>
<hr />
<h2>8. Then what..</h2>
<p>Of course, the biggest advantage of building your own binary is the possibility to tinker around with the source files. For example, to try out
drivers which are not fully working yet, take a look at the file <span class="filename">mess/system.c</span> with a normal text editor (like EDIT).
The disabled drivers are marked with the text TESTDRIVER. Simply remove the TEST part from a driver you want to test, save the file and type
<span class="command">make TARGET=mess</span> again. Remember, the license forbids you from redistributing binaries that contain systems which
are disabled in the official versions. Naturally, there should not be any reasons to redistribute such binaries since this page makes it easy for
everybody to build their own binaries.</p>
<p>You might notice that the executables created by the build are much larger than the ones released by the <a href="http://www.mess.org/">MESS</a>
team.&nbsp; This is because the <a href="http://www.mess.org/">MESS</a> releases are archived with <a href="http://upx.sourceforge.net/">UPX</a> to
make them smaller.</p>
<hr />
<h2>9. Debug modes</h2>
<p>To include the debugger functionality in your <a href="http://www.mess.org/">MESS</a> executable, edit <span class="filename">makefile</span>.
Near the top you will see a text like "uncomment next line to include the debugger". Remove the <span class="command">#</span> character from the
next line, so that it only has <span class="filename">DEBUG = 1</span> in that particular line. Save the file, type <span class="command">make -f
makefile TARGET=mess clean</span> and then <span class="command">make TARGET=mess</span>. To actually use the debugger, edit <span class="filename">MESS.INI</span> and find the line that says <span class="filename">debug = no</span>. Change it to <span class="filename">debug =
yes</span> and save the file. In <a href="http://www.mess.org/">MESS</a>, hit tilde (&nbsp;<span>~</span>&nbsp;) or key to the left of the key
&nbsp;<span>1</span> &nbsp; to enter the debugger.</p>
</body>
</html>