[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Tue May 22 17:17:16 PDT 2012


Changed page "PortfileRecipes" by ryandesign at macports.org from 72.48.210.127*
Page URL: <https://trac.macports.org/wiki/PortfileRecipes>
Diff URL: <https://trac.macports.org/wiki/PortfileRecipes?action=diff&version=39>
Revision 39
Comment: add gcc46 gcc47 variants; reword and explain why we still default to gcc45

-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 38)
+++ PortfileRecipes (version: 39)
@@ -297,33 +297,45 @@
 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.
-
-On the one hand, such ports should prefer to use the newest suitable stable version of gcc they can.
-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.
+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 description {Compile with gcc 4.3} {
+variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
     configure.compiler macports-gcc-4.3
     depends_lib-append port:gcc43
 }
 
-variant gcc44 conflicts gcc43 gcc45 description {Compile with gcc 4.4} {
+variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
     configure.compiler macports-gcc-4.4
     depends_lib-append port:gcc44
 }
 
-variant gcc45 conflicts gcc43 gcc44 description {Compile with gcc 4.5} {
+variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
     configure.compiler macports-gcc-4.5
     depends_lib-append port:gcc45
 }
 
-if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc45]} {
+variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 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} {
+    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 the newest one is chosen by default if the user has not picked one.
+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.
@@ -336,10 +348,6 @@
                     CXX=${configure.cxx}
 }
 }}}
-
-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.
-
 
 
 == Replacing and renaming ports == #replaced-by

-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on PortfileRecipes. If it was not you, please
report to .


More information about the macports-changes mailing list