[asterisk-commits] dlee: branch 11 r379475 - in /branches/11: ./ include/asterisk/ main/

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


Author: dlee
Date: Fri Jan 18 15:10:23 2013
New Revision: 379475

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379475
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/

Modified:
    branches/11/Makefile
    branches/11/UPGRADE.txt
    branches/11/configure
    branches/11/configure.ac
    branches/11/include/asterisk/autoconfig.h.in
    branches/11/main/Makefile
    branches/11/makeopts.in

Modified: branches/11/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/11/Makefile?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/Makefile (original)
+++ branches/11/Makefile Fri Jan 18 15:10:23 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: branches/11/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/branches/11/UPGRADE.txt?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/UPGRADE.txt (original)
+++ branches/11/UPGRADE.txt Fri Jan 18 15:10:23 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 11.1 to 11.2:
 

Modified: branches/11/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/11/configure.ac?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/configure.ac (original)
+++ branches/11/configure.ac Fri Jan 18 15:10:23 2013
@@ -1052,6 +1052,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: branches/11/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/11/include/asterisk/autoconfig.h.in?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/include/asterisk/autoconfig.h.in (original)
+++ branches/11/include/asterisk/autoconfig.h.in Fri Jan 18 15:10:23 2013
@@ -848,19 +848,19 @@
 /* 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 `uid' is member of `struct sockpeercred'. */
+/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
 #undef HAVE_STRUCT_SOCKPEERCRED_UID
 
-/* 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. */
@@ -1137,6 +1137,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
@@ -1220,6 +1223,11 @@
 /* Define to 1 if running on Darwin. */
 #undef _DARWIN_UNLIMITED_SELECT
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 

Modified: branches/11/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/Makefile?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/main/Makefile (original)
+++ branches/11/main/Makefile Fri Jan 18 15:10:23 2013
@@ -225,6 +225,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: branches/11/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/branches/11/makeopts.in?view=diff&rev=379475&r1=379474&r2=379475
==============================================================================
--- branches/11/makeopts.in (original)
+++ branches/11/makeopts.in Fri Jan 18 15:10:23 2013
@@ -107,6 +107,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