Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

178 lines (156 sloc) 7.599 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="main.css" type="text/css">
<style type="text/css">
.menu-building-cygwin { font-weight: bold }
</style>
<title>wxHaskell - Building - Cygwin installation</title>
</head>
<body>
<div id="body">
<div class="menu">
<ul>
<li><a class="menu-index" href="index.html">home</a></li>
<li><a class="menu-screenshots" href="screenshots.html">screenshots</a>
<ul>
<li><a class="menu-samples" href="samples.html">samples</a></li>
<li><a class="menu-applications" href="applications.html">applications</a></li>
</ul>
</li>
<li><a class="menu-documentation" href="documentation.html">documentation</a>
<ul>
<li><a class="menu-documentation-license" href="license.html">license</a></li>
<li><a class="menu-documentation-quickstart" href="quickstart.html">quick start</a></li>
<li><a class="menu-documentation-faq" href="faq.html">faq</a></li>
</ul>
</li>
<li><a class="menu-download" href="download.html">download</a></li>
</ul>
</div>
<div class="menu">
<ul>
<li><a class="menu-building" href="building.html">building</a>
<ul>
<li><a class="menu-building-cygwin" href="building-cygwin.html">cygwin</a></li>
<li><a class="menu-building-msc" href="building-msc.html">msc</a></li>
<li><a class="menu-building-macosx" href="building-macosx.html">macosx</a></li>
</ul>
</li>
<li><a class="menu-development" href="development.html">development</a></li>
<li><a class="menu-contribute" href="contribute.html">contribute</a></li>
<!-- <li><a class="menu-dev-download" href="dev-download.html">download</a></li> -->
</ul>
</div>
<div class="text">
<h2>Unix on Windows</h2>
<p>To build wxHaskell on windows, you need the cygwin environment to provide essential unix
tools necessary to run <code>configure</code> and <code>make</code>, i.e. <code>sh</code>, <code>test</code>, <code>sed</code>, gnu <code>make</code> etc. The cygwin environment provides these tools
on windows and these notes describe how to properly install these tools. To compile wxWidgets properly
without using Microsoft Visual C++, you also need to install the mingw compiler, as described in the
section after installing cygwin. Please note that the compilation of wxWidgets also works without
the mingw compiler, but all programs linked with it will fail mysteriously!
</p>
</div>
<div class="text">
<h2>Install Cygwin</h2>
<p>Download the setup program from the <a href="http://www.cygwin.com">cygwin site</a>. When
prompted for the packages to install, click also on the <code>Devel</code> and <code>Archive</code>
node until they show <code>install</code> (instead of <code>default</code>).</p>
<p>After installation, you need to set a few environment variables. In the following description you
should replace the variable <code>$cygwin</code> with your cygwin
installation directory (<code>c:\cygwin</code> by default). Set your local environment variables
(via <code>start/settings/control panel/system/advanced/environment variables</code>) to the
following values:</p>
<ul>
<li>Add the following directories to your <code>PATH</code>: <code>$cygwin\bin</code> and
<code>$cygwin\usr\local\lib</code>. On my
system this looks like:
<pre>
PATH = %PATH%;c:\programs\cygwin\bin;c:\programs\cygwin\usr\local\lib;<em>...</em>
</pre>
</li>
<li>Set <code>SHELL</code> to <code>$cygwin\bin\sh</code>.</li>
<li>Set <code>MAKE_MODE</code> to <code>UNIX</code>.</li>
<li>Set <code>HOME</code> to your preferred home directory, for example: <code>c:\bgates</code>.</li>
</ul>
<p>Next, we need to ensure that the default shell is <em>bash</em>. Go to the <code>$cygwin/bin</code>
directory and rename <code>sh.exe</code> to <code>sh-org.exe</code>. Next, make a copy of <code>bash.exe</code>
and name it <code>sh.exe</code>.</p>
<p>We also set some default settings for bash. Create a file <code>.bashrc</code> in your
home directory with the following lines:</p>
<pre>
export CVS_RSH=ssh
export PS1='\[\033[1;31m\]\w\$ \[\033[0m\]'
export PATH=$PATH:/usr/local/bin:.
</pre>
<p>Finally, you can start a <code>bash</code> command prompt, either via the cygwin icon or by typing
<code>bash</code> on the windows command line. To access the <code>c:</code> drive conveniently
from the bash command prompt, you can mount the <code>/c</code> directory. You only have to
do this once:</p>
<pre>
> mount c: /c
</pre>
<p>From now on, you can access the <code>c:</code> drive via <code>/c</code>, for example: <code>cd /c/windows</code></p>
<p>Cygwin make 3.81 is no more recognizing the DOS style paths. You need to install a 3.80 version that you can get from <a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2">paracoda.</a> Once your cygwin installation is working, you can install the older make with:</p>
<pre>
cd /
tar xjf /cygdrive/c/where-your-download-is/make-3.80-1.tar.bz2
bin/make.exe --version
</pre>
<p> WARNING : It will override the 3.81 make</p>
</div>
<div class="text">
<h2>Installing Mingw</h2>
<p>In order to compile dynamic link libraries that should work with GHC, we also need the minimalist
gnu compiler, called <em>mingw</em>. Compiling with this compiler has the extra advantage that the
resulting executables or no longer dependent on the cygwin dll.</p>
<p>Download the latest compiler from the <a href="http://www.mingw.org">mingw site</a>. There
are a lot of packages available but you only need the
<a href="http://prdownloads.sf.net/mingw/MinGW-2.0.0-3.exe?download">MinGW</a> package.
</p>
<p>After installation, you still need to adapt the cygwin environment in order to use the
mingw compiler by default. In the following description, you should replace the <code>$mingw</code>
variable with the mingw installation directory (<code>c:\mingw</code> by default).</p>
<ul>
<li>Add the <code>$mingw/bin</code> directory to the <em>start</em> of your <code>PATH</code> environment
variable. It is important that it comes before the <code>$cygwin/bin</code> directory. On my
system this looks like:
<pre>
PATH = %PATH%;c:\programs\mingw\bin;c:\programs\cygwin\bin;<em>...</em>
</pre>
</li>
<li>Edit the file <code>$cygwin/etc/profile</code> and add the <code>$mingw/bin</code> directory
to the exported <code>PATH</code>. You should use a unix style directory name. On my system
this looks like:
<pre>
export PATH="/c/programs/mingw/bin:/usr/local/bin:/usr/bin:/bin:$PATH"
</pre>
</li>
</ul>
<p>To see if your installation was succesfull, you should retrieve the version
of the C compiler and see if the result contains the word <em>mingw</em>:</p>
<pre>
~$gcc --version
gcc.exe (GCC) 3.2 (mingw special 20020817-1)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</pre>
<p>In constrast, if you have done something wrong, you would see something like:</p>
<pre>
~$/c/programs/cygwin/bin/gcc --version
gcc (GCC) 3.2 20020927 (prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</pre>
</div>
<div class="status">
<a style="float: right" href="#body">top</a>last update: "Apr 1 2004".
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.