15 Aug 2008
21384
hits

Win32 compilation environment

After releasing Cherokee 0.8.0, it is time to take care of a broken promise. It is time to give some love to our native Win32 port.

This subject has been a little bit of a pain. We have spent on this way much more time than what we should have because of the building environment. Well, actually, because of the lack of a bundle with the set of tools needed to compile an autotool based project on Windows.

Both Taher and me have spent a lot of time trying to get an acceptable building environment that we could use for keeping up with periodic Win32 binary releases, although none our tries were really fruitful. We found a whole lot of problems along the way: outdated versions of autoconf/automake/libtool that broke up when they were updated, weird 'make' issues, missing parameter in m4, etc.

However, I have finally found a path to get it working! (Hopefully it is actually true, not like the last time I said the same and I ended up proving myself wrong). Here is the cookbook:

  • Download MinGW-5.1.4. Install it in c:mingw

  • Download Msys-1.0.10. Install it in c:msys1.0. Then: y, y, c:/mingw

  • Download MsysDTK-1.0.1. Install it with the default values.

  • Then you will have to go to SourceForge and download a few updates from the User Contributed: mingwPORT (current) section: autoconf-2.59-mingwPORT, automake-1.9.5-mingwPORT, libtool-1.5.22-mingwPORT, wget-1.9.1-mingwPORT, emacs-cvs-mingwPORT.

    These aren't actually packages, but scripts that download and compile updated versions of some tools, so it will require a little bit of time to get them installed.

    In the average case, it's trivial to install these packages. However, there are a couple of exceptions you should know about. The first one is wget; to get it installed open a shell and execute the following commands:

    mkdir /usr/src ; cd /usr/src
    tar xfvj ~/wget-1.9.1-mingwPORT.tar.bz2
    cp wget-1.9.1/mingwPORT/wget.exe /mingw/bin/

    The second exception is the autoconf update. Right after unpacking the package in /usr/src you will have to edit the mingwPORT/mingwPORT.configure file, and change:

    ${SRCDIR}/configure --prefix=`cd ${PREFIX} && pwd -W`

    by:

    ${SRCDIR}/configure --prefix="${PREFIX}"

    Then you can go ahead and execute ./mingwPORT.sh in order to get it compiled and installed (use the default values).

    For the rest of the packages, you will only need to unpack them and execute mingwPORT.sh.

  • The next step is quite tricky. We will have to fix a broken aclocal script by hand. It is really easy though, just open a terminal and type:

    cd /mingw/bin
    mv aclocal aclocal.orig
    sed s.C:/./C/.g aclocal.orig > aclocal
  • At this point, we will have a fairly acceptable environment, although it will still lack a few more software pieces. Next step is to install the Pthreads library and header by downloading the latest release, unpacking it and executing:

    cp -r Pre-built.2/{include,lib} /mingw/
  • Then SVN. In my case I used svn-1.4.6 because I could not download the 1.5.1 Win32 client binaries without registering at CollabNet.. which kind of pissed me off.

  • The last missing piece of software was Python. So after installing it and adding the SVN and Python paths to the PATH environment variable we will be done.

So, now that I have finally found the way to collect, set up and fix all the little pieces involved on the compilation environment I can finally start working on the real stuff. <sigh!>

Comments

Taher Shihadeh on Fri Aug 15 16:37:39 2008
842


Third time's a charm ;)
Andrew Pendleton on Fri Aug 15 18:17:13 2008
843


I wonder if it might be easier to build your binaries in a cross-compile environment on a Linux box, so that getting autotools, etc., wouldn't be such a huge pain?
Alvaro Lopez Ortega on Fri Aug 15 18:45:44 2008
845


Andrew: Yes, you are right. It is way easier, actually.
Max on Fri Aug 15 19:59:26 2008
847


I am a PITA... The Download page still says 0.54 for Windows...
Alvaro Lopez Ortega on Fri Aug 15 20:04:14 2008
848


Max: yep, we have not fixed the newest versions to run on Windows. Hopefully we will finish it soon.
TimoVJL on Tue Aug 19 09:02:50 2008
866


How about ready made Makefiles and etc. for Win32. That way it's easier to test compilation.
donie on Mon Jun 8 18:28:16 2009
1155


pls update the ready to use windows binary. i can't run perl-cgi using 0.5.4
Jorge on Fri Sep 18 18:30:39 2009
1224


Hi Alvaro!, I Wanna Install Cherokee Server On Windows 7, I've Installed WinMG 5.1.4 On C:/WinMG, Where Should I install MSYS-1.0.10 And MsysDTK-1.0.1? In The Same Directory As MinGW (C:/MinGW), Is That Correct?

Leave a comment

Name:

Comment:


Loading PhotoLog..


Search

 

Twitter


Facebook

Alvaro Lopez Ortega's Profile
Alvaro Lopez Ortega's Facebook Profile