[asterisk-commits] dlee: trunk r379477 - in /trunk: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 18 15:35:13 CST 2013


Author: dlee
Date: Fri Jan 18 15:35:09 2013
New Revision: 379477

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379477
Log:
Specify the -rpath linker flag when prefix != /usr.

This allows Asterisk to start without having to specify the
LD_LIBRARY_PATH. This can be disabled by passing --disable-rpath to
configure.

(closes issue ASTERISK-20407)
Reported by: David M. Lee
Review: https://reviewboard.asterisk.org/r/2132/
........

Merged revisions 379475 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/Makefile
    trunk/UPGRADE-11.txt
    trunk/UPGRADE.txt
    trunk/configure
    trunk/configure.ac
    trunk/main/Makefile
    trunk/makeopts.in

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/Makefile?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Fri Jan 18 15:35:09 2013
@@ -252,7 +252,7 @@
 
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
-  _SOLINK=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
+  _SOLINK=-Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup
   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
@@ -267,6 +267,9 @@
     _ASTLDFLAGS+=-L/usr/local/lib
   endif
 endif
+
+# Include rpath settings
+_ASTLDFLAGS+=$(AST_RPATH)
 
 ifeq ($(OSARCH),SunOS)
   SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt

Modified: trunk/UPGRADE-11.txt
URL: http://svnview.digium.com/svn/asterisk/trunk/UPGRADE-11.txt?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/UPGRADE-11.txt (original)
+++ trunk/UPGRADE-11.txt Fri Jan 18 15:35:09 2013
@@ -19,6 +19,14 @@
 === UPGRADE-10.txt -- Upgrade info for 1.8 to 10
 ===
 ===========================================================
+
+From 11.2 to 11.3:
+
+* Now by default, when Asterisk is installed in a path other than /usr, the
+  Asterisk binary will search for shared libraries in ${libdir} in addition to
+  searching system libraries. This allows Asterisk to find its shared
+  libraries without having to specify LD_LIBRARY_PATH. This can be disabled by
+  passing --disable-rpath to configure.
 
 From 10 to 11:
 

Modified: trunk/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/trunk/UPGRADE.txt?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/UPGRADE.txt (original)
+++ trunk/UPGRADE.txt Fri Jan 18 15:35:09 2013
@@ -21,7 +21,6 @@
 ===
 ===========================================================
 
-From 11 to 12:
 
 AMI:
  - The SIP SIPqualifypeer action now sends a response indicating it will qualify

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Fri Jan 18 15:35:09 2013
@@ -1054,6 +1054,38 @@
 )
 AC_SUBST(AST_NESTED_FUNCTIONS)
 
+dnl Check to see if rpath should be set in LDFLAGS
+AC_ARG_ENABLE(rpath,
+	[AC_HELP_STRING([--disable-rpath],
+			[Disables rpath linker option checking])],
+	[case "${enableval}" in
+		y|ye|yes) check_rpath=yes ;;
+		n|no) check_rpath=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-rpath) ;;
+	esac], [check_rpath=yes])
+
+AC_MSG_CHECKING(whether to use rpath)
+AST_RPATH=
+if test "${check_rpath}" != yes; then
+	AC_MSG_RESULT(skipped)
+elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
+	AC_MSG_RESULT(not needed)
+else
+	case "${host_os}" in
+		darwin*)
+			AC_MSG_RESULT(not supported)
+			# We set macosx_version_min to 10.4, which doesn't
+			# support rpath. However, we set install_name on our
+			# dylibs, so it's not strictly necessary.
+			;;
+		*)
+			AC_MSG_RESULT(required)
+			AST_RPATH="-Wl,-rpath,${libdir}"
+			;;
+	esac
+fi
+AC_SUBST(AST_RPATH)
+
 AC_MSG_CHECKING(for sysinfo)
 AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([#include <sys/sysinfo.h>],

Modified: trunk/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/main/Makefile?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/main/Makefile (original)
+++ trunk/main/Makefile Fri Jan 18 15:35:09 2013
@@ -226,6 +226,9 @@
 else # Darwin
 ASTSSL_LIB:=libasteriskssl.dylib
 
+# -install_name allows library to be found if installed somewhere other than
+# /lib or /usr/lib
+$(ASTSSL_LIB): _ASTLDFLAGS+=-dynamiclib -install_name $(ASTLIBDIR)/$(ASTSSL_LIB)
 $(ASTSSL_LIB): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskssl\"
 $(ASTSSL_LIB): LIBS+=$(ASTSSL_LIBS)
 $(ASTSSL_LIB): SOLINK=$(DYLINK)

Modified: trunk/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/trunk/makeopts.in?view=diff&rev=379477&r1=379476&r2=379477
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Fri Jan 18 15:35:09 2013
@@ -108,6 +108,7 @@
 AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
 AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
 AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
+AST_RPATH=@AST_RPATH@
 AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
 AST_MARCH_NATIVE=@AST_MARCH_NATIVE@
 




More information about the asterisk-commits mailing list