17 | | The default version of gcc can be run simply as "`gcc`". |
18 | | There's also "`cc`" which points to the default compiler (which might not necessarily be gcc). |
19 | | The default gcc can be changed using the "`port select`" mechanism. |
20 | | Some users may have used this command to change their default gcc, |
21 | | for example on Leopard to test new functionality in gcc 4.2, |
22 | | or on Tiger to downgrade to gcc 3.3 to compile old software that is not compatible with gcc 4. |
23 | | |
24 | | If not instructed otherwise, software builds using "`gcc`" or "`cc`" and this can be a problem if the user has changed what this is. |
25 | | For example, on the one hand, gcc 4 may be too new to compile some very old software, |
26 | | but on the other hand gcc 3.3 is probably too old to compile a lot of modern software. |
27 | | The problem is further complicated by the various gcc ports which can be installed using MacPorts, |
28 | | which have different capabilities than the Apple versions of gcc. |
29 | | For example, only the Apple versions can create universal binaries in a single step. |
30 | | The port select mechanism can be used to make any of them the default compiler. |
31 | | So we cannot rely on "`gcc`" being any particular version of gcc with any particular capabilities, |
32 | | and "`cc`" varies by Xcode version as well. |
| 17 | If not instructed otherwise, most software builds C code using "`cc`" or "`gcc`". |
| 18 | But "`/usr/bin/cc`" and "`/usr/bin/gcc`" are not specific compilers; they're symlinks to some suitable default compiler, but it varies based on Xcode version. |
| 19 | Users might also have created a "`/opt/local/bin/gcc`" symlink, pointing to any installed compiler, by using "`port select --set gcc`". |
| 20 | So we cannot rely on "`cc`" oc "`gcc`" being any particular compiler. |