Ticket #25562: miriad-5.diff

File miriad-5.diff, 2.1 KB (added by pkgw (Peter Williams), 14 years ago)

Allow user to use a nonstandard compiler if they really want to

  • ports/science/miriad/Portfile

    diff --git a/ports/science/miriad/Portfile b/ports/science/miriad/Portfile
    index 84077d5..c3a2586 100644
    a b if {[variant_isset carma]} { 
    4848}
    4949
    5050# We need Fortran support, which the Apple version of GCC doesn't offer.
    51 # So we force the use of a specified MacPorts-built GCC.
     51# So we force the use of a specified MacPorts-built GCC. Some users want
     52# to build with better-optimizing proprietary compilers, which we allow
     53# via the gcc_select mechanism.
    5254
    53 variant gcc43 conflicts gcc44 description {build with gcc 4.3} {}
    54 variant gcc44 conflicts gcc43 description {build with gcc 4.4} {}
     55variant gcc43 conflicts gcc44 gccselect description {build with gcc 4.3} {}
     56variant gcc44 conflicts gcc43 gccselect description {build with gcc 4.4} {}
     57variant gccselect conflicts gcc43 gcc44 \
     58    description {build with compilers chosen via gcc_select - experts only} {}
    5559
    5660if {[variant_isset gcc43]} {
    5761    set compilerport  gcc43
    5862    set compilerident macports-gcc-4.3
     63} elseif {[variant_isset gccselect]} {
     64    set compilerport  gcc_select
     65    set compilerident use-gcc-select
    5966} else {
    6067    set compilerport  gcc44
    6168    set compilerident macports-gcc-4.4
    worksrcdir ${name}-${relver} 
    9299configure.args  --bindir=${prefix}/libexec/miriad \
    93100                --with-telescope=${thescope} \
    94101                --disable-docs
    95 configure.compiler ${compilerident}
     102
     103if {${compilerident} != "use-gcc-select"} {
     104    configure.compiler ${compilerident}
     105} else {
     106    # Setting the compiler to vanilla "gcc" prevents MacPorts from
     107    # trying to get fancy with the flags, which probably won't work
     108    # with the user's special compiler.
     109    configure.compiler gcc
     110    configure.cc  "${prefix}/bin/gcc"
     111    configure.cpp "${prefix}/bin/cpp"
     112    configure.cxx "${prefix}/bin/g++"
     113    configure.f77 "${prefix}/bin/gfortran"
     114    configure.fc  "${prefix}/bin/gfortran"
     115    configure.f90 "${prefix}/bin/gfortran"
     116}
    96117
    97118# The telescope configuration is important, so make sure the user is
    98119# told which setup is being used.