Changes between Version 38 and Version 39 of PortfileRecipes


Ignore:
Timestamp:
May 23, 2012, 12:17:15 AM (12 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add gcc46 gcc47 variants; reword and explain why we still default to gcc45

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v38 v39  
    298298In these cases you can use `configure.compiler` to specify an alternate compiler, for example one provided by a MacPorts gcc port.
    299299More commonly, a port specifies such a compiler because it needs gcj or gfortran, which Apple does not provide any version of at all.
    300 
    301 On the one hand, such ports should prefer to use the newest suitable stable version of gcc they can.
    302 On the other hand, a user may already have an older gcc port installed and may not want to spend the time to compile a newer one right now, or may have other reasons for preferring a particular version of gcc.
     300Another reason to want compiler variants is if the software installs a library, or uses a library built with a different gcc.
     301Subtle and difficult-to-find errors can occur if a library and the program using it are not both compiled with the same compiler.
     302
     303So on the one hand, all such ports should default to using a particular common version of gcc; the version we are currently using as the default version in MacPorts is gcc45.
     304On the other hand, a user may want to use a different gcc version.
    303305Therefore, ports that need to use a gcc port, but aren't picky about exactly which one, are encouraged to offer variants:
    304306
    305307{{{
    306 variant gcc43 conflicts gcc44 gcc45 description {Compile with gcc 4.3} {
     308variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
    307309    configure.compiler macports-gcc-4.3
    308310    depends_lib-append port:gcc43
    309311}
    310312
    311 variant gcc44 conflicts gcc43 gcc45 description {Compile with gcc 4.4} {
     313variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
    312314    configure.compiler macports-gcc-4.4
    313315    depends_lib-append port:gcc44
    314316}
    315317
    316 variant gcc45 conflicts gcc43 gcc44 description {Compile with gcc 4.5} {
     318variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
    317319    configure.compiler macports-gcc-4.5
    318320    depends_lib-append port:gcc45
    319321}
    320322
    321 if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45]} {
     323variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {Compile with gcc 4.6} {
     324    configure.compiler macports-gcc-4.6
     325    depends_lib-append port:gcc46
     326}
     327
     328variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46  description {Compile with gcc 4.7} {
     329    configure.compiler macports-gcc-4.7
     330    depends_lib-append port:gcc47
     331}
     332
     333if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
    322334    default_variants +gcc45
    323335}
    324336}}}
    325337
    326 Note that the variants are all marked as conflicting with one another, and that the newest one is chosen by default if the user has not picked one.
     338Note that the variants are all marked as conflicting with one another, and that one is chosen by default if the user has not picked one.
    327339Note also that the compiler dependencies are library dependencies because programs compiled using these compilers will generally end up linked to at least one of the compiler's libraries (i.e. libgcc_s.dylib, libgfortran.dylib, etc.).
    328340
     
    337349}
    338350}}}
    339 
    340 Another reason to want compiler variants is if the software installs a library, or uses a library built with a different gcc.
    341 Subtle and difficult-to-find errors can occur if a library and the program using it are not both compiled with the same compiler.
    342 
    343351
    344352