From: Sven M. H. <pe...@gm...> - 2001-05-22 13:57:52
|
On Tue, May 22, 2001 at 01:12:39PM +0200, Marcelo E. Magallon wrote: > >> "Sven M. Hallberg" <pe...@gm...> writes: > > > Then, if we don't know the correct filename (except in special cases > > where there is something like an ABI) we can let libtool decide. > > After all it's its job! If we stumble across a system with an ABI we > > might be violating, we can still incorporate a special-case > > treatment. > > Yes. My guess is that each (Unix-like) vendor has (an|their own) ABI > for OpenGL. Linux just happens to have one that's used by more than > one group. A quick look arround here indicates that HP-UX's libGL is > called libGL.2, IRIX's seems to be called libGL.so with a "MIPS > version" of "sgi1.0" (I have never understood SGI's policy regarding > SONAMEs, but I've never seen it break, so I guess it's ok). The other > Unix flavors I have access to don't have the vendor's libGL installed > on them. OK. So we let libtool do its work and (constructively) interfere with it only where the necessity pops up, right? > > Here's the pseudo-code for the install-hook, do you think this would > > be OK to do on systems identified as Linux? > > Hmmm... the whole ABI bussiness is about the soname *in* the library > file. libtool happyly ignores any -Wl,-soname,libfoo.so.1 you pass to > it (because it's not portable). Oh, I'll try it, too. > > if test `find .libs/ -name libGL.so.1 | grep -c libGL.so.1` != 1; then > if there's exactly one file named libGL.so.1 ... If there's not exactly one. > > libfile=`find .libs/* -not -type l -not -name '*.lai'` > look for the library files ... (note there are likely two of these, one > libGL.so.x.y.z and one libGL.a -- you *want* the libGL.a, too) Oh, right. Maybe we should just scrap this whole thing, assuming libtool does it right. > > if test 'echo $libfile | grep -c $libfile` = 1; then > I got lost here. If there's exactly one shared library? Oh, this is of course bull. echo $libfile | grep -c '*' = 1 would be correct. Basically meant as a line count (Is wc -l portable?). > > ln -s @libdir@/$libfile @libdir@/libGL.so.1 > link libGL.so.1 to this > > else > else there's a problem. > Like I said, what's important is the SONAME contained in the library, > what this file is called is not important. Like this: Really?? I thought it was like this: SONAME of library X = Y. compile executable Z with -lX -> linker puts SONAME(X)=Y to NEEDED(Z) execute Z -> linker looks up library of _name_ Y. If lib Y doesn't exist, linker fails. Is it different? > soname=`readelf -d $libfile | sed -ne '/SONAME/ s/.*\[\(.*\)\]/\1/p'` > if test $soname != libGL.so.1 > echo There's a problem ... > exit 1 > else > # Asuming libfile is something like libGL.so.1.2.350 (and not > # /some/dir/.libs/libGL.so.1.2.350) > ln -s $libfile @libdir@/libGL.so.1 > fi > > (objdump and readelf are both part of binutils, so on Linux it's safe > to asume they are present. I just happen to like readelf better) OK. > > So you mean, we should include the library depedencies in our library > > objects? > > If possible, yes. It makes life much simpler. :-) Hm. look at this: --- 8< --- pesco@crest:~/cvswork/Mesa/src/.libs$ ldd libGL.so libvga.so.1 => /usr/lib/libvga.so.1 (0x401de000) libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40235000) libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4023e000) libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x40254000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40269000) libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x40278000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40280000) libpthread.so.0 => /lib/libpthread.so.0 (0x4035b000) libc.so.6 => /lib/libc.so.6 (0x40371000) libm.so.6 => /lib/libm.so.6 (0x40483000) libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x404a5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) pesco@crest:~/cvswork/Mesa/si-glu/.libs$ ldd libGLU.so libc.so.6 => /lib/libc.so.6 (0x400b5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x2aaaa000) --- >8 --- libGL already gets these dependencies from the various convenience libs. Can anyone see whether there are any missing? Since I built the si-glu Makefile.am's I'll just add -lGL there, right? > BTW, I tried -version-info 3:350:2 on IRIX... not good... the linker > exits with a bus error. Gotta love the MIPSpro tool chain... Ugh. Do you have any indication why that fails? Maybe it doesn't like the high REVISION number? Greetings, Sven -- "Would the All-Seeing Eye please look in my direction?" [ KeyID........: 0xC297FEAB ] [ Fingerprint..: FEA5 0F93 7320 3F39 66A5 AED3 073F 2D5F C297 FEAB ] |