[110106] trunk/dports/math/octave-devel/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Mon Aug 26 01:15:41 PDT 2013


Revision: 110106
          https://trac.macports.org/changeset/110106
Author:   jeremyhu at macports.org
Date:     2013-08-26 01:15:41 -0700 (Mon, 26 Aug 2013)
Log Message:
-----------
octave-devel: Use fortran recipe like octave

Modified Paths:
--------------
    trunk/dports/math/octave-devel/Portfile

Modified: trunk/dports/math/octave-devel/Portfile
===================================================================
--- trunk/dports/math/octave-devel/Portfile	2013-08-26 08:13:34 UTC (rev 110105)
+++ trunk/dports/math/octave-devel/Portfile	2013-08-26 08:15:41 UTC (rev 110106)
@@ -6,7 +6,7 @@
 
 name                octave-devel
 version             3.6.4
-revision            6
+revision            7
 conflicts           octave
 categories          math science
 maintainers         michaelld openmaintainer
@@ -113,78 +113,65 @@
     build.args-append LANG="C"
 }
 
-variant gcc43 description {build with the macports gcc43 toolchain} \
-    conflicts gcc49 gcc48 gcc47 gcc46 gcc45 gcc44 g95 {}
+set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
+set default_fortran_variant +gcc48
 
-variant gcc44 description {build with the macports gcc44 toolchain} \
-    conflicts gcc49 gcc48 gcc47 gcc46 gcc45 gcc43 g95 {}
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
 
-variant gcc45 description {build with the macports gcc45 toolchain} \
-    conflicts gcc49 gcc48 gcc47 gcc46 gcc44 gcc43 g95 {}
+    variant gcc${ver_no_dot} description {build with gfortran from gcc${ver_no_dot}} {}
 
-variant gcc46 description {build with the macports gcc46 toolchain} \
-    conflicts gcc49 gcc48 gcc47 gcc45 gcc44 gcc43 g95 {}
+    variant gcc${ver_no_dot} conflicts g95 {}
+    variant g95 conflicts gcc${ver_no_dot} {}
 
-variant gcc47 description {build with the macports gcc47 toolchain} \
-    conflicts gcc49 gcc48 gcc46 gcc45 gcc44 gcc43 g95 {}
+    foreach over ${gcc_versions} {
+        if {${ver} == ${over}} {
+            continue
+        }
 
-variant gcc48 description {build with the macports gcc48 toolchain} \
-    conflicts gcc49 gcc47 gcc46 gcc45 gcc44 gcc43 g95 {}
+        set over_no_dot [join [split ${over} "."] ""]
+        variant gcc${ver_no_dot} conflicts gcc${over_no_dot} {}
+    }
 
-variant gcc49 description {build with the macports gcc49 toolchain} \
-    conflicts gcc48 gcc47 gcc46 gcc45 gcc44 gcc43 g95 {}
+    if {[variant_isset gcc${ver_no_dot}]} {
+        if {${default_fortran_variant} != "+gcc${ver_no_dot}"} {
+            set default_fortran_variant ""
+        }
+    }
+}
 
-variant g95 description {build with g95 as the Fortran compiler} \
-    conflicts gcc49 gcc48 gcc47 gcc46 gcc45 gcc44 gcc43 {}
+variant g95 description {build with g95} {}
 
-# check for GCC / G95 variants.  The default here does not have to
-# match the default found in the 'atlas' port.
-
-# check for setting the default variant (gcc47)
-
-if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
-     ![variant_isset gcc45] && ![variant_isset gcc46] && \
-     ![variant_isset gcc47] && ![variant_isset gcc48] && \
-     ![variant_isset gcc49] && ![variant_isset g95] } {
-    default_variants +gcc47
+if {[variant_isset g95]} {
+    if {${default_fortran_variant} != "+g95"} {
+        set default_fortran_variant ""
+    }
 }
 
-# check if the user disabled just the default variant: -gcc47
-
-if { ![variant_isset gcc43] && ![variant_isset gcc44] && \
-     ![variant_isset gcc45] && ![variant_isset gcc46] && \
-     ![variant_isset gcc47] && ![variant_isset gcc48] && \
-     ![variant_isset gcc49] && ![variant_isset g95] } {
-    ui_error "\n\nYou cannot use the -gcc47 variant alone; a Fortran compiler is required.\n"
-    return -code error "Invalid variant selection"
+if {${default_fortran_variant} != ""} {
+    default_variants "${default_fortran_variant}"
 }
 
-# use the correct +gccXY, if selected
+foreach ver ${gcc_versions} {
+    set ver_no_dot [join [split ${ver} "."] ""]
 
-set gcc_version ""
-if {[variant_isset gcc43]} {
-    set gcc_version "4.3"
-} elseif {[variant_isset gcc44]} {
-    set gcc_version "4.4"
-} elseif {[variant_isset gcc45]} {
-    set gcc_version "4.5"
-} elseif {[variant_isset gcc46]} {
-    set gcc_version "4.6"
-} elseif {[variant_isset gcc47]} {
-    set gcc_version "4.7"
-} elseif {[variant_isset gcc48]} {
-    set gcc_version "4.8"
-} elseif {[variant_isset gcc49]} {
-    set gcc_version "4.9"
+    if {[variant_isset gcc${ver_no_dot}]} {
+        depends_lib-append port:libgcc
+        depends_build-append port:gcc${ver_no_dot}
+
+        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
+        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
+        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
+    }
 }
 
-if {${gcc_version} != ""} {
+if {[variant_isset g95]} {
+    depends_lib-append port:libgcc
+    depends_build-append port:g95
 
-    set gcc_version_join [join [split ${gcc_version} "."] ""]
-    configure.ldflags    -L${prefix}/lib/gcc${gcc_version_join} \
-        -lstdc++ -lgfortran
-    configure.compiler   macports-gcc-${gcc_version}
-
+    configure.fc ${prefix}/bin/g95
+    configure.f77 ${prefix}/bin/g95
+    configure.f90 ${prefix}/bin/g95
 }
 
 variant atlas description {use BLAS from MacPorts' atlas port} \
@@ -194,39 +181,8 @@
     {use BLAS from Apple's Accelerate.framework [might be buggy]} \
     conflicts atlas {}
 
-if {[variant_isset g95]} {
-
-    # +g95, so no +gccXY; blacklist all of the MacPorts GCC compilers;
-    # all others should work OK, since they do not provide Fortran.
-    # When using +gccXY, the Fortran compiler from that variant must
-    # be used otherwise symbols will come up as undefined.
-
-    compiler.blacklist \
-        macports-gcc-4.2 macports-gcc-4.3 macports-gcc-4.4 \
-        macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 \
-        macports-gcc-4.8 macports-gcc-4.9
-
-    default_variants     +accelerate
-
-    depends_build-append port:g95
-    configure.f77        ${prefix}/bin/g95
-
-} else {
-
-    # no +g95, so using +gccXY; blacklist all the other non-Fortran
-    # providing compilers; we cannot mix and match compilers if using
-    # +gccXY.
-
-    compiler.blacklist gcc-3.3 gcc-4.0 gcc-4.2 llvm-gcc-4.2 \
-        apple-gcc-4.0 apple-gcc-4.2 clang macports-clang-2.9 \
-        macports-clang-3.0 macports-clang-3.1 macports-clang-3.2 \
-        macports-clang-3.3 macports-llvm-gcc-4.2
-
-    # if using +gccXY, default to +atlas
-
-    if {![variant_isset accelerate] && ![variant_isset atlas]} {
-        default_variants +atlas
-    }
+if {![variant_isset accelerate] && ![variant_isset atlas]} {
+    default_variants +atlas
 }
 
 # make sure that either +accelerate or +atlas is selected
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130826/553efc61/attachment.html>


More information about the macports-changes mailing list