> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Trawick > Sent: 18 April 2002 19:12
> "Sander Striker" <[EMAIL PROTECTED]> writes: > >>>>> 1) always do libtool --install >> >> Can we agree on this? Since we are using libtool throughout our >> entire build it seems inconsistent to bypass it here. > > yes, we can agree on this... Ok, glad to hear that. > I'm planning to work on this tonight and in the morning. If you'd > rather proceed yourself, that's fine, and I can test on AIX, Tru64, > and HP-UX and assume that any oddities on other platforms are > represented by what happens on those three platforms. Ok, cool. I probably don't have time to look at it until this weekend, so please don't wait for me. I'll provide some comments here that will hopefully be helpfull. >>>>> 2) look in installed .la file for the name that must be passed to >>>>> dlopen and rename that file in the target directory to what we >>>>> think a DSO ought to be named >>>> >>>> But we only need to do that for AIX, Tru64 and HP-UX. >>> >>> I don't really believe that :) libtool has as many nuances as there >>> are operating systems. It seems easy enough to look in the .la file >>> and if the name to dlopen is different than what we want, rename what >>> it got installed as. >> >> Can you give me some examples? I am totally in the dark here and >> some input on what happens could possibly enable me to help solve >> the problem. > > Here is what gets installed for me with libtool 1.4.2 on AIX: > > -rw-r--r-- 1 trawick staff 62568 Apr 18 12:53 > ../../built/modules/libmod_foo.a > lrwxrwxrwx 1 trawick staff 25 Apr 18 12:53 > ../../built/modules/libmod_foo.so -> libmod_foo.so.0.0.0 > lrwxrwxrwx 1 trawick staff 25 Apr 18 12:53 > ../../built/modules/libmod_foo.so.0 -> > libmod_foo.so.0.0.0 > -rwxr-xr-x 1 trawick staff 71968 Apr 18 12:53 > ../../built/modules/libmod_foo.so.0.0.0 > -rw-r--r-- 1 trawick staff 792 Apr 18 12:53 > ../../built/modules/mod_foo.la > > These variables in the .la file look interesting: > > # The name that we can dlopen(3). > dlname='libmod_foo.so.0.0.0' > # Names of this library. > library_names='libmod_foo.so.0.0.0 libmod_foo.so.0 libmod_foo.so' Ah, now I see what you are talking about. Ok, I think we need to do the following (all the time*): - extract dlname from $MODULE_BASENAME.la - extract library_names from $MODULE_BASENAME.la - remove $MODULE_BASENAME.la - remove all files in library_names, except $dlname - rename $dlname to $MODULE_BASENAME.so And maybe: - remove [lib]$MODULE_BASENAME.a Judging from your emails this is kind of what you had in mind, correct? *) That is, until a patch is submitted to libtool that will give us our expected behaviour all the time. >> Also, is this solvable in libtool itself? IOW, can we come up with >> a patch to libtool that solves the problem? > > sure, somebody could come up with a patch :) heh. >>>>> 3) since this design does libtool --install for every DSO, we need to >>>>> work hard to zap the extra system-dependent libtool-created >>>>> files/symlinks in the target directory >>>> >>>> But that's not too hard. We can zap everything not ending with .so, >>>> right? >>> >>> sounds right... and you have to account for a possible "lib" prefix >>> on some of the files >> >> How did the lib prefix get there in the first place? (does that happen >> on AIX, Tru64 or HP-UX?). > > libtool decided that the lib prefix was appropriate (and I expect that > it is correct, given the assumption that the library is for linking > against) . > >> If you pass -module to libtool you can name >> it anything you like; like we do for our modules. > > We're already using -module. Are we using it incorrectly? That's odd. I thought that was one of the reasons to use -module. If you don't pass it, libtool complains that the name doesn't start with 'lib'. This sounds like a libtool bug. You are only seeing the lib prefix appear on some platforms, correct? Sander
