tune build framework for more compile/test flexibility

This is a set of patches that make the xdotool build-and-test framework more flexible, which should make it easier to ship unmodified source for the debian packages (and probably for other redistributors too).