summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-03 19:40:11 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-04 00:42:31 -0700
commit0a361d0e5f896351b98dc9765b4a33c79efa6f02 (patch)
treeb817e009eedb6d821a99099491ee45b5bb840524
parente6e83d81ee7366779d600cbb128034e248815339 (diff)
XQuartz: Use --with-launchd-id-prefix for consistency with xinit
Also actually honor LAUNCHD_ID_PREFIX and APPLE_APPLICATION_NAME (cherry picked from commit 990038ab006b2f5e03dcef385514ba4e4584bd25)
-rw-r--r--configure.ac9
-rw-r--r--hw/xquartz/bundle/Info.plist.cpp4
-rw-r--r--hw/xquartz/bundle/Makefile.am2
-rw-r--r--hw/xquartz/mach-startup/Makefile.am4
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c8
-rw-r--r--hw/xquartz/mach-startup/stub.c10
-rw-r--r--include/dix-config.h.in3
7 files changed, 23 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 2215d2c02..6345fd994 100644
--- a/configure.ac
+++ b/configure.ac
@@ -523,10 +523,11 @@ AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name
[ APPLE_APPLICATION_NAME="${withval}" ],
[ APPLE_APPLICATION_NAME="X11" ])
AC_SUBST([APPLE_APPLICATION_NAME])
-AC_ARG_WITH(apple-application-id,AS_HELP_STRING([--with-apple-application-id=VALUE], [CFBundleIdentification for the .app (default: org.x.X11)]),
- [ APPLE_APPLICATION_ID="${withval}" ],
- [ APPLE_APPLICATION_ID="org.x.X11" ])
-AC_SUBST([APPLE_APPLICATION_ID])
+AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]),
+ [ LAUNCHD_ID_PREFIX="${withval}" ],
+ [ LAUNCHD_ID_PREFIX="org.x" ])
+AC_SUBST([LAUNCHD_ID_PREFIX])
+AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers])
AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
[ XQUARTZ_SPARKLE="${enableval}" ],
[ XQUARTZ_SPARKLE="no" ])
diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 6d951ada8..d385e078b 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -7,11 +7,11 @@
<key>CFBundleExecutable</key>
<string>X11</string>
<key>CFBundleGetInfoString</key>
- <string>APPLE_APPLICATION_NAME</string>
+ <string>LAUNCHD_ID_PREFIX.X11</string>
<key>CFBundleIconFile</key>
<string>X11.icns</string>
<key>CFBundleIdentifier</key>
- <string>APPLE_APPLICATION_ID</string>
+ <string>LAUNCHD_ID_PREFIX.X11</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am
index ea02cd620..f8b96d8c4 100644
--- a/hw/xquartz/bundle/Makefile.am
+++ b/hw/xquartz/bundle/Makefile.am
@@ -1,7 +1,7 @@
include cpprules.in
CPP_FILES_FLAGS = \
- -DAPPLE_APPLICATION_ID="$(APPLE_APPLICATION_ID)" \
+ -DLAUNCHD_ID_PREFIX="$(LAUNCHD_ID_PREFIX)" \
-DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)"
if XQUARTZ_SPARKLE
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 2901b6559..334f06d43 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -3,7 +3,9 @@ AM_CPPFLAGS = \
-DXSERVER_VERSION=\"$(VERSION)\" \
-DX11BINDIR=\"$(bindir)\"
-x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS
+AM_CFLAGS = $(XSERVER_CFLAGS) $(DIX_CFLAGS)
+
+x11appdir = $(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/MacOS
x11app_PROGRAMS = X11.bin
dist_X11_bin_SOURCES = \
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index ef5d75700..583d67ea1 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -31,6 +31,10 @@
#include <CoreFoundation/CoreFoundation.h>
#include <AvailabilityMacros.h>
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include <X11/Xlib.h>
#include <unistd.h>
#include <stdio.h>
@@ -76,7 +80,7 @@ const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Bui
char __crashreporter_info__buf[4096];
char *__crashreporter_info__ = __crashreporter_info__buf;
-static char *server_bootstrap_name = "org.x.X11";
+static char *server_bootstrap_name = LAUNCHD_ID_PREFIX".X11";
#define DEBUG 1
@@ -559,7 +563,7 @@ int main(int argc, char **argv, char **envp) {
fprintf(stderr, "Waiting for startup parameters via Mach IPC.\n");
kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0);
if (kr != KERN_SUCCESS) {
- fprintf(stderr, "org.x.X11(mp): %s\n", mach_error_string(kr));
+ fprintf(stderr, "%s.X11(mp): %s\n", LAUNCHD_ID_PREFIX, mach_error_string(kr));
return EXIT_FAILURE;
}
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index cee811695..7a557bd3f 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -40,15 +40,11 @@
#include <sys/socket.h>
#include <sys/un.h>
-static char *server_bootstrap_name = "org.x.X11";
-
-/* The launchd startup is only designed for the primary X11.app that is
- * org.x.X11... server_bootstrap_name might be differnet if we were triggered to
- * start by another X11.app.
- */
-#define kX11AppBundleId "org.x.X11"
+#define kX11AppBundleId LAUNCHD_ID_PREFIX".X11"
#define kX11AppBundlePath "/Contents/MacOS/X11"
+static char *server_bootstrap_name = kX11AppBundleId;
+
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <servers/bootstrap.h>
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index fcb582ff0..798d9e73c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -127,6 +127,9 @@
/* Support application updating through sparkle. */
#undef XQUARTZ_SPARKLE
+/* Prefix to use for launchd identifiers */
+#undef LAUNCHD_ID_PREFIX
+
/* Build a standalone xpbproxy */
#undef STANDALONE_XPBPROXY