Building Catacomb on Cygwin

By Ivan Todoroski, Sat 11/22/2003 2:39 PM

Prerequisites:

  1. Catacomb source code (latest from CVS with Cygwin patch applied)
  2. Apache 2.x source code (the Unix source package, not Win32)
  3. MySQL 4.x source code
  4. MySQL 4.x binary distribution for Win32
  5. Make sure you have a recent Cygwin with the basic development packages installed (libtool, automake, autoconf must be present - only devel versions and wrapper scripts, not stable versions)

MySQL

We download both source and binary distributions because MySQL cannot be built completely on Cygwin. Install the binary distribution as usual, we will use the source only to compile the MySQL client library on Cygwin.

Unpack MySQL source, and:

$ ./configure --disable-dependency-tracking --without-server
$ make
$ make install

After that, copy or symlink /usr/local/lib/mysql/libmysqlclient.a to /usr/lib, in order for ld to find it later.

Apache

Forget about loadable Apache modules on Cygwin, it doesn't work (atleast I wasn't able to do it). You will have to build Apache 2.x with Catacomb and the rest of the modules linked statically into one big httpd.exe.

I'm assuming you are going to install Apache in the default location /usr/local/apache2 (i.e. without specifying any --prefix arguments to Apache's configure), and that you checked out Catacomb in /usr/local/src/catacomb.

Open a bash window and let's go:

$ cp /usr/autotool/devel/share/aclocal/* /usr/share/aclocal
$ export AUTO_DEVEL=/usr/autotool/devel
$ export AUTO_STABLE=$AUTO_DEVEL
$ cd /usr/local/src
$ tar xzf /tmp/httpd-2.0.47.tar.gz
$ cd httpd-2.0.47
$ mkdir -p /usr/local/apache2/bin
$ touch /usr/local/apache2/bin/apxs
$ cp -r ../catacomb modules/dav/catacomb
$ cd modules/dav/catacomb
$ ./buildconf.sh
$ ./configure --with-mysql=/usr/local --with-apache=/usr/local/apache2 --with-static
$ cd -
$ ./buildconf
$ ./configure --enable-modules=most --enable-dav
$ make

Now, the Apache build will fail on the very last command which does the final link of httpd.exe. Scroll up past the errors, and locate the last command. It is huge, spanning about ten lines, and starts with "/bin/bash /usr/local/src/httpd-2.0.47/srclib/apr/libtool --silent --mode=link gcc ....". Paste this in notepad, edit it back into one long line, and append "-lmysqlclient" at the very end. Then paste it back in the bash window and run it. That should create the httpd.exe and conclude the Apache build.

After that:

$ make install

This will choke again and fail to copy all the executables in their target location (I'm guessing it is confused by the unexpected .exe extensions). To complete the install, do:

$ cp httpd.exe support/*.exe /usr/local/apache2/bin

You should now have a working Apache installation in /usr/local/apache2.

All that is left is to edit httpd.conf to enable Catacomb, instructions for that are in Catacomb's README, but with two caveats:

That should be it.