Ticket #49241: Portfile.diff

File Portfile.diff, 1.8 KB (added by howarth.at.macports@…, 9 years ago)

Portfile diff to build against the clang compilers

  • Portfile

    old new  
    66
    77name                    llvm-gcc42
    88version                 2336.11
    9 revision                2
     9revision                3
    1010set gcc_version         4.2.1
    1111categories              lang
    1212platforms               darwin
     
    3737
    3838supported_archs i386 x86_64
    3939
    40 if {${os.platform} eq "darwin" && ${os.major} >= 15} {
    41     depends_lib
    42     depends_run
    43     archive_sites
    44     pre-fetch {
    45         ui_error "${name} is not supported on El Capitan or later."
    46         return -code error {unsupported platform}
    47     }
    48 }
    49 
    5040select.group    gcc
    5141select.file     ${filespath}/mp-llvm-gcc42
    5242
     
    5444set objroot ${workpath}/objroot
    5545set symroot ${workpath}/symroot
    5646
    57 # https://trac.macports.org/ticket/42899
    58 # TODO: Fix it to build with newer clang
    59 compiler.blacklist-append {clang > 503} macports-clang-3.4 macports-clang-3.5 macports-clang-3.6 macports-clang-3.7
    60 
    6147# Don't compile with self
    6248compiler.blacklist-append macports-llvm-gcc-4.2
    6349
     
    8268        autogen.patch \
    8369        fixincludes.patch
    8470
     71if {[string match *clang* ${configure.cc}]} {
     72    patchfiles-append clang-optimization.patch
     73}
     74
    8575post-extract {
    8676    xinstall -W ${filespath} build_gcc ${worksrcpath}
    8777}
     
    130120    if {[string match "*clang*" ${configure.compiler}]} {
    131121        reinplace "s:--enable-werror : :" ${worksrcpath}/build_gcc
    132122    }
     123
     124    # ltmain.sh notes 'On all known operating systems, these are identical', and -module has gone
     125    # away with Apple's clang-3.4
     126    if {[string match *clang* ${configure.cc}]} {
     127         reinplace "s:module:export_dynamic:" ${worksrcpath}/llvmCore/Makefile.rules
     128         reinplace "s:-no-undefined::" ${worksrcpath}/llvmCore/tools/lto/Makefile
     129    }
    133130}
    134131
    135132compiler.cpath /usr/include