[asterisk-commits] tilghman: branch 10 r336734 - in /branches/10: ./ codecs/gsm/ include/asteris...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 19 15:29:42 CDT 2011


Author: tilghman
Date: Mon Sep 19 15:29:40 2011
New Revision: 336734

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=336734
Log:
Merged revisions 336733 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r336733 | tilghman | 2011-09-19 15:27:03 -0500 (Mon, 19 Sep 2011) | 11 lines
  
  Various changes to allow 1.8 to compile on Mac OS X Lion (10.7)
  
  * Makefile workaround for 10.6 extended to work on 10.7 and later.
  * Now uses the 'weak' symbol for Lion systems, which no longer support
    'weak_import'
  
  Closes ASTERISK-17612.
  Closes ASTERISK-18213.
  
  Tested by: tilghman, oej.
........

Modified:
    branches/10/   (props changed)
    branches/10/Makefile
    branches/10/Makefile.rules
    branches/10/codecs/gsm/Makefile
    branches/10/configure
    branches/10/configure.ac
    branches/10/include/asterisk/autoconfig.h.in
    branches/10/include/asterisk/optional_api.h
    branches/10/main/Makefile

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/10/Makefile?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/Makefile (original)
+++ branches/10/Makefile Mon Sep 19 15:29:40 2011
@@ -286,7 +286,7 @@
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
   SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
-  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
+  ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
     SOLINK+=/usr/lib/bundle1.o
   endif
   _ASTLDFLAGS+=-L/usr/local/lib

Modified: branches/10/Makefile.rules
URL: http://svnview.digium.com/svn/asterisk/branches/10/Makefile.rules?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/Makefile.rules (original)
+++ branches/10/Makefile.rules Mon Sep 19 15:29:40 2011
@@ -37,8 +37,8 @@
 
 OPTIMIZE?=-O6
 ifneq ($(findstring darwin,$(OSARCH)),)
-  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
-    # Snow Leopard has an issue with this optimization flag on large files (like chan_sip)
+  ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
+    # Snow Leopard/Lion has an issue with this optimization flag on large files (like chan_sip)
     OPTIMIZE+=-fno-inline-functions
   endif
 endif

Modified: branches/10/codecs/gsm/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/10/codecs/gsm/Makefile?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/codecs/gsm/Makefile (original)
+++ branches/10/codecs/gsm/Makefile Mon Sep 19 15:29:40 2011
@@ -57,8 +57,8 @@
     endif
   else
     ifneq (,$(findstring $(OSARCH),Darwin))
-      ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
-        # Snow Leopard reports i386, even though it's really x86_64
+      ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
+        # Snow Leopard/Lion reports i386, even though it's really x86_64
         OPTIMIZE+=-mtune=native
       endif
     endif

Modified: branches/10/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/10/configure.ac?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/configure.ac (original)
+++ branches/10/configure.ac Mon Sep 19 15:29:40 2011
@@ -876,6 +876,7 @@
 AST_GCC_ATTRIBUTE(sentinel)
 AST_GCC_ATTRIBUTE(warn_unused_result)
 AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
+AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
 AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
 
 AC_MSG_CHECKING(for -ffunction-sections support)

Modified: branches/10/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/10/include/asterisk/autoconfig.h.in?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/include/asterisk/autoconfig.h.in (original)
+++ branches/10/include/asterisk/autoconfig.h.in Mon Sep 19 15:29:40 2011
@@ -101,6 +101,9 @@
    attribute. */
 #undef HAVE_ATTRIBUTE_warn_unused_result
 
+/* Define to 1 if your GCC C compiler supports the 'weak' attribute. */
+#undef HAVE_ATTRIBUTE_weak
+
 /* Define to 1 if your GCC C compiler supports the 'weak_import' attribute. */
 #undef HAVE_ATTRIBUTE_weak_import
 
@@ -769,16 +772,16 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
 #undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
 
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
-/* Define to 1 if `cr_uid' is member of `struct ucred'. */
+/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_CR_UID
 
-/* Define to 1 if `uid' is member of `struct ucred'. */
+/* Define to 1 if `uid' is a member of `struct ucred'. */
 #undef HAVE_STRUCT_UCRED_UID
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1055,6 +1058,9 @@
 
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
 
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION

Modified: branches/10/include/asterisk/optional_api.h
URL: http://svnview.digium.com/svn/asterisk/branches/10/include/asterisk/optional_api.h?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/include/asterisk/optional_api.h (original)
+++ branches/10/include/asterisk/optional_api.h Mon Sep 19 15:29:40 2011
@@ -103,11 +103,11 @@
 #define AST_OPTIONAL_API_UNAVAILABLE	INT_MIN
 
 
-#if defined(HAVE_ATTRIBUTE_weak_import)
+#if defined(HAVE_ATTRIBUTE_weak_import) || defined(HAVE_ATTRIBUTE_weak)
 
 /*
- * This is the Darwin (Mac OS/X) implementation, that only provides the
- * 'weak_import' compiler attribute for weak symbols. On this platform,
+ * This is the Darwin (Mac OS/X) implementation, that only provides the 'weak'
+ * or 'weak_import' compiler attribute for weak symbols. On this platform,
  *
  * - The module providing the API will only provide a '__' prefixed version
  *   of the API function to other modules (this will be hidden from the other
@@ -117,12 +117,18 @@
  * - In the API module itself, access to the API function without using a
  *   prefixed name is provided by a static pointer variable that holds the
  *   function address.
- * - 'Consumer' modules of the API will use a combination of a weak_import
- *   symbol, a local stub function, a pointer variable and a constructor function
- *   (which initializes that pointer variable as the module is being loaded)
- *   to provide safe, optional access to the API function without any special
- *   code being required.
- */
+ * - 'Consumer' modules of the API will use a combination of a weak_import or
+ *   weak symbol, a local stub function, a pointer variable and a constructor
+ *   function (which initializes that pointer variable as the module is being
+ *   loaded) to provide safe, optional access to the API function without any
+ *   special code being required.
+ */
+
+#if defined(HAVE_ATTRIBUTE_weak_import)
+#define	__default_attribute	weak_import /* pre-Lion */
+#else
+#define	__default_attribute	weak        /* Lion-onwards */
+#endif
 
 #define AST_OPTIONAL_API_NAME(name) __##name
 
@@ -140,16 +146,15 @@
 
 #define AST_OPTIONAL_API(result, name, proto, stub) \
 	static result __stub__##name proto stub; \
-	__attribute__((weak_import)) typeof(__stub__##name) AST_OPTIONAL_API_NAME(name); \
+	__attribute__((__default_attribute)) typeof(__stub__##name) AST_OPTIONAL_API_NAME(name); \
 	static attribute_unused typeof(__stub__##name) * name; \
 	static void __attribute__((constructor)) __init__##name(void) { name = AST_OPTIONAL_API_NAME(name) ? : __stub__##name; }
 
 #define AST_OPTIONAL_API_ATTR(result, attr, name, proto, stub) \
 	static __attribute__((attr)) result __stub__##name proto stub; \
-	__attribute__((attr, weak_import)) typeof(__stub__##name) AST_OPTIONAL_API_NAME(name); \
+	__attribute__((attr, __default_attribute)) typeof(__stub__##name) AST_OPTIONAL_API_NAME(name); \
 	static attribute_unused __attribute__((attr)) typeof(__stub__##name) * name; \
 	static void __attribute__((constructor)) __init__##name(void) { name = AST_OPTIONAL_API_NAME(name) ? : __stub__##name; }
-
 
 #endif
 

Modified: branches/10/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/Makefile?view=diff&rev=336734&r1=336733&r2=336734
==============================================================================
--- branches/10/main/Makefile (original)
+++ branches/10/main/Makefile Mon Sep 19 15:29:40 2011
@@ -54,7 +54,7 @@
 ifneq ($(findstring darwin,$(OSARCH)),)
   AST_LIBS+=-lresolv
   ASTLINK=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
-  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
+  ifeq ($(shell if test `/usr/bin/sw_vers -productVersion | cut -c4` -gt 5; then echo 6; else echo 0; fi),6)
     ASTLINK+=/usr/lib/bundle1.o
   endif
 else




More information about the asterisk-commits mailing list