view · edit · sidebar · attach · print · history

mod_ruby with Apache for Windows with MinGW compiled Ruby

Build mod_ruby on Windows against these libs:


and use this Makefile

You can also follow the below steps to understand how I came to the above results.

Convert the Libs (DLLs) of Apache for Windows to link against MinGW compiled mod_ruby

  1. The Makefile: of mod_ruby
  2. First read this
  3. your really need to understand step 2.
  4. Create a working directory. I named it dldf in C:\Apache2.2\dldf
  5. pexports libapr-1.dll | sed "s/^_//" > libapr-1s.def
  6. dlltool -U -d libapr-1s.def -l libapr-1s.a
  7. cp libapr-1s.a ../lib/libapr-1s.lib
  8. pexports libapr-1.dll > libapr-1c.def
  9. dlltool -d libapr-1c.def -l libapr-1c.a
  10. cp libapr-1c.a ../lib/libapr-1c.lib
  11. Adjust above make file to include all the new import files: libapr-1s, libapr-1c, libaprutil-1s, libaprutil-1c, libhttpd-s, libhttpd-c all placed in C:\Apache2.2\lib
  12. comment out line 794 of request.c of mod_ruby
  13. run 'make' and mod_ruby will compile just fine with MinGW-gcc-3.4.5 linked against Apache 2.2.17 for Windows!

You need do the exact same steps for

  1. libaprutil-1.dll
  2. libhttpd.dll

then the _imp__* errors will go away ;)

mod_ruby, Apache for Windows download

If you want to build with nmake please see this:


mod_ruby on Github:

view · edit · sidebar · attach · print · history
Page last modified on February 09, 2011, at 10:00 AM