Fix build on SunOS.  Patches from Thomas Merkel in joyent/pkgsrc#175.
sync w/ base pkg
Honour our CXXFLAGS. Fix build with Clang.
Build against apache24.