From 4fd9997226e4a1857957e3f401d0a19a8cf8cbcb Mon Sep 17 00:00:00 2001 From: davilla Date: Thu, 9 Dec 2010 23:15:37 +0000 Subject: [PATCH] merge r35608, [osx] fixed, figure out correct dylib names to match what linker uses git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@35610 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 --- configure.in | 36 +++++++++++++++++++++++++++--------- xbmc/DllPaths_generated.h.in | 12 ++++-------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index cbfa2d261414f..f20cd618427bc 100644 --- a/configure.in +++ b/configure.in @@ -17,11 +17,29 @@ tolower(){ # check for library basenames AC_DEFUN([XB_FIND_SONAME], [ - 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 ) + 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 ) + 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'`] + env_lib_path=[`echo $LDFLAGS | sed 's/-L[ ]*//g'`] + if test "$cross_compiling" = yes; then + host_lib_path="" + else + host_lib_path="/usr/lib /usr/local/lib" + fi + for path in $gcc_lib_path $env_lib_path $host_lib_path; do + lib=[`ls -- $path/lib$2.dylib 2>/dev/null`] + if test x$lib != x; then + # we want the path/name that is embedded in the dylib + $1_SONAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`] + fi + done + fi if [[ -z "$$1_SONAME" ]]; then AC_MSG_RESULT([no]) if test -z "$3" || test "x${$3}" = "xyes"; then @@ -673,14 +691,14 @@ fi if test "$host_vendor" != "apple"; then XB_FIND_SONAME([CURL], [curl]) XB_FIND_SONAME([FLAC], [FLAC]) - XB_FIND_SONAME([VORBISFILE], [vorbisfile]) XB_FIND_SONAME([MODPLUG], [modplug]) XB_FIND_SONAME([FAAD], [faad]) XB_FIND_SONAME([MAD], [mad]) - XB_FIND_SONAME([OGG], [ogg]) - XB_FIND_SONAME([VORBISENC], [vorbisenc]) - XB_FIND_SONAME([VORBIS], [vorbis]) fi +XB_FIND_SONAME([OGG], [ogg]) +XB_FIND_SONAME([VORBIS], [vorbis]) +XB_FIND_SONAME([VORBISENC], [vorbisenc]) +XB_FIND_SONAME([VORBISFILE], [vorbisfile]) # WebServer if test "$host_vendor" != "apple" ; then diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in index 2f4c49bd1c620..271e20d8b6746 100644 --- a/xbmc/DllPaths_generated.h.in +++ b/xbmc/DllPaths_generated.h.in @@ -67,13 +67,12 @@ #define DLL_PATH_SHN_CODEC "special://xbmcbin/system/players/paplayer/libshnplay-@ARCH@.so" #if defined(_LINUX) && !defined(__APPLE__) #define DLL_PATH_FLAC_CODEC "@FLAC_SONAME@" -#define DLL_PATH_OGG_CODEC "@VORBISFILE_SONAME@" #define DLL_PATH_MODPLUG_CODEC "@MODPLUG_SONAME@" #else #define DLL_PATH_FLAC_CODEC "special://xbmcbin/system/players/paplayer/libFLAC-@ARCH@.so" -#define DLL_PATH_OGG_CODEC "libvorbisfile.3.3.2.dylib" #define DLL_PATH_MODPLUG_CODEC "special://xbmcbin/system/players/paplayer/libmodplug-@ARCH@.so" #endif +#define DLL_PATH_OGG_CODEC "@VORBISFILE_SONAME@" /* dvdplayer */ #define DLL_PATH_LIBASS "special://xbmcbin/system/players/dvdplayer/libass-@ARCH@.so" @@ -99,15 +98,12 @@ /* cdrip */ #if defined(_LINUX) && !defined(__APPLE__) #define DLL_PATH_LAME_ENC "libmp3lame.so.0" -#define DLL_PATH_OGG "@OGG_SONAME@" -#define DLL_PATH_VORBIS_ENC "@VORBISENC_SONAME@" -#define DLL_PATH_VORBIS "@VORBIS_SONAME@" #else #define DLL_PATH_LAME_ENC "special://xbmcbin/system/cdrip/lame_enc-@ARCH@.so" -#define DLL_PATH_OGG "libogg.0.6.0.dylib" -#define DLL_PATH_VORBIS_ENC "libvorbisenc.2.0.6.dylib" -#define DLL_PATH_VORBIS "libvorbis.0.4.3.dylib" #endif +#define DLL_PATH_OGG "@OGG_SONAME@" +#define DLL_PATH_VORBIS_ENC "@VORBISENC_SONAME@" +#define DLL_PATH_VORBIS "@VORBIS_SONAME@" /* broadcom crystalhd */ #if defined(_LINUX) && !defined(__APPLE__)