Ignore:
Timestamp:
Nov 1, 2013, 9:16:23 PM (6 years ago)
Author:
takeshi@…
Message:

hdf4: provide Fortran variants a la PortfileRecipes#fortran

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/science/hdf4/Portfile

    r110143 r112813  
    5151}
    5252
    53 variant g95 conflicts gcc43 gcc44 gcc45 gcc46 gcc47 gcc48 universal description {build with g95} {
    54     configure.args-delete   --disable-fortran --enable-shared
    55     depends_build-append    port:g95
    56     configure.f77           ${prefix}/bin/g95
    57     configure.fflags-append -fno-second-underscore
     53set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
     54set g95_conflicts {}
     55
     56foreach ver ${gcc_versions} {
     57    set ver_no_dot [join [split ${ver} "."] ""]
     58
     59    set variant_line {variant gcc${ver_no_dot} description "build with gfortran from gcc${ver_no_dot}" conflicts g95}
     60
     61    foreach over ${gcc_versions} {
     62        if {${ver} == ${over}} {
     63            continue
     64        }
     65
     66        set over_no_dot [join [split ${over} "."] ""]
     67        append variant_line " conflicts gcc${over_no_dot}"
     68    }
     69    append variant_line { {}}
     70
     71    eval $variant_line
     72
     73    append g95_conflicts " conflicts gcc${ver_no_dot}"
    5874}
    5975
    60 variant gcc43 conflicts g95 gcc44 gcc45 gcc46 gcc47 gcc48 universal description {build with gfortran 4.3} {
    61     configure.args-delete   --disable-fortran --enable-shared
    62     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    63     depends_build-append    port:gcc43
    64     configure.f77           ${prefix}/bin/gfortran-mp-4.3
     76eval [concat {variant g95 description {build with g95}} $g95_conflicts {{}}]
     77
     78foreach ver ${gcc_versions} {
     79    set ver_no_dot [join [split ${ver} "."] ""]
     80
     81    if {[variant_isset gcc${ver_no_dot}]} {
     82        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
     83        depends_build-append port:gcc${ver_no_dot}
     84
     85        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
     86        configure.f77 ${prefix}/bin/gfortran-mp-${ver}
     87        configure.f90 ${prefix}/bin/gfortran-mp-${ver}
     88        configure.args-delete   --disable-fortran --enable-shared
     89    }
    6590}
    6691
    67 variant gcc44 conflicts g95 gcc43 gcc45 gcc46 gcc47 gcc48 universal description {build with gfortran 4.4} {
     92if {[variant_isset g95]} {
     93    depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
     94    depends_build-append port:g95
     95
     96    configure.fc ${prefix}/bin/g95
     97    configure.f77 ${prefix}/bin/g95
     98    configure.f90 ${prefix}/bin/g95
    6899    configure.args-delete   --disable-fortran --enable-shared
    69     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    70     depends_build-append    port:gcc44
    71     configure.f77           ${prefix}/bin/gfortran-mp-4.4
    72 }
    73 
    74 variant gcc45 conflicts g95 gcc43 gcc44 gcc46 gcc47 gcc48 universal description {build with gfortran 4.5} {
    75     configure.args-delete   --disable-fortran --enable-shared
    76     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    77     depends_build-append    port:gcc45
    78     configure.f77           ${prefix}/bin/gfortran-mp-4.5
    79 }
    80 
    81 variant gcc46 conflicts g95 gcc43 gcc44 gcc45 gcc47 gcc48 universal description {build with gfortran 4.6} {
    82     configure.args-delete   --disable-fortran --enable-shared
    83     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    84     depends_build-append    port:gcc46
    85     configure.f77           ${prefix}/bin/gfortran-mp-4.6
    86 }
    87 
    88 variant gcc47 conflicts g95 gcc43 gcc44 gcc45 gcc46 gcc48 universal description {build with gfortran 4.7} {
    89     configure.args-delete   --disable-fortran --enable-shared
    90     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    91     depends_build-append    port:gcc47
    92     configure.f77           ${prefix}/bin/gfortran-mp-4.7
    93 }
    94 
    95 variant gcc48 conflicts g95 gcc43 gcc44 gcc45 gcc46 gcc47 universal description {build with gfortran 4.8} {
    96     configure.args-delete   --disable-fortran --enable-shared
    97     depends_lib-append      path:lib/libgcc/libgcc_s.1.dylib:libgcc
    98     depends_build-append    port:gcc48
    99     configure.f77           ${prefix}/bin/gfortran-mp-4.8
     100    configure.fflags-append -fno-second-underscore
    100101}
    101102
Note: See TracChangeset for help on using the changeset viewer.