XQuartz: Rename launchd-id-prefix to bundle-id-prefix

It's used many other places than just for launchd.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston 2011-04-24 21:35:04 -07:00
parent e466745109
commit de4023f194
12 changed files with 30 additions and 27 deletions

View File

@ -562,11 +562,14 @@ 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(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_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]),
[ BUNDLE_ID_PREFIX="${withval}" ],
[ BUNDLE_ID_PREFIX="org.x" ])
AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]),
[ BUNDLE_ID_PREFIX="${withval}" ],
[ BUNDLE_ID_PREFIX="org.x" ])
AC_SUBST([BUNDLE_ID_PREFIX])
AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle 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" ])

View File

@ -1012,7 +1012,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
NSMaxY([[NSScreen mainScreen] visibleFrame]);
#ifdef HAVE_LIBDISPATCH
eventTranslationQueue = dispatch_queue_create(LAUNCHD_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
eventTranslationQueue = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.NSEventsToX11EventsQueue", NULL);
assert(eventTranslationQueue != NULL);
#endif

View File

@ -7,11 +7,11 @@
<key>CFBundleExecutable</key>
<string>X11</string>
<key>CFBundleGetInfoString</key>
<string>LAUNCHD_ID_PREFIX.X11</string>
<string>BUNDLE_ID_PREFIX.X11</string>
<key>CFBundleIconFile</key>
<string>X11.icns</string>
<key>CFBundleIdentifier</key>
<string>LAUNCHD_ID_PREFIX.X11</string>
<string>BUNDLE_ID_PREFIX.X11</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@ -1,7 +1,7 @@
include cpprules.in
CPP_FILES_FLAGS = \
-DLAUNCHD_ID_PREFIX="$(LAUNCHD_ID_PREFIX)" \
-DBUNDLE_ID_PREFIX="$(BUNDLE_ID_PREFIX)" \
-DAPPLE_APPLICATION_NAME="$(APPLE_APPLICATION_NAME)"
if XQUARTZ_SPARKLE

View File

@ -88,7 +88,7 @@ asm (".desc ___crashreporter_info__, 0x10");
static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE;
static char *launchd_id_prefix = NULL;
static char *bundle_id_prefix = NULL;
static char *server_bootstrap_name = NULL;
#define DEBUG 1
@ -491,7 +491,7 @@ static void setup_env(void) {
/* fallback to hardcoded value if we can't discover it */
if(!pds) {
pds = LAUNCHD_ID_PREFIX".X11";
pds = BUNDLE_ID_PREFIX".X11";
}
server_bootstrap_name = strdup(pds);
@ -502,12 +502,12 @@ static void setup_env(void) {
setenv("X11_PREFS_DOMAIN", server_bootstrap_name, 1);
len = strlen(server_bootstrap_name);
launchd_id_prefix = malloc(sizeof(char) * (len - 3));
if(!launchd_id_prefix) {
bundle_id_prefix = malloc(sizeof(char) * (len - 3));
if(!bundle_id_prefix) {
fprintf(stderr, "X11.app: Memory allocation error.\n");
exit(1);
}
strlcpy(launchd_id_prefix, server_bootstrap_name, len - 3);
strlcpy(bundle_id_prefix, server_bootstrap_name, len - 3);
/* We need to unset DISPLAY if it is not our socket */
if(disp) {
@ -519,7 +519,7 @@ static void setup_env(void) {
}
if(s && *s) {
if(strcmp(launchd_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
if(strcmp(bundle_id_prefix, "org.x") == 0 && strcmp(s, ":0") == 0) {
fprintf(stderr, "X11.app: Detected old style launchd DISPLAY, please update xinit.\n");
} else {
temp = (char *)malloc(sizeof(char) * len);
@ -527,12 +527,12 @@ static void setup_env(void) {
fprintf(stderr, "X11.app: Memory allocation error creating space for socket name test.\n");
exit(1);
}
strlcpy(temp, launchd_id_prefix, len);
strlcpy(temp, bundle_id_prefix, len);
strlcat(temp, ":0", len);
if(strcmp(temp, s) != 0) {
/* If we don't have a match, unset it. */
fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, launchd_id_prefix);
fprintf(stderr, "X11.app: DISPLAY (\"%s\") does not match our id (\"%s\"), unsetting.\n", disp, bundle_id_prefix);
unsetenv("DISPLAY");
}
free(temp);
@ -632,7 +632,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, "%s.X11(mp): %s\n", LAUNCHD_ID_PREFIX, mach_error_string(kr));
fprintf(stderr, "%s.X11(mp): %s\n", BUNDLE_ID_PREFIX, mach_error_string(kr));
return EXIT_FAILURE;
}

View File

@ -69,11 +69,11 @@ int launchd_display_fd(void) {
return ERROR_FD;
}
listening_fd_array = launch_data_dict_lookup(sockets_dict, LAUNCHD_ID_PREFIX":0");
listening_fd_array = launch_data_dict_lookup(sockets_dict, BUNDLE_ID_PREFIX":0");
if (NULL == listening_fd_array) {
listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0");
if (NULL == listening_fd_array) {
fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", LAUNCHD_ID_PREFIX);
fprintf(stderr,"launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n", BUNDLE_ID_PREFIX);
return ERROR_FD;
}
}

View File

@ -40,7 +40,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#define kX11AppBundleId LAUNCHD_ID_PREFIX".X11"
#define kX11AppBundleId BUNDLE_ID_PREFIX".X11"
#define kX11AppBundlePath "/Contents/MacOS/X11"
static char *server_bootstrap_name = kX11AppBundleId;

View File

@ -1,5 +1,5 @@
AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
-DBUNDLE_ID_PREFIX=\"$(BUNDLE_ID_PREFIX)\"
AM_CFLAGS=$(XPBPROXY_CFLAGS)

View File

@ -34,7 +34,7 @@
#include <unistd.h> /*for getpid*/
#include <Cocoa/Cocoa.h>
static const char *app_prefs_domain = LAUNCHD_ID_PREFIX".xpbproxy";
static const char *app_prefs_domain = BUNDLE_ID_PREFIX".xpbproxy";
CFStringRef app_prefs_domain_cfstr;
/* Stubs */

View File

@ -477,7 +477,7 @@ xprInit(ScreenPtr pScreen)
assert((window_hash = x_hash_table_new(NULL, NULL, NULL, NULL)));
#ifdef HAVE_LIBDISPATCH
assert((window_hash_serial_q = dispatch_queue_create(LAUNCHD_ID_PREFIX".X11.xpr_window_hash", NULL)));
assert((window_hash_serial_q = dispatch_queue_create(BUNDLE_ID_PREFIX".X11.xpr_window_hash", NULL)));
#else
assert(0 == pthread_mutex_init(&window_hash_mutex, NULL));
#endif

View File

@ -124,8 +124,8 @@
/* Support application updating through sparkle. */
#undef XQUARTZ_SPARKLE
/* Prefix to use for launchd identifiers */
#undef LAUNCHD_ID_PREFIX
/* Prefix to use for bundle identifiers */
#undef BUNDLE_ID_PREFIX
/* Build a standalone xpbproxy */
#undef STANDALONE_XPBPROXY

View File

@ -24,7 +24,7 @@ MAN_SUBSTS += -e 's|__logdir__|$(logdir)|g' \
-e 's|__sysconfdir__|$(sysconfdir)|g' \
-e 's|__xconfigdir__|$(__XCONFIGDIR__)|g' \
-e 's|__xkbdir__|$(XKB_BASE_DIRECTORY)|g' \
-e 's|__laucnd_id_prefix__|$(LAUNCHD_ID_PREFIX)|g' \
-e 's|__laucnd_id_prefix__|$(BUNDLE_ID_PREFIX)|g' \
-e 's|__modulepath__|$(DEFAULT_MODULE_PATH)|g' \
-e 's|__default_font_path__|$(COMPILEDDEFAULTFONTPATH)|g' \
-e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'