Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 71e386997764e4f2b47089ee5abd8467 > files > 778

cherokee-1.2.99-1mdv2010.2.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en-us" />
    <meta name="ROBOTS" content="ALL" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta name="Keywords" content="cherokee web server httpd http" />
    <meta name="Description" content="Cherokee is a flexible, very fast, lightweight Web server. It is implemented entirely in C, and has no dependencies beyond a standard C library. It is embeddable and extensible with plug-ins. It supports on-the-fly configuration by reading files or strings, TLS/SSL (via GNUTLS or OpenSSL), virtual hosts, authentication, cache friendly features, PHP, custom error management, and much more." />
    <link href="media/css/cherokee_doc.css" rel="stylesheet" type="text/css" media="all" />
  </head>
<body>
<h2 id="_a_href_index_html_index_a_8594_a_href_cookbook_html_cookbook_a"><a href="index.html">Index</a> &#8594; <a href="cookbook.html">Cookbook</a></h2>
<div class="sectionbody">
</div>
<h2 id="_cookbook_how_to_cross_compile_cherokee">Cookbook: How to cross compile Cherokee</h2>
<div class="sectionbody">
<h3 id="linux2win32">Cherokee-Win32 from Linux</h3><div style="clear:left"></div>
<div class="paragraph"><p>First of all, you will have to install the cross compiler:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt># apt-get install mingw32 mingw32-binutils</tt></pre>
</div></div>
<div class="paragraph"><p>Then, you&#8217;ll have to install the pthread library:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ cd /var/tmp
$ mkdir pthread-win32
$ cd pthread-win32
$ wget ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe
$ unzip pthreads-w32-2-8-0-release.exe
# cp ./Pre-built.2/lib/libpthreadGCE2.a /usr/i586-mingw32msvc/lib/libpthread.a
# cp Pre-built.2/include/* /usr/i586-mingw32msvc/include/</tt></pre>
</div></div>
<div class="paragraph"><p>And now, we are ready to compile it. We only have to set a few environment
variables:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>PATH=/usr/i586-mingw32msvc/bin:$PATH
CC=i586-mingw32msvc-gcc
LD=i586-mingw32msvc-ld
AR=i586-mingw32msvc-ar
RC=i586-mingw32msvc-windres</tt></pre>
</div></div>
<div class="paragraph"><p>Check out the last version of Cherokee trunk:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ svn co svn://svn.cherokee-project.com/cherokee/trunk cherokee</tt></pre>
</div></div>
<div class="paragraph"><p>and execute a quite long "configure" command:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ ac_cv_func_malloc_0_nonnull=yes   \
  ac_cv_func_realloc_0_nonnull=yes  \
./configure                         \
  --host=i586-mingw32msvc           \
  --prefix=/usr/i586-mingw32msvc    \
  --disable-readdir_r               \
  --disable-tls                     \
  --enable-static-module=all        \
  --enable-trace                    \
  --enable-static                   \
  --enable-shared=no                \
  --enable-beta                     \
  CC=i586-mingw32msvc-gcc</tt></pre>
</div></div>
<div class="paragraph"><p>Once reached this point, we are ready to build it by simply typing:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>$ make</tt></pre>
</div></div>
<h3 id="osx2win32">Cherokee-Win32 from OS X</h3><div style="clear:left"></div>
<div class="paragraph"><p>First of all, you will have to install MinGW for OS X and to check out the
latest version of the source code, then fetch, uncompress and install
pthreads-win32:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>unzip pthreads-w32-2-8-0-release.exe
cp Pre-built.2/lib/libpthreadGCE2.a \
     /usr/local/i386-mingw32-3.4.5/lib/libpthread.a
cp Pre-built.2/include/* \
         /usr/local/i386-mingw32-3.4.5/lib/gcc/*/*/include/</tt></pre>
</div></div>
<div class="paragraph"><p>Then you will have to set a few environment variables:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>         CC=i386-mingw32-gcc
         LD=i386-mingw32-ld
         AR=i386-mingw32-ar
         RC=i386-mingw32-windres</tt></pre>
</div></div>
<div class="dlist"><dl>
<dt class="hdlist1">
and run the configuration script
</dt>
<dd>
</dd>
</dl></div>
<div class="listingblock">
<div class="content">
<pre><tt>ac_cv_func_malloc_0_nonnull=yes           \
ac_cv_func_realloc_0_nonnull=yes          \
./configure                               \
  --host=i386-mingw32                     \
  --prefix=/usr/local/i386-mingw32-3.4.5/ \
  --enable-static                         \
  --enable-shared=no                      \
  --enable-static-module=all              \
  --disable-readdir_r                     \
  --disable-tls                           \
  --enable-beta                           \
  --enable-trace                          \
  CC=i386-mingw32-gcc</tt></pre>
</div></div>
</div>
<div id="footer">
<div id="footer-text">
</div>
</div>
</body>
</html>