[130895] trunk/dports/devel

jeremyhu at macports.org jeremyhu at macports.org
Sat Jan 3 16:17:20 PST 2015


Revision: 130895
          https://trac.macports.org/changeset/130895
Author:   jeremyhu at macports.org
Date:     2015-01-03 16:17:20 -0800 (Sat, 03 Jan 2015)
Log Message:
-----------
libunwind: Make libunwind-headers a subport of libunwind

Modified Paths:
--------------
    trunk/dports/devel/libunwind/Portfile
    trunk/dports/devel/libunwind/files/Makefile
    trunk/dports/devel/libunwind/files/libunwind-available.patch

Removed Paths:
-------------
    trunk/dports/devel/libunwind-headers/

Modified: trunk/dports/devel/libunwind/Portfile
===================================================================
--- trunk/dports/devel/libunwind/Portfile	2015-01-04 00:16:36 UTC (rev 130894)
+++ trunk/dports/devel/libunwind/Portfile	2015-01-04 00:17:20 UTC (rev 130895)
@@ -5,7 +5,9 @@
 
 name                    libunwind
 version                 3.5.0
-categories              lang
+revision                1
+epoch                   1
+categories              devel
 platforms               darwin
 license                 MIT NCSA
 maintainers             jeremyhu openmaintainer
@@ -42,23 +44,46 @@
 patchfiles \
     libunwind-available.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
-build.args \
-    PREFIX="${prefix}/lib/${name}" \
-    CC="${configure.cc}" \
-    CXX="${configure.cxx}" \
-    CPPFLAGS="${configure.cppflags} -DNDEBUG" \
-    CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
-    CXXFLAGS="${configure.cxxflags} ${cxx_stdlibflags} [get_canonical_archflags cxx]" \
-    LDFLAGS="${configure.ldflags} ${cxx_stdlibflags} [get_canonical_archflags ld]"
+build.dir       ${worksrcpath}/src/Unwind
+destroot.dir    ${build.dir}
 
-destroot.dir  ${build.dir}
-destroot.args \
-    PREFIX="${prefix}/lib/${name}"
+subport libunwind-headers {
+    build {}
 
+    destroot.target installhdrs
+    destroot.args \
+        PREFIX="${prefix}/Developer/SDKs/Darwin${os.major}.sdk/usr"
+}
+
+if {${subport} == "${name}"} {
+    # Technically not needed, but subports will expect depending on libunwind to pull in the headers
+    depends_lib-append port:libunwind-headers
+
+    build.args \
+        PREFIX="${prefix}" \
+        CC="${configure.cc}" \
+        CXX="${configure.cxx}" \
+        CPPFLAGS="${configure.cppflags} -DNDEBUG" \
+        CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
+        CXXFLAGS="${configure.cxxflags} ${cxx_stdlibflags} [get_canonical_archflags cxx]" \
+        LDFLAGS="${configure.ldflags} ${cxx_stdlibflags} [get_canonical_archflags ld]"
+
+    destroot.target installlibs
+    destroot.args \
+        PREFIX="${prefix}"
+}
+
 livecheck.type          none

Modified: trunk/dports/devel/libunwind/files/Makefile
===================================================================
--- trunk/dports/devel/libunwind/files/Makefile	2015-01-04 00:16:36 UTC (rev 130894)
+++ trunk/dports/devel/libunwind/files/Makefile	2015-01-04 00:17:20 UTC (rev 130895)
@@ -12,10 +12,13 @@
 MACHO_INCDIR = $(INCDIR)/mach-o
 LIBUNWIND_FILENAME = libunwind.1.dylib
 LIBUNWIND_SYMLINKNAME = libunwind.dylib
+LIBUNWIND_FILENAME_STATIC = libunwind.a
 LIBUNWIND_COMPAT_VERSION = 1.0.0
 LIBUNWIND_CURRENT_VERSION = 1.0.0
 
 # Default toolchain
+AR =  $(shell xcrun -find ar)
+RANLIB =  $(shell xcrun -find ranlib)
 CC = $(shell xcrun -find cc)
 CXX = $(shell xcrun -find c++)
 STRIP = $(shell xcrun -find strip)
@@ -83,8 +86,12 @@
 	    -compatibility_version $(LIBUNWIND_COMPAT_VERSION) -current_version $(LIBUNWIND_CURRENT_VERSION) \
 	    $(OBJS)
 
-all: $(OBJROOT)/$(LIBUNWIND_FILENAME)
+$(OBJROOT)/$(LIBUNWIND_FILENAME_STATIC): $(OBJS)
+	$(AR) cru $@ $(OBJS)
+	$(RANLIB) $@
 
+all: $(OBJROOT)/$(LIBUNWIND_FILENAME) $(OBJROOT)/$(LIBUNWIND_FILENAME_STATIC)
+
 installhdrs:
 	install -d -m 755 $(DSTROOT)$(INCDIR)
 	install -d -m 755 $(DSTROOT)$(LIBUNWIND_INCDIR)
@@ -102,7 +109,7 @@
 	  install -m 644 $$f $(DSTROOT)$(MACHO_INCDIR); \
 	done
 
-install: installhdrs $(OBJROOT)/$(LIBUNWIND_FILENAME)
+installdylib: $(OBJROOT)/$(LIBUNWIND_FILENAME)
 ifdef SYMROOT
 	install -m 755 $(OBJROOT)/$(LIBUNWIND_FILENAME) $(SYMROOT)
 	$(DSYMUTIL) --out $(SYMROOT)/$(LIBUNWIND_FILENAME).dSYM $(OBJROOT)/$(LIBUNWIND_FILENAME)
@@ -112,4 +119,11 @@
 ifneq "NO" "$(STRIP_ON_INSTALL)"
 	$(STRIP) $(STRIP_LIB_FLAGS) $(DSTROOT)$(LIBDIR)/$(LIBUNWIND_FILENAME)
 endif
+	ln -s $(LIBUNWIND_FILENAME) $(DSTROOT)$(LIBDIR)/$(LIBUNWIND_SYMLINKNAME)
 
+installstatic: $(OBJROOT)/$(LIBUNWIND_FILENAME_STATIC)
+	install -d -m 755 $(DSTROOT)$(LIBDIR)
+	install -m 644 $(OBJROOT)/$(LIBUNWIND_FILENAME_STATIC) $(DSTROOT)$(LIBDIR)
+
+installlibs: installdylib installstatic
+install: installhdrs installlibs

Modified: trunk/dports/devel/libunwind/files/libunwind-available.patch
===================================================================
--- trunk/dports/devel/libunwind/files/libunwind-available.patch	2015-01-04 00:16:36 UTC (rev 130894)
+++ trunk/dports/devel/libunwind/files/libunwind-available.patch	2015-01-04 00:17:20 UTC (rev 130895)
@@ -1,20 +1,13 @@
---- include/libunwind.h.orig	2014-06-25 16:39:00.000000000 -0700
-+++ include/libunwind.h	2015-01-03 00:11:33.000000000 -0800
-@@ -25,16 +25,7 @@
+diff --git a/include/libunwind.h b/include/libunwind.h
+index 448d86a..971953b 100644
+--- include/libunwind.h
++++ include/libunwind.h
+@@ -25,7 +25,7 @@
  #define LIBCXXABI_ARM_EHABI 0
  #endif
  
 -#if __APPLE__
--  #include <Availability.h>
--    #if __arm__
--       #define LIBUNWIND_AVAIL __attribute__((unavailable))
--    #else
--      #define LIBUNWIND_AVAIL __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_5_0)
--    #endif
--#else
--  #define LIBUNWIND_AVAIL
--#endif
-+#define LIBUNWIND_AVAIL
- 
- /* error codes */
- enum {
++#if defined(__APPLE__) && !defined(USE_MACPORTS_LIBUNWIND)
+   #include <Availability.h>
+     #if __arm__
+        #define LIBUNWIND_AVAIL __attribute__((unavailable))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150103/f3222555/attachment.html>


More information about the macports-changes mailing list