Ticket #53605: gcc6-libcxx.2.diff

File gcc6-libcxx.2.diff, 1.5 KB (added by RJVB (René Bertin), 8 years ago)
  • lang/gcc6/Portfile

    old new  
    196196        ln -s libgcc/libstdc++.6.dylib ${destroot}${prefix}/lib/libstdc++.6.dylib
    197197    }
    198198} else {
     199
     200foreach cdv {3.9 4.0} {
     201    set cv [join [split ${cdv} "."] ""]
     202    variant libcxx${cv} description "Build to use libc++ and the corresponding headers from port:clang-${cdv}" {}
     203    if {[variant_isset libcxx${cv}]} {
     204        depends_run-append  port:clang-${cdv}
     205        patchfiles-append   patch-use-libcxx.diff
     206        post-patch {
     207            reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/gcc/incpath.c
     208        }
     209    }
     210}
     211
    199212depends_run-append         port:gcc_select
    200213
    201214post-destroot {
     
    226239            }
    227240        }
    228241    }
     242    foreach cdv {3.9 4.0} {
     243        set cv [join [split ${cdv} "."] ""]
     244        if {[variant_isset libcxx${cv}]} {
     245            # move the stdc++ headers out of the way
     246            xinstall -m 755 -d ${destroot}${prefix}/include/${name}-stdinc
     247            file rename ${destroot}${prefix}/include/${name}/c++ ${destroot}${prefix}/include/${name}-stdinc/c++
     248            # replace with a symlink to the corresponding libc++ headers
     249            ui_msg "ln -s ${prefix}/libexec/llvm-${cdv}/include/c++/v1 ${destroot}${prefix}/include/${name}/c++"
     250            ln -s ${prefix}/libexec/llvm-${cdv}/include/c++/v1 ${destroot}${prefix}/include/${name}/c++
     251        }
     252    }
    229253}
    230254
    231255select.group        gcc