summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac8
-rw-r--r--launchd/user_startx/Makefile.am4
-rw-r--r--launchd/user_startx/startx.plist.cpp4
3 files changed, 13 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 4e808ec..4402ba5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,9 @@ AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with sup
AC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [Path to launchd's LaunchAgents directory (default: /Library/LaunchAgents)]),
[ launchagentsdir="${withval}" ],
[ launchagentsdir="/Library/LaunchAgents" ])
+AC_ARG_WITH(launchagent-xserver, AS_HELP_STRING([--with-launchagent-xserver=PATH], [Path to the X server which the LaunchAgent should start (if not provided, let startx decide)"]),
+ [ launchagentxserver="${withval}" ],
+ [ launchagentxserver="no" ])
AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], [Path to launchd's LaunchDaemonss directory (default: /Library/LaunchDaemons)]),
[ launchdaemonsdir="${withval}" ],
[ launchdaemonsdir="/Library/LaunchDaemons" ])
@@ -126,17 +129,16 @@ if test "x$LAUNCHD" = "xyes" ; then
AC_CHECK_FUNC(dispatch_async,
AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]),
[])
-else
- launchagentsdir=""
- launchdaemonsdir=""
fi
AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$bundleidprefix", [Prefix to use for launchd identifiers])
AC_SUBST([launchagentsdir])
AC_SUBST([launchdaemonsdir])
AC_SUBST([bundleidprefix])
+AC_SUBST([launchagentxserver])
AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
AM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"])
+AM_CONDITIONAL(LAUNCHAGENT_XSERVER, [test "x$launchagentxserver" != "xno"])
# Checks for pkg-config packages
PKG_CHECK_MODULES(XINIT, x11)
diff --git a/launchd/user_startx/Makefile.am b/launchd/user_startx/Makefile.am
index ce00e73..bf18fb0 100644
--- a/launchd/user_startx/Makefile.am
+++ b/launchd/user_startx/Makefile.am
@@ -36,6 +36,10 @@ CPP_FILES_FLAGS = \
-D__bindir__="$(bindir)" \
-DBUNDLE_ID_PREFIX="$(bundleidprefix)"
+if LAUNCHAGENT_XSERVER
+CPP_FILES_FLAGS += -DLAUNCHAGENT_XSERVER_PATH="$(launchagentxserver)"
+endif
+
$(bundleidprefix).startx.plist.cpp: startx.plist.cpp
cp $< $@
diff --git a/launchd/user_startx/startx.plist.cpp b/launchd/user_startx/startx.plist.cpp
index 9d9c1a4..a43025f 100644
--- a/launchd/user_startx/startx.plist.cpp
+++ b/launchd/user_startx/startx.plist.cpp
@@ -8,6 +8,10 @@
<array>
<string>__xinitrcdir__/launchd_startx</string>
<string>__bindir__/startx</string>
+#ifdef LAUNCHAGENT_XSERVER_PATH
+ <string>--</string>
+ <string>LAUNCHAGENT_XSERVER_PATH</string>
+#endif
</array>
<key>Sockets</key>
<dict>