Review Board 1.7.16


Make weak reference support linux and MacOSX only.

Review Request #1617 - Created Dec. 9, 2011 and submitted

rmudgett
1.8
ASTERISK-18728, ASTERISK-18950
Reviewers
asterisk-dev
kpfleming, oej, tilghman
Asterisk
Weak references is not portable and either does not work or does not work as expected on other platforms.

Primarily support weak references on linux platforms because the feature just works.

Allow weak symbol support on MacOS/X platforms only because there is active community support for it.  However, MacOS/X seems to break weak symbols for each new version.
My linux box now configures for HAVE_ATTRIBUTE_weakref instead of HAVE_ATTRIBUTE_weak which is Darwin specific. 

Diff revision 2

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

1 2 3
1 2 3

  1. /branches/1.8/configure.ac: Loading...
  2. /branches/1.8/configure: Loading...
/branches/1.8/configure.ac
Revision 347865 New Change
[20] 883 lines
[+20]
884
AST_GCC_ATTRIBUTE(unused)
884
AST_GCC_ATTRIBUTE(unused)
885
AST_GCC_ATTRIBUTE(always_inline)
885
AST_GCC_ATTRIBUTE(always_inline)
886
AST_GCC_ATTRIBUTE(deprecated)
886
AST_GCC_ATTRIBUTE(deprecated)
887
AST_GCC_ATTRIBUTE(sentinel)
887
AST_GCC_ATTRIBUTE(sentinel)
888
AST_GCC_ATTRIBUTE(warn_unused_result)
888
AST_GCC_ATTRIBUTE(warn_unused_result)

    
   
889

   

    
   
890
# Support weak symbols on a platform specific basis.  The feature is not

    
   
891
# portable and either does not work or does not work as expected on other

    
   
892
# platforms.

    
   
893
#

    
   
894
# Primarily support weak symbols on Linux platforms because the feature

    
   
895
# just works.

    
   
896
#

    
   
897
# Allow weak symbol support on Mac OS/X (Darwin) platforms only because

    
   
898
# there is active community support for it.

    
   
899
# However, Darwin seems to break weak symbols for each new version.

    
   
900
#

    
   
901
case "${OSARCH}" in

    
   
902
	darwin*)
889
AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
903
	AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)

    
   
904

   

    
   
905
	# Several other platforms including Linux have GCC versions that

    
   
906
	# define the weak attribute.  However, this attribute is only

    
   
907
	# setup for use in the code by Darwin.
890
AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
908
	AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)

    
   
909
	;;

    
   
910
	linux-gnu)
891
AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
911
	AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)

    
   
912
	;;

    
   
913
esac
892

    
   
914

   
893
AC_MSG_CHECKING(for -ffunction-sections support)
915
AC_MSG_CHECKING(for -ffunction-sections support)
894
saved_CFLAGS="${CFLAGS}"
916
saved_CFLAGS="${CFLAGS}"
895
CFLAGS="${CFLAGS} -ffunction-sections"
917
CFLAGS="${CFLAGS} -ffunction-sections"
896
AC_COMPILE_IFELSE(
918
AC_COMPILE_IFELSE(
[+20] [20] 1373 lines
/branches/1.8/configure
Revision UNKNOWN New Change
 
  1. /branches/1.8/configure.ac: Loading...
  2. /branches/1.8/configure: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.