Changes between Version 18 and Version 19 of UsingTheRightCompiler
- Timestamp:
- Apr 7, 2013, 5:38:46 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsingTheRightCompiler
v18 v19 17 17 The default version of gcc can be run simply as "`gcc`". 18 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 "` gcc_select`" command.19 The default gcc can be changed using the "`port select`" mechanism. 20 20 Some users may have used this command to change their default gcc, 21 21 for example on Leopard to test new functionality in gcc 4.2, … … 28 28 which have different capabilities than the Apple versions of gcc. 29 29 For example, only the Apple versions can create universal binaries in a single step. 30 The gcc_select portcan be used to make any of them the default compiler.30 The port select mechanism can be used to make any of them the default compiler. 31 31 So we cannot rely on "`gcc`" being any particular version of gcc with any particular capabilities, 32 32 and "`cc`" varies by Xcode version as well. 33 33 34 Most port authors will not have used "` gcc_select`"34 Most port authors will not have used "`port select --set gcc $value`" 35 35 and will therefore have the usual default version of gcc on their machine, 36 36 and will not have tested to see what happens if a different gcc is selected. … … 41 41 It does this by specifying the desired compiler's complete path in the CC environment variable 42 42 during the port's configure phase. 43 For example, on OS X 10. 4 and 10.5, CC is set to the value "`/usr/bin/gcc-4.0`"43 For example, on OS X 10.8, CC is set to the value "`/usr/bin/clang`" 44 44 so that there is no ambiguity. 45 45