I have a configure on Mountain Lion that's running into trouble:
[snip]
checking for gcc...
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/Users/jonathan/Downloads/httpd-2.4.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
Meanwhile, I have just opened Xcode and installed command-like tools, including /usr/bin/gcc.
Is there a way I can invoke the configure script so it will take /usr/bin/gcc as the C compiler?
And when I specified:
CC=/usr/bin/gcc
It gives:
checking how to run the C preprocessor... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -E
configure: error: in `/Users/jonathan/Downloads/httpd-2.4.4':
configure: error: C preprocessor "/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -E" fails sanity check
See `config.log' for more details
For now I'll ask: how do I tell it what to use as the C preprocessor?
(Long-term what I'd like is to know why it's not aware of standard command line tools and pulls C-related functionality from an esoteric place.
Best Answer
Apple's gcc binary is really llvm.
You'll want to obtain gcc from homebrew or from source if you need gcc and not llvm standing in for gcc.
Good reading abounds on various blogs:
Once you've gotten a real version of
gcc
installed, you canexport CC=/usr/local/bin/gcc
or whatever else you prefer for setting the environment variable to match were you choose to store your now non-llvm-based compiler.