<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="doc.xsl"?>

<documentation>
   <title>Developers Guide</title>
   <author>Pierre d'Herbemont</author>
   <subtitle>What you have to know to hack on Darwine.</subtitle>
   <chapter>
      <title>How to help the project</title>
<p>
<ul>
<li>Add a i386-darwin-user mode to QEMU</li>
<p>
This task consists in adding a compatibility layer between darwin/i386 application and a darwin/ppc host (and therefore between darwin/ppc apps and darwin/i386 host) in qemu.<br/>
Current work is on the Darwine@OpenDarwin.org's cvs repository in related/qemu.
</p>
<li>Port OpenSource Win32 apps using WineLib (and debug it)</li>
</ul>
</p>
   </chapter>
   <chapter>
      <title>Accessing the CVS repository</title>
<p>
Two CVS Repositories are in use. The WineHQ's cvs holds the Wine sources, and the Darwine's OpenDarwin.org cvs holds everything else: the website (in darwine/www), WineHelper (in darwine/WineHelper), and some custom Qemu work (in darwine/related/qemu).
</p>
      <division>
        <title>Accessing the WineHQ's CVS Repository</title>
See the <a href="http://www.winehq.org/site/cvs">recommendations</a> on the WineHQ to checkout wine's source code.
      </division>
      <division>
      <title>Accessing the Darwine@OpenDarwin's CVS Repository</title>
<p>
<ul>
<li>
 via <a href="http://cvs.opendarwin.org/index.cgi/projects/darwine/">CVSWeb</a></li>
<li>
 via Anonymous CVS
 <command> cvs -d:pserver:anonymous@ anoncvs.opendarwin.org:/Volumes/src/cvs/od checkout projects/darwine</command>
</li>
</ul>
OpenDarwin.org provides also information on <a href="http://www.opendarwin.org/en/articles/cvs_howto/">how to retrieve the OpenDarwin.org repository</a>.
</p>
        </division>
  </chapter>
  <chapter>
      <title>Building the source code</title>
      <division>
         <title>Building Wine</title>
<p>First get Wine sources from the <a href="http://www.winehq.org">WineHQ</a>.</p>
<p>Then
<command>cd wine/dir</command>
if you use a bash shell:
<command>export MACOSX_DEPLOYMENT_TARGET=10.2</command>
else if you use a tcsh shell:
<command>setenv MACOSX_DEPLOYMENT_TARGET 10.2</command>
and
<command>./configure &amp;&amp; make</command>
</p>
      </division>
      <division>
         <title>Building WineHelper</title>
<p>First checkout WineHelper from the darwine repository on cvs.opendarwin.org.</p>
<p>Open the Xcode project in the WineHelper folder and choose Build</p>
      </division>
      <division>
         <title>Building QEMU with darwin-user</title>
<p>First checkout WineHelper from the darwine repository on cvs.opendarwin.org.</p>
<p>Then
<command>cd qemu/dir</command>
if you use a bash shell:
<command>
./configure --target-list=i386-darwin-user ppc-darwin-user<br/>
make
</command>
</p>
<p>
to test it make a simple hello world:
<command>
#include &lt;stdio.h&gt;<br/>
int main()<br/>
{<br/>
printf("hello World!");<br/>
}<br/>
</command>
Build it the following way:
<command>gcc -arch ppc -seg1addr 0x500000 helloworld.c -o helloworld-ppc</command>
You have to relocate it to 0x500000 because qemu uses the default base address for itself, and an executable relocation is not supported by dyld.<br/>
(for now ppc-darwin-user works better than i386-darwin-user)<br/>
then <command>./ppc-darwin-user/qemu-ppc helloworld-ppc</command>
</p>
<p>
To try the i386-darwin-user, you'll need a cross compiling toolchain, and the i386 libraries and dynamic linker (dyld)  needed for execution. You can download the binaries on Kevin Van Vechten's <a href="http://www.opendarwin.org/~kevin/">homepage</a>.
</p>
      </division>
  </chapter>
  <chapter>
     <title>Contributing</title>
     <division>
     <title>Sending Patch</title>
      <division>
     <title>Patches against the Darwine's CVS Repository</title>
        <p>
First create your patch by :
<command>cd darwine_cvs_folder<br/>
cvs update -dP<br/>
cvs diff -u the_file_or_folder/to/diff</command>
Then send it to the darwine-devel mailing-list. Add to the email's subject the keyword [Patch]. And describe the change you've done, the more extensively as possible.
        </p>
      </division>
      <division>
        <title>Patches against the WineHQ's CVS Repository</title>
        <p>
We use the WineHQ's cvs repository for the Wine sources. Thus modifications to Wine has to be send to the WineHQ. Read the <a href="http://www.winehq.org/site/sending_patches">winehq recommendations for Submitting Patches</a>. Then generate a patch. Send it to the wine-patches mailing- according to the previous recommendations. You should also CC the email to the darwine-devel mailing-list.
        </p>
      </division>
     </division>
     </chapter>
</documentation>
