]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): If we know that the host
authorGary V. Vaughan <gary@gnu.org>
Fri, 2 Feb 2001 19:02:38 +0000 (19:02 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 2 Feb 2001 19:02:38 +0000 (19:02 +0000)
architecture automatically loads deplibs, then...
* libltdl/ltdl.c (load_deplibs): ...don't manually load each one.

ChangeLog
libltdl/ltdl.c
ltdl.m4

index eddf9bb4a6cb57a995497d19c0abd8eaa93062e2..ee31ba3474f2a4d1edcbc5a621bb41ff0e5e4d3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-01  Gary V. Vaughan  <gvv@techie.com>
+
+       * ltdl.m4 (AC_LTDL_SYS_DLOPEN_DEPLIBS): If we know that the host
+       architecture automatically loads deplibs, then...
+       * libltdl/ltdl.c (load_deplibs): ...don't manually load each one.
+
 2001-01-31  Gary V. Vaughan  <gvv@techie.com>
 
        * TODO:  Updated.
@@ -5,7 +11,7 @@
        * libltdl/ltdl.c (load_deplibs): If loading a deplib fails,
        don't sweat -- it may be a lib that is already statically linked
        into the loading application.
-       
+
        * libltdl/ltdl.c: Clean up the shadowing of the global handles
        variable.
        (LT_DLRESIDENT_FLAGS): Add extra parens to satisfy -Wall.
index 85f0769302331311b68a5b4513b40320557d15c7..e39e518c0fccb413af4bbc091aa76b033e200789 100644 (file)
@@ -1565,11 +1565,16 @@ load_deplibs(handle, deplibs)
      lt_dlhandle handle;
      char *deplibs;
 {
+  int  ret = 0;
+
+#if LTDL_DLOPEN_DEPLIBS
+
   char *p, *save_search_path;
+  int   depcount = 0;
   int  i;
-  int  ret = 1, depcount = 0;
   char **names = 0;
 
+  ret = 1;
   handle->depcount = 0;
   if (!deplibs)
     {
@@ -1700,11 +1705,11 @@ load_deplibs(handle, deplibs)
          if (handle->deplibs[j])
            {
              ++j;
+           }
        }
-    }
 
       handle->depcount = j;    /* Number of successfully loaded deplibs */
-  ret              = 0;
+      ret              = 0;
     }
 
  cleanup_names:
@@ -1719,6 +1724,7 @@ load_deplibs(handle, deplibs)
   /* restore the old search path */
   LT_DLFREE (user_search_path);
   user_search_path = save_search_path;
+#endif
 
   return ret;
 }
diff --git a/ltdl.m4 b/ltdl.m4
index 6cd0281c8529e6b5ddc35922400f46098dbb411c..fa86b1be4c4ecdd9d75b7c451d4ac95be693222f 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -51,6 +51,7 @@ AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
 AC_REQUIRE([AC_LTDL_DLLIB])dnl
 AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
 AC_REQUIRE([AC_LTDL_DLSYM_USCORE])dnl
+AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])dnl
 ])# AC_LIB_LTDL
 
 # AC_LTDL_ENABLE_INSTALL
@@ -63,6 +64,29 @@ AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
 AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
 ])])# AC_LTDL_ENABLE_INSTALL
 
+# AC_LTDL_SYS_DLOPEN_DEPLIBS
+# --------------------------
+AC_DEFUN(AC_LTDL_SYS_DLOPEN_DEPLIBS,
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
+       libltdl_cv_sys_dlopen_deplibs, [dnl
+       # PORTME does your system automatically load deplibs for dlopen()?
+       libltdl_cv_sys_dlopen_deplibs=unknown
+       case "$host_os" in
+       linux*)
+         libltdl_cv_sys_dlopen_deplibs=yes
+         ;;
+       solaris*)
+         libltdl_cv_sys_dlopen_deplibs=yes
+         ;;
+       esac
+])
+if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
+ AC_DEFINE(LTDL_DLOPEN_DEPLIBS, 1,
+    [Define if the OS needs help to load dependent libraries for dlopen(). ])
+fi
+])# AC_LTDL_SYS_DLOPEN_DEPLIBS
+
 # AC_LTDL_SHLIBEXT
 # ----------------
 AC_DEFUN(AC_LTDL_SHLIBEXT,