]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dlopen): Set dlname from library_names if
authorAlexandre Oliva <aoliva@redhat.com>
Mon, 4 Sep 2000 01:53:05 +0000 (01:53 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 4 Sep 2000 01:53:05 +0000 (01:53 +0000)
dlname is empty.

ChangeLog
libltdl/ltdl.c

index 166c945957f940af6b8443d4417edd776b9a99f5..28050bfa8b3acd82e1a797be4c525934cc11b0b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-09-03  Alexandre Oliva  <aoliva@redhat.com>
 
+       * libltdl/ltdl.c (lt_dlopen): Set dlname from library_names if
+       dlname is empty.
+
        * libltdl/configure.in (HAVE_LIBDL): Look for dlopen in -lsvld.
        * ltconfig.in: Likewise.
 
index 4d75e02e51fd902958bb1bab884484a44bfb40f2..aec38497d075ab52e014220b629a15bc76f7b6ec 100644 (file)
@@ -1,5 +1,5 @@
 /* ltdl.c -- system independent dlopen wrapper
-   Copyright (C) 1998-1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
    Originally by Thomas Tanner <tanner@ffii.org>
    This file is part of GNU Libtool.
 
@@ -1318,6 +1318,22 @@ lt_dlopen (filename)
                        else
                        if (strcmp(line, "installed=no\n") == 0)
                                installed = 0;
+                       else
+#                      undef  STR_LIBRARY_NAMES
+#                      define STR_LIBRARY_NAMES "library_names="
+                       if (! dlname &&
+                           strncmp(line, STR_LIBRARY_NAMES,
+                               sizeof(STR_LIBRARY_NAMES) - 1) == 0) {
+                         char *last_libname;
+                         error = trim(&dlname,
+                                      &line[sizeof(STR_LIBRARY_NAMES) - 1]);
+                         if (! error && dlname &&
+                             (last_libname = strrchr(dlname, ' ')) != NULL) {
+                           last_libname = strdup(last_libname + 1);
+                           free(dlname);
+                           dlname = last_libname;
+                         }
+                       }
                        if (error)
                                break;
                }