]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (dyld): Remove some debug printf's, fix a bug.
authorPeter O'Gorman <peter@pogma.com>
Sat, 29 Mar 2003 04:09:00 +0000 (04:09 +0000)
committerRobert Boehne <rboehne@gnu.org>
Sat, 29 Mar 2003 04:09:00 +0000 (04:09 +0000)
* ltmain.in (darwin): Only link against shared libraries when doing
link_all_deplibs.

ChangeLog
libltdl/ltdl.c
ltmain.in

index f4d7a68540cbacf7db9be5de0838a5d90977ff74..346f995c5825e15db79c7adc9228c51b829230be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-03-28  Peter O'Gorman  <peter@pogma.com>
+
+       * libltdl/ltdl.c (dyld): Remove some debug printf's, fix a bug.
+       * ltmain.in (darwin): Only link against shared libraries when doing
+       link_all_deplibs.
+
 2003-03-25  Robert Boehne  <rboehne@gnu.org>
 
        * bootstrap: Add f77demo to the directories that AUTOHEADER
index 6680ddf2281d00354ff3d05f77bf1e63fe80fa5b..e3ce820c14219def554edb28e92e6043fb365c6a 100644 (file)
@@ -1583,10 +1583,6 @@ static struct lt_user_dlloader sys_dld = {
 # include <mach-o/dyld.h>
 #endif
 #include <mach-o/getsect.h>
-/*
-  sectname __mod_term_func
-   segname __DATA
-*/   
 
 /* We have to put some stuff here that isn't in older dyld.h files */
 #ifndef ENUM_DYLD_BOOL
@@ -1729,7 +1725,6 @@ lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh)
        unsigned long offset = sizeof(struct mach_header);
        NSSymbol retSym = 0;
        const struct mach_header *mh1;
-       fprintf(stderr,"Symbol: %s\n",symbol);
        if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) )
        {
                for (j = 0; j < mh->ncmds; j++)
@@ -1737,8 +1732,6 @@ lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh)
                        lc = (struct load_command*)(((unsigned long)mh) + offset);
                        if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
                        {
-                               fprintf(stderr,"Symbol %s\n",(char*)(((struct dylib_command*)lc)->dylib.name.offset + 
-                                                                               (unsigned long)lc));
                                mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset + 
                                                                                (unsigned long)lc));
                                if (!mh1)
@@ -1855,8 +1848,11 @@ sys_dyld_close (loader_data, module)
 #ifdef __ppc__
                        flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
 #endif
-               retCode = NSUnLinkModule(module,flags);                                                                                         
-       
+               if (!NSUnLinkModule(module,flags))
+               {
+                       retCode=1;
+                       LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE)));
+               }                                                                               
        }
        
  return retCode;
index 1b13c1ccb0d2701ba50fa9330263d9d7134e829e..eb7432ee1fd2cc6205496961784591c80bf71ace 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2515,7 +2515,6 @@ EOF
          if test "$link_all_deplibs" != no; then
            # Add the search paths of all dependency libraries
            for deplib in $dependency_libs; do
-             depdepl=
              case $deplib in
              -L*) path="$deplib" ;;
              *.la)
@@ -2548,28 +2547,37 @@ EOF
                depdepl=
                case $host in
                *-*-darwin*)
-                 depdepl=`$echo "X$deplib" | ${SED} -e 's,.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                 newlib_search_path="$newlib_search_path $path"
-                 if grep "^installed=no" $deplib > /dev/null; then
-                 # FIXME - ugly
-                  if test -f "$path/lib${depdepl}.dylib" ; then
-                      eval depdepl=$path/lib${depdepl}.dylib
-                  else
-                  # We shouldn't get here
-                      depdepl="-l$depdepl"
+                 # we do not want to link against static libs, but need to link against shared
+                 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"
                   fi
-                 else
-                   depdepl="-l$depdepl"
+                   newlib_search_path="$newlib_search_path $path"
+                   path=""
                  fi
                  ;;
-                 # end ugly FIXME
-               esac 
+               *)
                path="-L$path"
+               ;;
+               esac 
+               
                ;;
                  -l*)
                case $host in
                *-*-darwin*)
-           depdepl=$deplib
+                # 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=""
                  ;;
                *) continue ;;
                esac