| 50 | |
| 51 | # Use Fortran recipe (see below) w/o g95 as modules would not build with g95; |
| 52 | # https://trac.macports.org/wiki/PortfileRecipes#fortran |
| 53 | |
| 54 | if {${subport} != ${name}} { |
| 55 | set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9} |
| 56 | set default_fortran_variant +gcc48 |
| 57 | |
| 58 | foreach ver ${gcc_versions} { |
| 59 | set ver_no_dot [join [split ${ver} "."] ""] |
| 60 | |
| 61 | variant gcc${ver_no_dot} description {build with gfortran from gcc${ver_no_dot}} {} |
| 62 | |
| 63 | foreach over ${gcc_versions} { |
| 64 | if {${ver} == ${over}} { |
| 65 | continue |
| 66 | } |
| 67 | |
| 68 | set over_no_dot [join [split ${over} "."] ""] |
| 69 | variant gcc${ver_no_dot} conflicts gcc${over_no_dot} {} |
| 70 | } |
| 71 | |
| 72 | if {[variant_isset gcc${ver_no_dot}]} { |
| 73 | if {${default_fortran_variant} != "+gcc${ver_no_dot}"} { |
| 74 | set default_fortran_variant "" |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | if {${default_fortran_variant} != ""} { |
| 80 | default_variants-append "${default_fortran_variant}" |
| 81 | } |
| 82 | |
| 83 | foreach ver ${gcc_versions} { |
| 84 | set ver_no_dot [join [split ${ver} "."] ""] |
| 85 | |
| 86 | if {[variant_isset gcc${ver_no_dot}]} { |
| 87 | depends_lib-append port:libgcc |
| 88 | depends_build-append port:gcc${ver_no_dot} |
| 89 | |
| 90 | configure.fc ${prefix}/bin/gfortran-mp-${ver} |
| 91 | configure.f77 ${prefix}/bin/gfortran-mp-${ver} |
| 92 | configure.f90 ${prefix}/bin/gfortran-mp-${ver} |
| 93 | } |
| 94 | } |
| 95 | } |