Ticket #54289: lcxxabi+runtime.diff

File lcxxabi+runtime.diff, 3.7 KB (added by RJVB (René Bertin), 6 years ago)

port:libcxxabi +runtime variant

  • lang/libcxxabi/Portfile

    old new  
    1414                        replace the host version in order to be used.  On Snow Leopard and earlier, this is done \
    1515                        automatically because there is no existing host version of this library.  On Lion and later, \
    1616                        users must build the port with +replacemnt_libcxx and install the root manually if they wish \
    17                         to replace the existing host implementation.
     17                        to replace the existing host implementation. They can also use the +runtime variant which installs \
     18                        copies of the library that can be loaded via DYLD_INSERT_LIBRARIES\; \
     19                        applications started that way will then use a more recent libc++abi than the host provides.
    1820
    1921homepage                http://libcxxabi.llvm.org/
    2022
     
    5557}
    5658
    5759variant replacemnt_libcxx description {EXPERTS ONLY: Build a replacement libcxxabi and libcxx even if it is already part of the base OS.} {}
     60variant runtime description "Install the libcxxabi library so that it can be used with DYLD_INSERT_LIBRARIES" {
     61    depends_build-append \
     62                        port:cctools
     63}
    5864
    59 if {${os.major} < 11 || [variant_isset replacemnt_libcxx]} {
     65if {${os.major} < 11 || [variant_isset replacemnt_libcxx] || [variant_isset runtime]} {
    6066    compiler.blacklist *gcc* {clang < 300}
    6167
    6268    # clang 3.5 and newer are blacklisted to prevent dependency cycles
     
    102110        CXX="${configure.cxx} ${configure.cppflags}" \
    103111        RC_XBS=1 \
    104112        RC_CFLAGS="[get_canonical_archflags]" \
     113        CXXFLAGS="${configure.optflags}" \
    105114        RC_ProjectSourceVersion="${version}" \
    106115        TRIPLE="-apple-darwin${os.major}"
    107116
     
    115124    # runtime.
    116125
    117126    destroot {
    118         xinstall -m 755 -d ${destroot}${roots_path}/${root_name}/usr/lib
    119         xinstall -m 755 ${worksrcpath}/lib/libc++abi.dylib ${destroot}${roots_path}/${root_name}/usr/lib
    120 
    121         xinstall -m 755 -d ${destroot}${roots_path}/${root_name}/usr/include
    122         xinstall -m 644 ${worksrcpath}/include/__cxxabi_config.h ${destroot}${roots_path}/${root_name}/usr/include
    123         xinstall -m 644 ${worksrcpath}/include/cxxabi.h ${destroot}${roots_path}/${root_name}/usr/include
     127        if {[variant_isset replacemnt_libcxx]} {
     128            xinstall -m 755 -d ${destroot}${roots_path}/${root_name}/usr/lib
     129            xinstall -m 755 ${worksrcpath}/lib/libc++abi.dylib ${destroot}${roots_path}/${root_name}/usr/lib
     130
     131            xinstall -m 755 -d ${destroot}${roots_path}/${root_name}/usr/include
     132            xinstall -m 644 ${worksrcpath}/include/__cxxabi_config.h ${destroot}${roots_path}/${root_name}/usr/include
     133            xinstall -m 644 ${worksrcpath}/include/cxxabi.h ${destroot}${roots_path}/${root_name}/usr/include
    124134
    125         system "cd ${destroot}${roots_path}/${root_name} && tar czf ../${root_name}.tgz ."
    126         file delete -force ${destroot}${roots_path}/${root_name}
     135            system "cd ${destroot}${roots_path}/${root_name} && tar czf ../${root_name}.tgz ."
     136            file delete -force ${destroot}${roots_path}/${root_name}
     137        }
     138        if {[variant_isset runtime]} {
     139            # install as a runtime library that will not be picked up by the linker/editor!
     140            xinstall -m 755 ${worksrcpath}/lib/libc++abi.dylib ${destroot}${prefix}/lib/libc++abi.1.dylib
     141            system "install_name_tool -id ${prefix}/lib/libc++abi.1.dylib ${destroot}${prefix}/lib/libc++abi.1.dylib"
     142        }
    127143    }
    128144} else {
    129145    distfiles