From 7bd50bc0c4e27adbbc619a74bd22fb6bf7333321 Mon Sep 17 00:00:00 2001 From: "David M. Lee" Date: Fri, 18 Jan 2013 21:35:09 +0000 Subject: 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 --- configure | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index edbf19ca1..5abec2de7 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 377981 . +# From configure.ac Revision: 378915 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for asterisk trunk. # @@ -684,6 +684,7 @@ PBX_DLADDR PBX_IP_MTU_DISCOVER PBX_GLOB_BRACE PBX_GLOB_NOMAGIC +AST_RPATH AST_NESTED_FUNCTIONS AST_NATIVE_ARCH AST_SHADOW_WARNINGS @@ -1302,6 +1303,7 @@ enable_xmldoc enable_largefile enable_internal_poll enable_asteriskssl +enable_rpath ' ac_precious_vars='build_alias host_alias @@ -1946,6 +1948,7 @@ Optional Features: --disable-largefile omit support for large files --enable-internal-poll Use Asterisk's poll implementation --disable-asteriskssl Disable Asterisk's SSL wrapper library + --disable-rpath Disables rpath linker option checking Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -16394,6 +16397,45 @@ fi 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_n "checking for sysinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext -- cgit v1.2.3