libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to fix missing pathnames in uninstalled libraries


From: Greg Eisenhauer
Subject: Patch to fix missing pathnames in uninstalled libraries
Date: Sun, 2 Mar 2003 00:18:20 -0500

Hi Folks,
        I have a long-standing difficulty with CVS that I've normally
patched around for my own packages. I've not reported it previously, largely
because I was unsure if libtool officially supported the situation in which
I ran into the difficulty.  But, given that another version of libtool may
be released shortly I thought I'd submit a patch.
        Basically, I'm building a libtool library that itself does dlopening
of libtool modules, a situation that is not covered in the libtool tests.  I
provide -dlopen arguments to libtool when creating the library.  The
difficulty is that in CVS libtool, the list of dlopen'd and dlpreopen'd
files in uninstalled libraries may contain filename entries that do not have
fully rooted paths.  Links against such uninstalled libraries will then fail
(unless they happen to be performed in the same directory as the library was
built).  The two obvious fixes to this problem are:
   1. substituting a absolute paths into the dlopen/dlpreopen values
      before they are written to the .la file of the loading module.
   2. prepending the path of the .la file after finding a relative path
      in dlopen/dlpreopen values ready by libtool.
I don't know if there is any reason to prefer one approach over the other.
The patch below takes approach 1, searching the dlopen/dlopen values for
relative paths and substituting an absolute path when generating an
uninstalled .la file. 
        I consider this a pretty small change, exceeding 10 lines only by
virtue of code being repeated for both $dlfiles and $dlprefiles.  However,
I'm more than happy to do copyright assignment if that is necessary.  Patch
follows. 

greg

-----------------------------------------------------------------------------
greg eisenhauer         address@hidden          (404)894-3227
http://www.cc.gatech.edu/~eisen/
College of Computing, Georgia Institute of Technology, Atlanta, GA  30332




2003-03-01  Greg Eisenhauer  <address@hidden>

        * ltmain.in: Provide absolute paths for dlopen and dlpreopen files
          in generating uninstalled libtool libraries.

latte% cvs diff -u ltmain.in
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.326
diff -u -r1.326 ltmain.in
--- ltmain.in   28 Feb 2003 15:27:35 -0000      1.326
+++ ltmain.in   28 Feb 2003 21:09:06 -0000
@@ -4996,6 +4996,25 @@
              newdlprefiles="$newdlprefiles $libdir/$name"
            done
            dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in 
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlfiles="$newdlfiles $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in 
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             newdlprefiles="$newdlprefiles $abs"
+           done
+           dlprefiles="$newdlprefiles"
          fi
          $rm $output
          # place dlname in correct position for cygwin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]