Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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:


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)

default_compiler_from_xcode.patch (3.1 KB) - added by jmroot (Joshua Root) 10 years ago.
default_compiler_from_xcode.2.patch (2.9 KB) - added by jeremyhu (Jeremy Huddleston Sequoia) 10 years ago.
default_compiler_from_xcode.patch (v2)

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by jmroot (Joshua Root)

comment:1 Changed 10 years ago by jmroot (Joshua Root)

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.

Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

default_compiler_from_xcode.patch (v2)

comment:2 Changed 10 years ago by jeremyhu (Jeremy Huddleston Sequoia)

updated based on your comments

comment:3 Changed 10 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

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 10 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.0.0
Note: See TracTickets for help on using tickets.