]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Allow for extensions other than .a for preloaded modules.
authorPeter O'Gorman <peter@pogma.com>
Tue, 26 Aug 2008 17:42:53 +0000 (12:42 -0500)
committerPeter O'Gorman <peter@pogma.com>
Tue, 26 Aug 2008 17:42:53 +0000 (12:42 -0500)
* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
* libltdl/ltdl.c (lt_dladvise_preload): Use it.
Reported by Ralf Wildenhues.

ChangeLog
libltdl/ltdl.c
libltdl/m4/ltdl.m4

index 48b8e5a9550f413fe54866ab7e07bfb0ff75155d..9a67fd50d435c0dc16606393cd6558689f858d02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-26  Peter O'Gorman  <peter@pogma.com>
+
+       Allow for extensions other than .a for preloaded modules.
+       * libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LT_LIBEXT.
+       * libltdl/ltdl.c (lt_dladvise_preload): Use it.
+       Reported by Ralf Wildenhues.
+
 2008-08-26  Peter O'Gorman  <peter@pogma.com>,
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index 5a2656543c8b6e0cdcd76ebb86c28e50003cb81d..6e19599f830960f82fba4fa18f48b8677cc38fe7 100644 (file)
@@ -50,6 +50,10 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #  define LT_FILENAME_MAX      1024
 #endif
 
+#if !defined(LT_LIBEXT)
+#  define LT_LIBEXT "a"
+#endif
+
 /* This is the maximum symbol size that won't require malloc/free */
 #undef LT_SYMBOL_LENGTH
 #define LT_SYMBOL_LENGTH       128
@@ -67,6 +71,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 static const char      objdir[]                = LT_OBJDIR;
 static const char      archive_ext[]           = LT_ARCHIVE_EXT;
+static  const char     libext[]                = LT_LIBEXT;
 #if defined(LT_MODULE_EXT)
 static const char      shlib_ext[]             = LT_MODULE_EXT;
 #endif
@@ -1258,7 +1263,8 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
       if (vtable)
        {
-         archive_name = MALLOC (char, LT_STRLEN (name) + 3);
+         /* name + "." + libext + NULL */
+         archive_name = MALLOC (char, LT_STRLEN (name) + LT_STRLEN (libext) + 2);
          *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
 
          if ((*phandle == NULL) || (archive_name == NULL))
@@ -1270,7 +1276,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
 
          /* Preloaded modules are always named according to their old
             archive name.  */
-         sprintf (archive_name, "%s.a", name);
+         sprintf (archive_name, "%s.%s", name, libext);
 
          if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0)
            {
index 563889e6b33f47a283927757274b22ec1e7af719..bac721ee5fb238a329058312fdb5f369d83c5a49 100644 (file)
@@ -413,6 +413,8 @@ AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
 AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
 AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
 
+AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
+
 name=ltdl
 LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
 AC_SUBST([LTDLOPEN])