Factor out more m4 macros

Closed John Ericson requested to merge wip/factor-out-m4 into master

These will be needed for both the top-level configure script and RTS configure script.

Merge request reports