Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!crdgw1!montnaro From: montnaro@spyder.crd.ge.com (Skip Montanaro) Newsgroups: comp.windows.x Subject: Re: LD_LIBRARY_PATH woes Message-ID: Date: 30 May 90 00:07:33 GMT References: <9005291632.AA06491@ssiwest.com> Sender: news@crdgw1.crd.ge.com Reply-To: montanaro@crdgw1.ge.com (Skip Montanaro) Organization: GE Corporate Research & Development, Schenectady, NY Lines: 124 In-reply-to: quenelle@ssiwest.UUCP's message of 29 May 90 16:32:13 GMT The problems identified by Chris Quenelle (<9005291632.AA06491@ssiwest.com>) regarding LD_LIBRARY_PATH are only part of the problem related to multiple window systems on Suns. At GE CRD users can choose between Suntools, Quest X11R3, MIT X11R3, MIT X11R4, and Sun's OpenWindows. Some people (like myself) go back and forth between two or three of them with some regularity. I've identified the following user-level problems that make it impossible to establish a single environment at login time that will work for all window systems I might want to run: * LD_LIBRARY_PATH - Its contents change between X11R4 and OpenWindows * PATH - For instance: The xterm that comes with X11R3 or X11R4 doesn't work well (at all?) with OpenWindows. In OpenWindows, Sun thoughtfully placed xterm in the OpenWindows demos directory, where it resides with several NeWS-dependent commands, thus .../demos can't be in your PATH when running anything but OpenWindows. Several commands have the same name in OpenWindows and Suntools. Unfortunately, the Suntools versions reside in /usr/bin, so it's impossible (well, a major inconvenience) to eliminate them from PATH, and they must be down in the PATH when running X. The X paths can't be there when running Suntools, however. * OpenWindows-specific environment variables - At various times over the last couple of years various versions of NeWS or OpenWindows have required the following environment variables to be defined: NEWSSERVER, OPENWINHOME, XNEWSHOME, NEWSHOME. If you count OW GUIDE as part of OpenWindows, add GUIDEHOME. Software from other sources (such as the Turing Institute's GoodNeWS and HyperNeWS) expect to find other environment variables. * Beta test software - We've beta-tested some OpenWindows-related software for Sun over the past couple of years. Usually the beta test and latest released version are only, and you might want to choose one or the other at run-time for various reasons. Consequently, I gave up several months ago, and just wrote shell scripts to establish the proper environment for the different window systems. Since they're short, I've included the two I use for OpenWindows and X11R4. They don't solve all problems, but reduce them to manageable proportions. They look somewhat different mostly because I tried for different amounts of robustness in the two. A few other people use my xnews.sh script. (For reference, PATH1 lists my private command/binary directories, and PATH2 lists the standard system directories - /usr/bin et al. ARCH is set based upon machine architecture. All are set at login time.) For X11R4 (my version of startx): ------------------------- #!/bin/sh MITXBIN=/usr/bin/X11 OPENWINHOME=/common/$ARCH/openwin LD_LIBRARY_PATH=/usr/lib:$OPENWINHOME/lib MANPATH=$OPENWINHOME/share/man:$MANPATH GUIDEHOME=$OPENWINHOME PATH=$PATH1:$MITXBIN:$OPENWINHOME/bin:$OPENWINHOME/bin/xview:\ $OPENWINHOME/demo:$PATH2 DISPLAY=${DISPLAY:-localhost:0} export OPENWINHOME LD_LIBRARY_PATH MANPATH GUIDEHOME PATH DISPLAY $MITXBIN/startx "$@" ------------------------- For OpenWindows (my xnews command): ------------------------- #!/bin/sh ARCH=${ARCH:-`arch`} if ask_yn "Use OpenWindows Beta" ; then OPENWINHOME=/home/kreskin/private/users/$ARCH/openwin/beta else OPENWINHOME=/home/kreskin/private/users/$ARCH/openwin fi GUIDEHOME=$OPENWINHOME/guide GNHOME=/home/kreskin/source/public/NeWS/GoodNeWS1.3 HNHOME=/home/kreskin/source/public/NeWS/HyperNeWS1.3 if [ x$LD_LIBRARY_PATH != x ] ; then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OPENWINHOME/lib else LD_LIBRARY_PATH=$OPENWINHOME/lib fi MANPATH=$OPENWINHOME/share/man:$MANPATH # user's private commands PATH1=${PATH1:-$HOME/bin/$ARCH:$HOME/bin} # generic system commands PATH2=${PATH2:-/common/$ARCH/bin:/usr/ucb:/usr/bin:/usr/etc:/bin:/etc:/usr/5bin:.} XPATH=$GNHOME/bin-$ARCH-xnews:$HNHOME/bin-$ARCH-xnews:$OPENWINHOME/bin:\ $OPENWINHOME/bin/xview:$GUIDEHOME/bin:$OPENWINHOME/demo:/usr/bin/X11 if [ $PATH = $PATH1:$PATH2 ] ; then # stick the windows stuff between the user's private commands and the # generic stuff PATH=$PATH1:$XPATH:$PATH2 else # user has other stuff in PATH besides PATH1 & PATH2, so just tack XPATH # on the front of PATH PATH=$XPATH:$PATH fi DISPLAY=${DISPLAY:-localhost:0} NEWSSERVER=${NEWSSERVER:-`newsserverstr localhost`} export OPENWINHOME XNEWSHOME LD_LIBRARY_PATH MANPATH GUIDEHOME PATH \ DISPLAY NEWSSERVER GNHOME HNHOME $OPENWINHOME/bin/xnews > /tmp/NeWStrace 2>&1 ------------------------- -- Skip (montanaro@crdgw1.ge.com)