Change system to systemName in build configure

Also replaces instances of SYSTEM in the configure callback function.
Remove global variables from the configure callback function.
Fix problem with CROSS being undefined.