mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@379475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
32
configure.ac
32
configure.ac
@@ -1052,6 +1052,38 @@ AC_COMPILE_IFELSE(
|
||||
)
|
||||
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>],
|
||||
|
||||
Reference in New Issue
Block a user