The xcode-1.0 portgroup doesn't use the configure phase, so it doesn't benefit 
from the automatic setting of CC, CXX and related variables that MacPorts base 
does during the configure phase.

Instead it does this:

    switch -- [option configure.compiler] {
        gcc-3.3 {set gcc_version 3.3}
        gcc-4.0 {set gcc_version 4.0}
        gcc-4.2 {set gcc_version 4.2}
        llvm-gcc-4.2 {set gcc_version com.apple.compilers.llvmgcc42}
        clang {set gcc_version com.apple.compilers.llvm.clang.1_0}
    }
    if {[info exists gcc_version]} {
        append xcode_build_args " GCC_VERSION=${gcc_version}"
    }

So for any other compiler (i.e. any MacPorts gcc or clang or llvm-gcc) it will 
do nothing.

Why do we have to use this Xcode-specific GCC_VERSION variable? Could we just 
use CC and CXX and thereby support all compilers?

Here's where we started using GCC_VERSION:

https://trac.macports.org/changeset/77279

Curiously, Homebrew used to set CC and CXX, and it apparently did have an 
effect for xcodebuild and two years ago they had a bug report that they should 
stop doing this:

https://github.com/mxcl/homebrew/issues/6406

But I propose we start doing this. Otherwise it's hard to try to build a port 
using e.g. a MacPorts clang compiler -- which I do often, as an easier way to 
test what might happen on older versions of Xcode. If there are individual 
ports whose Xcode projects specify an older compiler and they don't work with 
the latest clang, well, that's what compiler.blacklist is for.


_______________________________________________
macports-dev mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-dev

Reply via email to