summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@yuffie.local>2008-01-09 21:03:41 -0800
committerJeremy Huddleston <jeremy@yuffie.local>2008-01-09 21:03:41 -0800
commit7400760ae1b88d0c514aa119643cd412a4a68b06 (patch)
treeaf04190ec9adbc4a96d1f609522908079ed41fe6
parent0f740f75ececc9742c6f407d53b482897ef5f698 (diff)
OS-X: Add bindir to $PATH in startx if it's not there
This should also fix this on SCO since it was using the incorrect BINDIR instead of __bindir__ in that code block...
-rw-r--r--org.x.X11.plist.cpp16
-rw-r--r--startx.cpp33
2 files changed, 28 insertions, 21 deletions
diff --git a/org.x.X11.plist.cpp b/org.x.X11.plist.cpp
index bede9b2..2e597ca 100644
--- a/org.x.X11.plist.cpp
+++ b/org.x.X11.plist.cpp
@@ -7,18 +7,18 @@
<key>ProgramArguments</key>
<array>
#ifdef __APPLE__
- <string>/bin/bash</string>
- <string>--login</string>
+ <string>/bin/bash</string>
+ <string>--login</string>
#endif
- <string>__bindir__/startx</string>
+ <string>__bindir__/startx</string>
</array>
<key>Sockets</key>
<dict>
- <key>:0</key>
- <dict>
- <key>SecureSocketWithKey</key>
- <string>DISPLAY</string>
- </dict>
+ <key>:0</key>
+ <dict>
+ <key>SecureSocketWithKey</key>
+ <string>DISPLAY</string>
+ </dict>
</dict>
<key>ServiceIPC</key>
<true/>
diff --git a/startx.cpp b/startx.cpp
index 23ea024..dad3346 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -13,37 +13,44 @@ XCOMM Site administrators are STRONGLY urged to write nicer versions.
XCOMM
XCOMM $XFree86: xc/programs/xinit/startx.cpp,v 3.16tsi Exp $
-#if defined(__SCO__) || defined(__UNIXWARE__)
+#if defined(__SCO__) || defined(__UNIXWARE__) || defined(__APPLE__)
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 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 the standard system path at the back, since if you are using the Xorg
XCOMM server theres a pretty good chance you want to bias the Xorg clients
-XCOMM over the old SCO X11R5 clients.
+XCOMM over the old system's clients.
XCOMM First our compiled path
-
-bindir=BINDIR
-scobindir=/usr/bin/X11
+bindir=__bindir__
case $PATH in
- *:$bindir | *:$bindir:* | $bindir:*) ;;
- *) PATH=$bindir:$PATH ;;
+ *:$bindir | *:$bindir:* | $bindir:*) ;;
+ *) PATH=$bindir:$PATH ;;
esac
-XCOMM Now the "SCO" compiled path
+XCOMM Now the "old" compiled path
+#ifdef __APPLE__
+olddbindir=/usr/X11R6/bin
+#else
+oldbindir=/usr/bin/X11
+#endif
-case $PATH in
- *:$scobindir | *:$scobindir:* | $scobindir:*) ;;
- *) PATH=$PATH:$scobindir ;;
-esac
+if [ -d "$oldbindir" ] ; then
+ case $PATH in
+ *:$oldbindir | *:$oldbindir:* | $oldbindir:*) ;;
+ *) PATH=$PATH:$oldbindir ;;
+ esac
+fi
XCOMM Bourne shell does not automatically export modified environment variables
XCOMM so export the new PATH just in case the user changes the shell
export PATH
+#endif
+#if defined(__SCO__) || defined(__UNIXWARE__)
XCOMM Set up the XMERGE env var so that dos merge is happy under X
if [ -f /usr/lib/merge/xmergeset.sh ]; then