362 | | # Check we are using a clang compiler |
363 | | pre-fetch { |
364 | | if { ![string match "*clang*" ${configure.compiler}] || [string match "macports-clang-3.3" ${configure.compiler}] } { |
365 | | ui_error "The cocoa variant is experimental and can currently only be built" |
366 | | ui_error "using a clang(<3.3) compiler. Your current compiler is ${configure.compiler}." |
367 | | ui_error "Please try again using either of the clang31 or clang32 variants," |
368 | | ui_error "or the system clang compiler using configure.compiler=clang" |
369 | | return -code error "Unsupported compiler for cocoa support" |
370 | | } |
371 | | } |
| 357 | # Force a compatible clang compiler |
| 358 | PortGroup compiler_blacklist_versions 1.0 |
| 359 | compiler.blacklist-append {clang < 425} *gcc* macports-clang-3.3 macports-clang-2.9 macports-clang-3.0 |
| 360 | compiler.fallback-append macports-clang-3.2 macports-clang-3.1 |
379 | | variant gcc45 conflicts gcc46 gcc47 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.5} { |
380 | | configure.compiler macports-gcc-4.5 |
381 | | } |
382 | | |
383 | | variant gcc46 conflicts gcc45 gcc47 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.6} { |
384 | | configure.compiler macports-gcc-4.6 |
385 | | } |
386 | | |
387 | | variant gcc47 conflicts gcc45 gcc46 gcc48 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.7} { |
388 | | configure.compiler macports-gcc-4.7 |
389 | | } |
390 | | |
391 | | variant gcc48 conflicts gcc45 gcc46 gcc47 clang31 clang32 clang33 description {Compile using MacPorts gcc 4.8} { |
392 | | configure.compiler macports-gcc-4.8 |
393 | | } |
394 | | |
395 | | variant clang31 conflicts gcc45 gcc46 gcc47 gcc48 clang32 clang33 description {Compile using MacPorts clang 3.1} { |
| 368 | variant clang31 conflicts clang32 clang33 description {Compile using MacPorts clang 3.1} { |
| 424 | # ======================================================================================== |
| 425 | # Following is for fortran support |
| 426 | # Might eventually move to a portgroup, or similar, so could be simplified. |
| 427 | # Based on recipe from https://trac.macports.org/wiki/PortfileRecipes#fortran |
| 428 | # Note that g95 does not work here, so that variant is removed |
| 429 | # ======================================================================================== |
| 430 | |
| 431 | set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9} |
| 432 | set default_fortran_variant +gcc48 |
| 433 | |
| 434 | foreach ver ${gcc_versions} { |
| 435 | set ver_no_dot [join [split ${ver} "."] ""] |
| 436 | |
| 437 | set variant_line {variant gcc${ver_no_dot} description "Build with gfortran from gcc${ver_no_dot}"} |
| 438 | |
| 439 | foreach over ${gcc_versions} { |
| 440 | if {${ver} == ${over}} { |
| 441 | continue |
| 442 | } |
| 443 | |
| 444 | set over_no_dot [join [split ${over} "."] ""] |
| 445 | append variant_line " conflicts gcc${over_no_dot}" |
| 446 | } |
| 447 | append variant_line { {}} |
| 448 | |
| 449 | eval $variant_line |
| 450 | |
| 451 | if {[variant_isset gcc${ver_no_dot}]} { |
| 452 | if {${default_fortran_variant} != "+gcc${ver_no_dot}"} { |
| 453 | set default_fortran_variant "" |
| 454 | } |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | if {${default_fortran_variant} != ""} { |
| 459 | default_variants-append "${default_fortran_variant}" |
| 460 | } |
| 461 | |
| 462 | foreach ver ${gcc_versions} { |
| 463 | set ver_no_dot [join [split ${ver} "."] ""] |
| 464 | |
| 465 | if {[variant_isset gcc${ver_no_dot}]} { |
| 466 | depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc |
| 467 | depends_build-append port:gcc${ver_no_dot} |
| 468 | |
| 469 | configure.fc ${prefix}/bin/gfortran-mp-${ver} |
| 470 | configure.f77 ${prefix}/bin/gfortran-mp-${ver} |
| 471 | configure.f90 ${prefix}/bin/gfortran-mp-${ver} |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | # ======================================================================================== |
| 476 | |