sstephenson/ruby-build — pull request #339 by gnprice (2013-04-02 02:16:53+00:00)
Title: Fix build failure when clang installed and not used

This better targets the shorten-64-to-32 workaround, to fix #325.

The previous version of this logic was causing us to pass the flag when
* clang is on the PATH, and
* $CC, or 'clang' if CC unset, accepts the flag.

But this is totally wrong if we have clang installed, haven't set $CC, and are going to end up using gcc. We end up passing the flag to gcc, which rejects it.

The real fix is to put this in the autoconf goo in MRI upstream -- the only correct way to decide whether to pass this flag is after we know exactly what compiler we're using and can test if that compiler accepts the flag. But we can do better than before by approximating autoconf's choice of compiler as $CC if set, 'cc' otherwise (which will typically be a symlink to gcc or clang or another.)