Changes between Version 60 and Version 61 of PortfileRecipes


Ignore:
Timestamp:
Mar 25, 2013, 8:07:03 AM (11 years ago)
Author:
larryv (Lawrence Velázquez)
Comment:

re-break lines for better diffs

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v60 v61  
    308308== Providing compiler variants == #gcc
    309309
    310 By default, a port will compile using Apple's Clang or GCC compiler. For most ports this is fine, but some require a recent version of GCC, or are for some reason incompatible with Apple's version. In these cases you can use `configure.compiler` to specify an alternate compiler, for example one provided by a MacPorts GCC port. More commonly, a port specifies such a compiler because it needs GCJ or GFortran, which Apple does not provide. The software may also install a library or use a library built with a different GCC; subtle and difficult-to-find errors can occur if a library and the program using it are not both compiled with the same compiler.
    311 
    312 So 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 `gcc47`. On the other hand, a user may want to choose their GCC version. Therefore, ports that need to use a GCC port, but aren't picky about exactly which one, are encouraged to offer variants:
     310By default, a port will compile using Apple's Clang or GCC compiler. For
     311most ports this is fine, but some require a recent version of GCC, or
     312are for some reason incompatible with Apple's version. In these cases
     313you can use `configure.compiler` to specify an alternate compiler, for
     314example one provided by a MacPorts GCC port. More commonly, a port
     315specifies such a compiler because it needs GCJ or GFortran, which Apple
     316does not provide. The software may also install a library or use
     317a library built with a different GCC; subtle and difficult-to-find
     318errors can occur if a library and the program using it are not both
     319compiled with the same compiler.
     320
     321So on the one hand, all such ports should default to using a particular
     322common version of GCC; the version we are currently using as the default
     323version in MacPorts is `gcc47`. On the other hand, a user may want to
     324choose their GCC version. Therefore, ports that need to use a GCC port,
     325but aren't picky about exactly which one, are encouraged to offer
     326variants:
    313327
    314328{{{
     
    350364}}}
    351365
    352 Note 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. Note also that the 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.).
    353 
    354 Setting `configure.compiler` changes the values MacPorts puts in variables like `configure.cc`, `configure.cxx`, `configure.f77`, etc., which MacPorts automatically sets as environment variables during the configure phase. If the software in question doesn't use the configure phase, and you therefore need to pass these variables to the build phase, you must do so in a `pre-build` block; if you try to do so directly in the portfile body, you'll pick up the original values, before the variant changed them.
     366Note that the variants are all marked as conflicting with one another,
     367and that one is chosen by default if the user has not picked one. Note
     368also that the dependencies are library dependencies because programs
     369compiled using these compilers will generally end up linked to at least
     370one of the compiler's libraries (i.e. `libgcc_s.dylib`,
     371`libgfortran.dylib`, etc.).
     372
     373Setting `configure.compiler` changes the values MacPorts puts in
     374variables like `configure.cc`, `configure.cxx`, `configure.f77`, etc.,
     375which MacPorts automatically sets as environment variables during the
     376configure phase. If the software in question doesn't use the configure
     377phase, and you therefore need to pass these variables to the build
     378phase, you must do so in a `pre-build` block; if you try to do so
     379directly in the portfile body, you'll pick up the original values,
     380before the variant changed them.
    355381
    356382{{{