Monday, January 18, 2010

mod_xsendfile compiling in mac os x leopard and snow leopard for i386 or x86_64 arch type

Mod_Xsendfile is a small Apache2 module that processes X-SENDFILE headers registered by the original output handler."

If you did encountered trouble integrating the module for XSendfile for Apache in Mac OS X, I manage to compile it by passing the flags which would suffice the architecture of the processor's model.

apxs -cia -Wc,"-arch x86_64" -Wl,"-arch x86_64" mod_xsendfile.c

-Wc          the compiler flags
-Wl           the linker flags.


That is applicable only if your arch type is x86_64 in Mac. I have Snow Leopard in my desktop, priorly it was Leopard 10.5.8.

For Leopard 10.5.8, It does works when you pass "-arch i386" for compiler flags and linker flags. This works like a charm and Apache doesn't end up segmentation fault anymore.

Hope this helps!

No comments: