Why can configure.compiler be cc or gcc?

Jeremy Huddleston Sequoia jeremyhu at macports.org
Mon Nov 4 16:45:33 PST 2013


I think those are there for legacy reasons and to support non-OS X installs.

If Xcode isn't present, the default compiler is cc:

proc portconfigure::get_compiler_fallback {} {
    global xcodeversion macosx_deployment_target default_compilers
    if {[info exists default_compilers]} {
        return $default_compilers
    } elseif {$xcodeversion == "none" || $xcodeversion == ""} {
        return {cc}
    } ...
}

--Jeremy

On Nov 3, 2013, at 22:26, Ryan Schmidt <ryandesign at macports.org> wrote:

> Why are “cc” and “gcc” valid values for configure.compiler?
> 
> We have a zillion portfiles that have special handling for clang compilers, usually implemented by checking [string match *clang* ${configure.compiler}]. But on Xcode 5, system cc and system gcc are both clang. So if a user chooses system cc or system gcc as their compiler, the compiler will be clang, but the string matches for clang will be false, which can lead to wrong behavior, such as:
> 
> https://trac.macports.org/ticket/41169
> 
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20131104/6cd5127d/attachment.p7s>


More information about the macports-dev mailing list