mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
5
Makefile
5
Makefile
@@ -252,7 +252,7 @@ MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
|
|||||||
|
|
||||||
ifneq ($(findstring darwin,$(OSARCH)),)
|
ifneq ($(findstring darwin,$(OSARCH)),)
|
||||||
_ASTCFLAGS+=-D__Darwin__
|
_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)
|
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
|
_SOLINK+=/usr/lib/bundle1.o
|
||||||
endif
|
endif
|
||||||
@@ -268,6 +268,9 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Include rpath settings
|
||||||
|
_ASTLDFLAGS+=$(AST_RPATH)
|
||||||
|
|
||||||
ifeq ($(OSARCH),SunOS)
|
ifeq ($(OSARCH),SunOS)
|
||||||
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
|
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
|
||||||
DYLINK=$(SOLINK)
|
DYLINK=$(SOLINK)
|
||||||
|
@@ -20,6 +20,14 @@
|
|||||||
===
|
===
|
||||||
===========================================================
|
===========================================================
|
||||||
|
|
||||||
|
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:
|
From 10 to 11:
|
||||||
|
|
||||||
Voicemail:
|
Voicemail:
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
===
|
===
|
||||||
===========================================================
|
===========================================================
|
||||||
|
|
||||||
From 11 to 12:
|
|
||||||
|
|
||||||
AMI:
|
AMI:
|
||||||
- The SIP SIPqualifypeer action now sends a response indicating it will qualify
|
- The SIP SIPqualifypeer action now sends a response indicating it will qualify
|
||||||
|
44
configure
vendored
44
configure
vendored
@@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.ac Revision: 377981 .
|
# From configure.ac Revision: 378915 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for asterisk trunk.
|
# Generated by GNU Autoconf 2.69 for asterisk trunk.
|
||||||
#
|
#
|
||||||
@@ -684,6 +684,7 @@ PBX_DLADDR
|
|||||||
PBX_IP_MTU_DISCOVER
|
PBX_IP_MTU_DISCOVER
|
||||||
PBX_GLOB_BRACE
|
PBX_GLOB_BRACE
|
||||||
PBX_GLOB_NOMAGIC
|
PBX_GLOB_NOMAGIC
|
||||||
|
AST_RPATH
|
||||||
AST_NESTED_FUNCTIONS
|
AST_NESTED_FUNCTIONS
|
||||||
AST_NATIVE_ARCH
|
AST_NATIVE_ARCH
|
||||||
AST_SHADOW_WARNINGS
|
AST_SHADOW_WARNINGS
|
||||||
@@ -1302,6 +1303,7 @@ enable_xmldoc
|
|||||||
enable_largefile
|
enable_largefile
|
||||||
enable_internal_poll
|
enable_internal_poll
|
||||||
enable_asteriskssl
|
enable_asteriskssl
|
||||||
|
enable_rpath
|
||||||
'
|
'
|
||||||
ac_precious_vars='build_alias
|
ac_precious_vars='build_alias
|
||||||
host_alias
|
host_alias
|
||||||
@@ -1946,6 +1948,7 @@ Optional Features:
|
|||||||
--disable-largefile omit support for large files
|
--disable-largefile omit support for large files
|
||||||
--enable-internal-poll Use Asterisk's poll implementation
|
--enable-internal-poll Use Asterisk's poll implementation
|
||||||
--disable-asteriskssl Disable Asterisk's SSL wrapper library
|
--disable-asteriskssl Disable Asterisk's SSL wrapper library
|
||||||
|
--disable-rpath Disables rpath linker option checking
|
||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||||
@@ -16394,6 +16397,45 @@ fi
|
|||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-rpath was given.
|
||||||
|
if test "${enable_rpath+set}" = set; then :
|
||||||
|
enableval=$enable_rpath; case "${enableval}" in
|
||||||
|
y|ye|yes) check_rpath=yes ;;
|
||||||
|
n|no) check_rpath=no ;;
|
||||||
|
*) as_fn_error $? "bad value ${enableval} for --disable-rpath" "$LINENO" 5 ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
check_rpath=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use rpath" >&5
|
||||||
|
$as_echo_n "checking whether to use rpath... " >&6; }
|
||||||
|
AST_RPATH=
|
||||||
|
if test "${check_rpath}" != yes; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped" >&5
|
||||||
|
$as_echo "skipped" >&6; }
|
||||||
|
elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5
|
||||||
|
$as_echo "not needed" >&6; }
|
||||||
|
else
|
||||||
|
case "${host_os}" in
|
||||||
|
darwin*)
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not supported" >&5
|
||||||
|
$as_echo "not supported" >&6; }
|
||||||
|
# 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.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: required" >&5
|
||||||
|
$as_echo "required" >&6; }
|
||||||
|
AST_RPATH="-Wl,-rpath,${libdir}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5
|
||||||
$as_echo_n "checking for sysinfo... " >&6; }
|
$as_echo_n "checking for sysinfo... " >&6; }
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
32
configure.ac
32
configure.ac
@@ -1054,6 +1054,38 @@ AC_COMPILE_IFELSE(
|
|||||||
)
|
)
|
||||||
AC_SUBST(AST_NESTED_FUNCTIONS)
|
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_MSG_CHECKING(for sysinfo)
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
|
[AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
|
||||||
|
@@ -226,6 +226,9 @@ $(ASTSSL_LIB): $(ASTSSL_LIB).$(ASTSSL_SO_VERSION)
|
|||||||
else # Darwin
|
else # Darwin
|
||||||
ASTSSL_LIB:=libasteriskssl.dylib
|
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): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskssl\"
|
||||||
$(ASTSSL_LIB): LIBS+=$(ASTSSL_LIBS)
|
$(ASTSSL_LIB): LIBS+=$(ASTSSL_LIBS)
|
||||||
$(ASTSSL_LIB): SOLINK=$(DYLINK)
|
$(ASTSSL_LIB): SOLINK=$(DYLINK)
|
||||||
|
@@ -108,6 +108,7 @@ AST_TRAMPOLINES=@AST_TRAMPOLINES@
|
|||||||
AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
|
AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
|
||||||
AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
|
AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
|
||||||
AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
|
AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
|
||||||
|
AST_RPATH=@AST_RPATH@
|
||||||
AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
|
AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
|
||||||
AST_MARCH_NATIVE=@AST_MARCH_NATIVE@
|
AST_MARCH_NATIVE=@AST_MARCH_NATIVE@
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user