# $Id$ PortSystem 1.0 PortGroup compiler_blacklist_versions 1.0 name libunwind version 3.6.0 subport ${name}-headers { } epoch 1 categories devel platforms darwin license MIT NCSA maintainers jeremyhu openmaintainer description A version of Apple's libunwind library that is included in libSystem long_description Apple's libunwind library (part of libSystem) was released as OSS and is \ now stewarded by the LLVM Project. This version installs headers outside \ of the normal filesystem hierarchy in order to not accidentally conflict \ with the host implementation that other ports may expect. homepage http://blog.llvm.org/2013/10/new-libunwind-implementation-in-libcabi.html master_sites http://www.llvm.org/releases/${version}/ dist_subdir llvm use_xz yes distname libcxxabi-${version}.src checksums rmd160 bdbc09554b5427fedcc66f72058da3d3618a7692 \ sha256 f78bcfdb8015272f28d70f5546a544b5bdae5d92862711e8ecb9b24387d994f5 use_configure no post-extract { file copy ${filespath}/Makefile ${build.dir}/Makefile } patch.pre_args -p1 patchfiles \ 0002-libunwind-Fix-fallback-implementation-of-_dyld_find_.patch \ 0003-libunwind-Add-missing-include-of-libunwind_ext.h-to-.patch \ 0004-libunwind-Use-__builtin_trap-rather-than-__builtin_u.patch \ 0005-libunwind-ppc-build-fix.patch \ 0006-libunwind-Only-include-Availability.h-on-Leopard-and.patch \ 0008-libunwind-MacPorts-availability.patch \ 1001-Define-__STDC_FORMAT_MACROS-to-bring-in-format-macro.patch post-patch { if {${os.major} < 9} { foreach reg {cr ctr eax ebp ebx ecx edi edx eip esi esp lr mq r0 r1 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r2 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r3 r30 r31 r4 r5 r6 r7 r8 r9 rax rbp rbx rcx rdi rdx rip rsi rsp srr0 srr1 vrsave xer} { reinplace "s|__${reg}|${reg}|g" ${build.dir}/Registers.hpp } } } set cxx_stdlibflags {} if {[string match *clang* ${configure.cxx}]} { set cxx_stdlibflags -stdlib=${configure.cxx_stdlib} } build.dir ${worksrcpath}/src/Unwind destroot.dir ${build.dir} if {${subport} == "${name}-headers"} { supported_archs noarch build {} destroot.target installhdrs destroot.args \ PREFIX="${prefix}" } else { # Technically not needed, but subports will expect depending on libunwind to pull in the headers depends_lib-append port:libunwind-headers # 3.5 and 3.6 are blacklisted to prevent dependency cycles compiler.blacklist macports-clang-3.5 macports-clang-3.6 variant universal {} set asflags {} if {[variant_isset universal] && [lsearch ${universal_archs} ppc] != -1} { if {[string match *clang* ${configure.cc}]} { set asflags "-fno-integrated-as" } } if {${os.major} < 11} { # Snow Leopard's libSystem's libmacho does not contain getsectiondata() depends_build-append port:libmacho configure.cppflags-append -DUSE_MACPORTS_LIBUNWIND configure.ldflags-append -lmacho } configure.cflags-append -std=gnu99 build.args \ PREFIX="${prefix}" \ CC="${configure.cc}" \ CXX="${configure.cxx}" \ CPPFLAGS="${configure.cppflags} -DNDEBUG" \ CFLAGS="${configure.cflags}" \ CXXFLAGS="${configure.cxxflags} ${cxx_stdlibflags}" \ ASFLAGS="${asflags}" \ LDFLAGS="${configure.ldflags} ${cxx_stdlibflags}" \ RC_ARCHS="[get_canonical_archs]" \ LIBUNWIND_CURRENT_VERSION=${version} if {[vercmp $xcodeversion 3.2] < 0 && [string match "*macports*" ${configure.compiler}]} { # Xcode 3.1.4 fails with load commands in the newer toolchain depends_build-append port:cctools build.args-append \ AR=${prefix}/bin/ar \ RANLIB=${prefix}/bin/ranlib } destroot.target installlibs destroot.args \ PREFIX="${prefix}" \ STRIP_ON_INSTALL="NO" } livecheck.type none