Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!ut-emx!mic From: mic@ut-emx.uucp (Mic Kaczmarczik) Newsgroups: comp.windows.x Subject: Re: Sun shared libs - openwin vs MIT R4 Message-ID: <48760@ut-emx.uucp> Date: 10 May 91 04:37:54 GMT References: <1991May8.210941.4846@watdragon.waterloo.edu> Organization: UT Austin Computation Center, Unix/VMS Services Lines: 63 In article <1991May8.210941.4846@watdragon.waterloo.edu> jmsellens@watdragon.waterloo.edu (John M. Sellens) writes: >Sun, in their wisdom, forces OpenWindows users to set LD_LIBRARY_PATH >in order to find the shared libraries in /usr/openwin/lib, instead of >putting them somewhere normal, like /usr/lib for example, or using an >appropriate -L on the cc command line when they link the applications. > >I have the MIT shared libraries somewhere else (doesn't really matter where). >I'm having trouble convincing my MIT binaries to ignore LD_LIBRARY_PATH, >and use the library paths that I gave them when I linked them. I checked >the FAQ, but it didn't seem to answer this question. I stumbled across the following configuration that appears to work on our systems where we have R4 with all the current fixes and OpenWindows 2.0. DISCLAIMER: I am not completely sure that this is what one really wants to do about this, nor am I confident that it will work for R5 or OW > 2.0. That said, here we go: 1) If the X11R4 shared libraries are in /usr/foo/mumble/lib, ln -s /usr/foo/mumble/lib/libX*.s[ao].* /usr/local/lib (Locally, they're in /usr/local/X11R4/lib.) You could also use the SunOS ldconfig command to add another directory to the shared library cache instead of using the default /usr/local/lib. 2) Now do the same with the OpenWindows libraries: ln -s /usr/openwin/lib/lib[xX]*.s[ao].* /usr/local/lib 3) Make OpenWindows programs use the R4 libraries if LD_LIBRARY_PATH isn't set: rm /usr/local/lib/libX11.so.4.3 ln -s libX11.so.4.2 /usr/local/lib/libX11.so.4.3 4) Make R4 applications use the OpenWindows library when it is: ln -s libX11.so.1.0 /usr/openwin/lib/libX11.so.4.3 ln -s libX11.sa.1.0 /usr/openwin/lib/libX11.sa.4.3 Steps 1 and 2 make use of the fact that the dynamic linker searches the /usr/local/lib by default, whether LD_LIBRARY_PATH is set or not. Steps 3 and 4 were arrived at by experimentation; I figured it would be better to have all of the applications in an X session using the same X library, whether it was the R4 version or the OpenWindows version. The net effect (or so I think) is that with LD_LIBRARY_PATH unset, as it is when you use xinit or xdm, OpenWindows applications get the MIT R4 libX11, and R4 applications do too. When you start up OpenWindows using /usr/bin/openwin, LD_LIBRARY_PATH is set to /usr/openwin/lib, and R4 applications use the OpenWindows libX11. I routinely switch between OpenWindows and R4 using the same .xinitrc, resource files and window manager (tvtwm) and usually can't tell the difference unless I notice that oclock isn't round when I use the OpenWindows server. Your mileage may vary. Dealer participation may affect final purchase price. :-) --mic-- -- Mic Kaczmarczik | Unix/VMS Services | Purgamentum init, exit purgamentum. UT Austin Computation Center | remark@{ccwf,emx,bongo} 1-0251 | -- Latin For All Occasions