Use opt_prefix to avoid broken link when dependencies upgrades.

* Don't unset __GLIBCXX_DEBUG* as original bug didn't actually do that.
* Make arch and osmajor standalone functions, and construct host triplet
  for build.
* Integrate '--enable-languages' into args.