[69773] trunk/dports/science/miriad/Portfile

ryandesign at macports.org ryandesign at macports.org
Fri Jul 16 00:19:55 PDT 2010


Revision: 69773
          http://trac.macports.org/changeset/69773
Author:   ryandesign at macports.org
Date:     2010-07-16 00:19:53 -0700 (Fri, 16 Jul 2010)
Log Message:
-----------
miriad: add gcc_select variant; see discussion at #25562

Modified Paths:
--------------
    trunk/dports/science/miriad/Portfile

Modified: trunk/dports/science/miriad/Portfile
===================================================================
--- trunk/dports/science/miriad/Portfile	2010-07-16 07:17:24 UTC (rev 69772)
+++ trunk/dports/science/miriad/Portfile	2010-07-16 07:19:53 UTC (rev 69773)
@@ -48,23 +48,40 @@
 }
 
 # We need Fortran support, which the Apple version of GCC doesn't offer.
-# So we force the use of a specified MacPorts-built GCC.
+# So we force the use of a specified MacPorts-built GCC. Some users want
+# to build with better-optimizing proprietary compilers, which we allow
+# via the gcc_select mechanism.
 
-variant gcc43 conflicts gcc44 description {build with gcc 4.3} {}
-variant gcc44 conflicts gcc43 description {build with gcc 4.4} {}
+variant gcc43 conflicts gcc44 gcc_select description {Build with gcc 4.3} {
+    configure.compiler  macports-gcc-4.3
+    depends_lib-append  port:gcc43
+}
 
-if {[variant_isset gcc43]} {
-    set compilerport  gcc43
-    set compilerident macports-gcc-4.3
-} else {
-    set compilerport  gcc44
-    set compilerident macports-gcc-4.4
+variant gcc44 conflicts gcc43 gcc_select description {Build with gcc 4.4} {
+    configure.compiler  macports-gcc-4.4
+    depends_lib-append  port:gcc44
+}
+
+variant gcc_select conflicts gcc43 gcc44 description {Build with compilers chosen via gcc_select -- experts only} {
+    # Setting the compiler to vanilla "gcc" prevents MacPorts from
+    # trying to get fancy with the flags, which probably won't work
+    # with the user's special compiler.
+    configure.compiler  gcc
+    configure.cc        ${prefix}/bin/gcc
+    configure.cpp       ${prefix}/bin/cpp
+    configure.cxx       ${prefix}/bin/g++
+    configure.f77       ${prefix}/bin/gfortran
+    configure.f90       ${prefix}/bin/gfortran
+    configure.fc        ${prefix}/bin/gfortran
+    depends_lib-append  port:gcc_select
+}
+
+if {![variant_isset gcc43] && ![variant_isset gcc44] && ![variant_isset gcc_select]} {
     default_variants +gcc44
 }
 
 universal_variant    no
 
-depends_build-append port:${compilerport}
 depends_lib-append   port:libpng \
                      port:readline \
                      port:xorg-libice \
@@ -92,7 +109,6 @@
 configure.args  --bindir=${prefix}/libexec/miriad \
                 --with-telescope=${thescope} \
                 --disable-docs
-configure.compiler ${compilerident}
 
 # The telescope configuration is important, so make sure the user is
 # told which setup is being used.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100716/61826163/attachment.html>


More information about the macports-changes mailing list