From: Marcelo E. M. <mar...@bi...> - 2001-05-22 11:12:44
|
>> "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. > 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). > 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 ... > 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) > if test 'echo $libfile | grep -c $libfile` = 1; then I got lost here. If there's exactly one shared library? > 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: 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) > So you mean, we should include the library depedencies in our library > objects? If possible, yes. It makes life much simpler. :-) 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... -- Marcelo |