D-Programming-GDC/GDC — pull request #63 by jpf91 (2013-04-28 09:46:17+00:00)
Title: Allow building phobos externally

This allows building phobos and druntime with an existing gdc compiler. This is meant to simplify porting to other architectures. (Cross-compilation and multilib is working)

Implementation details:
* Detect if we're compiling out of gcc tree in configure.in
* Set multi_basedir = srcdir if compiling out of tree, so
config-ml.in can be found
* GCC_NO_EXECUTABLES isn't defined outside of gcc
* Do a proper check for AR to get the correct ar for cross compilers
* Remove no longer needed libiberty dependency
* Fix using system zlib
* Force using system zlib for out of tree builds

* Also remove unneeded entries from phobos-ver-syms.

I'm not sure how controversial this change is, is there any resaon why we shouldn't ship ```install.sh``` and similar files in phobos? Is it problematic if the phobos build uses local copies of these files instead of the files shipped with gcc? Those files can be provided by ```automake --install-missing``` so we could decide not to ship them, but it would complicate the build process a little bit.

The ```config-ml.in``` file needs to be shipped though. It's copied from gcc-4.8 with a one line change to make it look for the multilib top directory in the source rootdir as well (the original script only looked in subdirs). This copy is only used if we're building out of tree.

What's not so nice about the gcc multilib script is that it creates the multilib binaries in the parent directory of the object dir. So if phobos is configured in ```phobos-obj``` the multilib files end up in ```phobos-obj/../32/libphobos```. This is not nice but also not a big issue as long as we document it. I could hack the ```config-ml.in``` script to avoid this but I don't really want to mess with that script any further.