script: add discover_compiler function to lib-build.sh
The discover_compiler function is an abstraction over the current
compiler detection code in run-make.sh. It is intended to be flexible
enough to work on {centos,rhel} systems, but currently is just an
updated version of the logic from run-make.sh. The intent is that this
function will grow and become useful for other scripts used for
building (possibly do_cmake.sh for example).
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
561bf4ea9b4dd8f6710a959c5bd38eb4085a9d52)