diff options
author | theuni <theuni-nospam-@xbmc.org> | 2011-09-02 22:51:00 -0400 |
---|---|---|
committer | theuni <theuni-nospam-@xbmc.org> | 2011-09-08 02:25:33 -0400 |
commit | 9592c126ef6c6eccb379b5b48fefd858835bbe9d (patch) | |
tree | a3791bac64b52a8384ae00fc408ee02c0da8d51f /configure.in | |
parent | c1f45d8db6c865f90a9faf7e84fe09b8dbc15106 (diff) |
build: fixed our soname version function to find libs outside of /usr/lib
previously, we were only able to determine the sonames of libs in gcc's
default search paths. Instead, we should be using linker paths since it's
next to impossible to change where gcc looks. Use ld's paths instead for
consistency.
There are two primary reasons for this change:
1. Allow the use of libs in /usr/local, or anywhere else libs may be configured
2. Simplify cross builds where libs may be coming from a staging dir.
In the 2nd case, adding a path to LDFLAGS means that we'll be able to find the
SONAME.
This works by running $(LD) itself on the lib, so (when run on the same
machine) it searches the same paths as our dyloader.
Diffstat (limited to 'configure.in')
-rwxr-xr-x | configure.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/configure.in b/configure.in index be278a9e6d..49339199e5 100755 --- a/configure.in +++ b/configure.in @@ -20,10 +20,10 @@ AC_DEFUN([XB_FIND_SONAME], [ if [[ "$host_vendor" != "apple" ]]; then AC_MSG_CHECKING([for lib$2 soname]) - $1_SONAME=$( $CC -print-file-name=lib$2.so | \ - while read output; do objdump -p $output | \ - grep "SONAME" | \ - sed -e 's/ *SONAME *//'; done 2> /dev/null ) + $1_FILENAME=$($LD $LDFLAGS -l$2 -M -o /dev/null 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}') + if [[ ! -z $$1_FILENAME ]]; then + $1_SONAME=$(objdump -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}') + fi else AC_MSG_CHECKING([for lib$2 dylib]) gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] |