(libretro-build-common-xdk.sh) Refactor / cut down on code duplication