Improve custom build rule for log4cxx.h; update dependency on apr.