28 Dec 2006
2672
hits

How to cross compile Cherokee (Win32 on Linux)

First of all, you will have to install the cross compiler:

# apt-get install mingw32 mingw32-binutils
Then, you'll have to install the pthread library:
$ 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/
And now, we are ready to compile it. We only have to set a few environment variables:
PATH=/usr/i586-mingw32msvc/bin:$PATH

CC=i586-mingw32msvc-gcc
LD=i586-mingw32msvc-ld
AR=i586-mingw32msvc-ar
RC=i586-mingw32msvc-windres
Check out the last version of Cherokee trunk:
$ svn co svn://svn.cherokee-project.com/cherokee/trunk cherokee
and execute a quite long "configure" command:
$ 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
reached this point, we are ready to build it by simply typing
$ make
And, here is the result. A native Win32 binary built on Linux! :-)
-rwxr-xr-x 1 alo alo 2600254 2006-12-28 15:54 cherokee.exe

Leave a comment

Name:

Comment:


Loading PhotoLog..


Search