diff options
author | Kean Johnson <kean@armory.com> | 2005-06-10 06:54:09 +0000 |
---|---|---|
committer | Kean Johnson <kean@armory.com> | 2005-06-10 06:54:09 +0000 |
commit | 27b9ddbe50db1115b7b1832c07d189fda5f47e2b (patch) | |
tree | 41dfb5c28afb27671568d7e8c0f4d279e0920d00 /startx.cpp | |
parent | dd7fee44b126636d6c3edd9e325ce411e3ae5d78 (diff) |
SCO port update for SCO OpenServer 5 and UnixWare 7. A few general cleanupssco_port_update
and bugs not specifically related to the port fixed along the way.
Diffstat (limited to 'startx.cpp')
-rw-r--r-- | startx.cpp | 66 |
1 files changed, 47 insertions, 19 deletions
@@ -1,4 +1,4 @@ -XCOMM!/bin/sh +XCOMM!SHELL_CMD XCOMM $Xorg: startx.cpp,v 1.3 2000/08/17 19:54:29 cpqbld Exp $ XCOMM @@ -13,28 +13,36 @@ XCOMM Site administrators are STRONGLY urged to write nicer versions. XCOMM XCOMM $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $ -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) XCOMM Check for /usr/bin/X11 and BINDIR in the path, if not add them. XCOMM This allows startx to be placed in a place like /usr/bin or /usr/local/bin -XCOMM and people may use X without changing their PATH +XCOMM and people may use X without changing their PATH. +XCOMM Note that we put our own bin directory at the front of the path, and +XCOMM the standard SCO path at the back, since if you are using the Xorg +XCOMM server theres a prett good chance you want to bias the Xorg clients +XCOMM over the old SCO X11R5 clients. XCOMM First our compiled path bindir=BINDIR -if expr $PATH : ".*`echo $bindir | sed 's?/?\\/?g'`.*" > /dev/null 2>&1; then - : -else - PATH=$PATH:BINDIR -fi + +case $PATH in + *:$bindir | *:$bindir:* | $bindir:*) ;; + *) PATH=$bindir:$PATH ;; +esac XCOMM Now the "SCO" compiled path +scobindir=/usr/bin/X11 -if expr $PATH : '.*\/usr\/bin\/X11.*' > /dev/null 2>&1; then - : -else - PATH=$PATH:/usr/bin/X11 -fi +case $PATH in + *:$scobindir | *:$scobindir:* | $scobindir:*) ;; + *) PATH=$PATH:$scobindir ;; +esac + +XCOMM Bourne shell doesn't automatically export modified environment variables +XCOMM so export the new PATH just in case the user changes the shell +export PATH XCOMM Set up the XMERGE env var so that dos merge is happy under X @@ -59,7 +67,7 @@ defaultserverargs="" clientargs="" serverargs="" -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) if [ -f $scoclientrc ]; then defaultclientargs=$scoclientrc else @@ -69,8 +77,20 @@ if [ -f $userclientrc ]; then elif [ -f $sysclientrc ]; then defaultclientargs=$sysclientrc fi -#ifdef SCO +#if defined(__SCO__) || defined(__UNIXWARE__) fi + +XCOMM SCO -t option: do not start an X server +case $1 in + -t) if [ -n "$DISPLAY" ]; then + REMOTE_SERVER=TRUE + shift + else + echo "DISPLAY environment variable not set" + exit 1 + fi + ;; +esac #endif if [ -f $userserverrc ]; then @@ -175,10 +195,10 @@ XCOMM now add the same credentials to the client authority file XCOMM if '$displayname' already exists don't overwrite it as another XCOMM server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do - authcookie=`xauth list "$displayname" @@ + authcookie=`BINDIR/xauth list "$displayname" @@ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" == "z" ] ; then - xauth -q << EOF + BINDIR/xauth -q << EOF add $displayname . $mcookie EOF removelist="$displayname $removelist" @@ -192,10 +212,18 @@ done #endif -xinit $client $clientargs -- $server $display $serverargs +#if defined(__SCO__) || defined(__UNIXWARE__) +if [ "$REMOTE_SERVER" = "TRUE" ]; then + exec /bin/sh ${client} +else + BINDIR/xinit $client $clientargs -- $server $display $serverargs +fi +#else +BINDIR/xinit $client $clientargs -- $server $display $serverargs +#endif if [ x"$removelist" != x ]; then - xauth remove $removelist + BINDIR/xauth remove $removelist fi if [ x"$xserverauthfile" != x ]; then rm -f $xserverauthfile |