xcode portgroup and using the right compiler: GCC_VERSION vs CC and CXX

Joshua Root jmr at macports.org
Tue Mar 12 23:29:30 PDT 2013


On 2013-3-13 16:37 , Ryan Schmidt wrote:
> 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?

If that works right with all supported Xcode versions, fine. IIRC,
GCC_VERSION was just the only documented way to set the compiler used in
an Xcode project. (The compilers included with Xcode are probably the
only ones supported for use in Xcode projects.)

- Josh


More information about the macports-dev mailing list