Preparing GCC Build: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
m (Bot: Replace deprecated source tag with syntaxhighlight)
m (Replace deprecated enclose attributes)
 
Line 170: Line 170:
Install a new version (compile it yourself or use MacPorts) and add <tt>--with-libiconv-prefix=/opt/local</tt> (or <tt>/usr/local</tt> if you compiled it yourself) to GCC's <tt>./configure</tt> line. Alternatively you may place the libiconv source as gcc-x.y.z/libiconv and it will be compiled as part of the GCC compilation process. (This trick also works for MPFR, GMP, and MPC).
Install a new version (compile it yourself or use MacPorts) and add <tt>--with-libiconv-prefix=/opt/local</tt> (or <tt>/usr/local</tt> if you compiled it yourself) to GCC's <tt>./configure</tt> line. Alternatively you may place the libiconv source as gcc-x.y.z/libiconv and it will be compiled as part of the GCC compilation process. (This trick also works for MPFR, GMP, and MPC).


The makefiles of Binutils and GCC use the <syntaxhighlight lang="make" enclose="none">$(CC)</syntaxhighlight> variable to invoke the compiler. On OS X, this resolves to <syntaxhighlight lang="text" enclose="none">gcc</syntaxhighlight> by default, which is actually <syntaxhighlight lang="bash" enclose="none">clang</syntaxhighlight>. Prior to OS X 10.8, the Clang that came with Xcode's Command Line Tools package was not able to build a working GCC. Users running OS X 10.7 or below may need to find and install GCC, either from [https://brew.sh Homebrew], or from somewhere on Apple's website. You can try with the old GCC that comes preinstalled on some macOS versions.
The makefiles of Binutils and GCC use the <syntaxhighlight lang="make" inline>$(CC)</syntaxhighlight> variable to invoke the compiler. On OS X, this resolves to <syntaxhighlight lang="text" inline>gcc</syntaxhighlight> by default, which is actually <syntaxhighlight lang="bash" inline>clang</syntaxhighlight>. Prior to OS X 10.8, the Clang that came with Xcode's Command Line Tools package was not able to build a working GCC. Users running OS X 10.7 or below may need to find and install GCC, either from [https://brew.sh Homebrew], or from somewhere on Apple's website. You can try with the old GCC that comes preinstalled on some macOS versions.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">