]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* config/ltmain.in [darwin]: Use the -dylib_file flag and avoid
authorPeter O'Gorman <peter@pogma.com>
Thu, 26 Aug 2004 13:13:03 +0000 (13:13 +0000)
committerPeter O'Gorman <peter@pogma.com>
Thu, 26 Aug 2004 13:13:03 +0000 (13:13 +0000)
linking to so many libraries on darwin.

ChangeLog
config/ltmain.in

index 545dce7f85c338c8fda8aa70a44b26e87d0b478d..78221684b5c1bc879bfcf6c659d108b4e9d34553 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-08-26  Peter O'Gorman  <peter@pogma.com>
 
+       * 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.
 
index c38f84459270855e5f409d8af301a847afb699b9..5558535b79464576ed88dbe628401fd3af87c47b 100644 (file)
@@ -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 "*) ;;