[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Sun Mar 24 13:44:23 PDT 2013


Page "PortfileRecipes" was changed by larryv at macports.org
Diff URL: <https://trac.macports.org/wiki/PortfileRecipes?action=diff&version=60>
Revision 60
Comment: update default GCC variant; add gcc48; remove some line breaks
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 59)
+++ PortfileRecipes (version: 60)
@@ -307,54 +307,51 @@
 
 == Providing compiler variants == #gcc
 
-By default, a port will compile using Apple's gcc compiler.
-For most ports this is fine, but some require a newer 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 any version of at all.
-Another reason to want compiler variants is if the software installs a library, or uses 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.
-
-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 gcc45.
-On the other hand, a user may want to use a different gcc version.
-Therefore, ports that need to use a gcc port, but aren't picky about exactly which one, are encouraged to offer variants:
-
-{{{
-variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
+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.
+
+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:
+
+{{{
+variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 gcc48 description {Compile with gcc 4.3} {
     configure.compiler macports-gcc-4.3
     depends_lib-append port:gcc43
 }
 
-variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
+variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 gcc48 description {Compile with gcc 4.4} {
     configure.compiler macports-gcc-4.4
     depends_lib-append port:gcc44
 }
 
-variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
+variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 gcc48 description {Compile with gcc 4.5} {
     configure.compiler macports-gcc-4.5
     depends_lib-append port:gcc45
 }
 
-variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {Compile with gcc 4.6} {
+variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 gcc48 description {Compile with gcc 4.6} {
     configure.compiler macports-gcc-4.6
     depends_lib-append port:gcc46
 }
 
-variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46  description {Compile with gcc 4.7} {
+variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 gcc48 description {Compile with gcc 4.7} {
     configure.compiler macports-gcc-4.7
     depends_lib-append port:gcc47
 }
 
-if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47]} {
-    default_variants +gcc45
-}
-}}}
-
-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 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.).
-
-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.
+variant gcc48 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.8} {
+    configure.compiler macports-gcc-4.8
+    depends_lib-append port:gcc48
+}
+
+if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45] &&
+    ![variant_isset gcc46] && ![variant_isset gcc48]
+} then {
+    default_variants +gcc47
+}
+}}}
+
+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.).
+
+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.
 
 {{{
 pre-build {
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/PortfileRecipes>
MacPorts <http://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'PortfileRecipes' page.
If it was not you, please report to .


More information about the macports-changes mailing list