From: Peter O'Gorman Date: Thu, 26 Aug 2004 13:13:03 +0000 (+0000) Subject: * config/ltmain.in [darwin]: Use the -dylib_file flag and avoid X-Git-Tag: release-1-9b~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aed01108fd9658ff0e6a640462861e36f963921e;p=thirdparty%2Flibtool.git * config/ltmain.in [darwin]: Use the -dylib_file flag and avoid linking to so many libraries on darwin. --- diff --git a/ChangeLog b/ChangeLog index 545dce7f8..78221684b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-08-26 Peter O'Gorman + * config/ltmain.in [darwin]: Use the -dylib_file flag and avoid + linking to so many libraries on darwin. + * m4/libtool.m4 [darwin]: Don't use a libname triplet, a couplet is perfectly fine. diff --git a/config/ltmain.in b/config/ltmain.in index c38f84459..5558535b7 100644 --- a/config/ltmain.in +++ b/config/ltmain.in @@ -3100,67 +3100,39 @@ EOF ;; esac if $GREP "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= case $host in *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared + depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + eval darwin_install_name=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//' | xargs` + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" + path= fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac fi - path="" ;; *) - path="-L$path" - ;; - esac - ;; - - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" + path="-L$absdir/$objdir" ;; - *) continue ;; esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="-L$absdir" + fi ;; - - *) continue ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in *" $path "*) ;;