#30009 closed enhancement (fixed)
Choose default compiler based on Xcode version
Reported by: | jeremyhu (Jeremy Huddleston Sequoia) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.0.0 |
Component: | base | Version: | 1.9.99 |
Keywords: | Cc: | ||
Port: |
Description
I haven't stress tested this, but it seems to work with my one quick test. We should probably use rpm-vercomp in macports.tcl as well.
I really feel strongly that this is the right way to determine the CC version. The only case that this changes is with Xcode 4.0 on Snow Leopard. Currently, it will use gcc-4.2, but after the patch, it will use llvm-gcc-4.2.
Attachments (2)
Change History (6)
Changed 13 years ago by jmroot (Joshua Root)
Attachment: | default_compiler_from_xcode.patch added |
---|
comment:1 Changed 13 years ago by jmroot (Joshua Root)
Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Attachment: | default_compiler_from_xcode.2.patch added |
---|
default_compiler_from_xcode.patch (v2)
comment:2 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)
updated based on your comments
comment:3 Changed 13 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | new → closed |
r80088 - made two more changes:
- gcc-4.2 is not compatible with the 10.4 SDK so use gcc-4.0 when targeting it
- only set CC=/usr/bin/cc in selfupdate if we're on Darwin
comment:4 Changed 13 years ago by jmroot (Joshua Root)
Milestone: | MacPorts Future → MacPorts 2.0.0 |
---|
Note: See
TracTickets for help on using
tickets.
There are a few little tweaks I want to make to this, for example Xcode < 2.4 should still choose gcc-4.0 and only $xcodeversion == "" should result in "gcc" being used. I also need to satisfy myself that it interacts correctly with changing macosx_deployment_target.
BTW, on reflection, the code setting CC for selfupdate is pretty overengineered. The only reason it exists at all is because Ryan complained about it using "gcc" which tripped over his modified binpath that contained a fake error-throwing gcc in order to catch ports that do that. It's a complete non-issue for base because it removes ${prefix} from its PATH in the configure script and therefore "gcc" is exactly equivalent to "/usr/bin/gcc" which is always linked to our preferred compiler. Probably just setting CC=/usr/bin/cc would be a decent compromise.