Building mod_xslt for System Apache on Leopard

Posted by dacc on February 20, 2009

I needed to get mod_xslt working under Leopard to pretty up some raw XML CruiseControl logs, and it took a while to get things to build. We’re pretty married to the system Apache, as we use Apple’s groupware and authentication facilities. I ended up having to install some deps, add an include, and hack some Makefiles.

Here’s how…

This is what my mod_xslt.so links to:

{dacc@rieke-server /usr/libexec/apache2}$ otool -L mod_xslt.so
mod_xslt.so:
    /usr/local/lib/libmodxslt0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0)
    /usr/local//lib/libapr-0.0.dylib (compatibility version 10.0.0, current version 10.17.0)
    /usr/local//lib/libaprutil-0.0.dylib (compatibility version 10.0.0, current version 10.17.0)
    /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 25.0.2)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.3)
    /opt/local/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.22.0)
    /opt/local/lib/libxml2.2.dylib (compatibility version 9.0.0, current version 9.31.0)
    /opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/local/lib/libpcre.0.dylib (compatibility version 1.0.0, current version 1.1.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

So you may need to install libxslt, libxml2, and libpcre from MacPorts. You also need to install (Apache APR and APR-Util)[http://apr.apache.org/download.cgi#apr0] from the v0.9 track. I configured with –prefix=/usr/local/.

Here is my configure line for modxslt (you need /opt/local/bin in your path):

{dacc@rieke-server ~/modxslt-2004112100}$ ./configure --with-pcre-config=which pcre-config

Next I had to add an include and hack some Makefiles to make them compatible with OS X libtool(1) and install(1). I attached a patch for those that will hopefully apply on your configured modxslt-2004112100 OK:

{dacc@rieke-server ~/modxslt.orig/modxslt-2004112100}$ patch -p0 < ~/modxslt-2004112100.leopard.diff
patching file ./doc/man/Makefile
patching file ./lib/Makefile
patching file ./lib/parser/Makefile
patching file ./sapi/apache1/Makefile
patching file ./sapi/apache2/Makefile
patching file ./sapi/apache2/modxslt.c
patching file ./utils/Makefile

Now you should be able to make install and add the following to your httpd.conf:

LoadModule mxslt_module libexec/apache2/mod_xslt.so

Enjoy!

Trackbacks

Use this link to trackback from your own site.

blog comments powered by Disqus