]> 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:52:34 +0000 (01:52 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 4 Sep 2000 01:52:34 +0000 (01:52 +0000)
dlname is empty.

ChangeLog
libltdl/ltdl.c

index b89fb080094fc93d6cfcd00241178e44167f2bb3..6ba4cef81c22d83b57209c19279c6efe011f7b52 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.
+
        * ltdl.m4 (HAVE_LIBDL): Look for dlopen in -lsvld.
        * ltconfig.in: Likewise.
 
index 134fbab36407afd7541eebaa699cd710e2a371eb..ac2540d6a4e26da9dcbe84bc4acaf4f154f16656 100644 (file)
@@ -1,5 +1,5 @@
 /* ltdl.c -- system independent dlopen wrapper
-   Copyright (C) 1998-2000 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.
 
@@ -1440,6 +1440,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;
                }