From 776d4d6587c57f94bca8732f915d07a0d4e137c8 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Mon, 26 Feb 2007 23:40:00 -0800 Subject: [PATCH] X11.app now builds correctly --- hw/darwin/Makefile.am | 5 +++-- hw/darwin/quartz/quartzStartup.c | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 3133eaac1..22b396e7e 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -37,7 +37,7 @@ Xquartz_SOURCES = \ $(top_srcdir)/Xi/stubs.c \ apple/X11Application.m \ apple/X11Controller.m \ - quartz/XServer.m \ + quartz/Xserver.m \ quartz/Preferences.m \ quartz/applewm.c \ quartz/keysym2ucs.c \ @@ -90,6 +90,7 @@ XDarwin_LDADD = \ Xquartz_LDADD = \ $(top_builddir)/dix/dixfonts.lo \ $(top_builddir)/dix/libdix.la \ + $(top_builddir)/config/libconfig.a \ $(top_builddir)/os/libos.la \ ./libdarwinShared.a \ $(top_builddir)/dix/libxpstubs.la \ @@ -122,7 +123,7 @@ Xquartz_LDFLAGS = \ -XCClinker -Objc \ -Wl,-u,_miDCInitialize \ -Wl,-framework,Carbon \ - -Wl,-framework,ApplicationServices \ + -Wl,-framework,OpenGL \ -Wl,-framework,Cocoa \ -Wl,-framework,CoreAudio \ -Wl,-framework,IOKit diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c index ae156f8f0..76392e44c 100644 --- a/hw/darwin/quartz/quartzStartup.c +++ b/hw/darwin/quartz/quartzStartup.c @@ -42,10 +42,12 @@ char **envpGlobal; // argcGlobal and argvGlobal // are from dix/globals.c -#ifdef INX11APP +#ifdef INXQUARTZ void X11ControllerMain(int argc, char *argv[], void (*server_thread) (void *), void *server_arg); +# ifdef GLXEXT void GlxExtensionInit(void); void GlxWrapInitVisuals(miInitVisualsProcPtr *); +# endif static void server_thread (void *arg) { extern int main (int argc, char **argv, char **envp); @@ -53,19 +55,18 @@ static void server_thread (void *arg) { } #else int NSApplicationMain(int argc, char *argv[]); +typedef Bool (*QuartzModeBundleInitPtr)(void); +# ifdef GLXEXT // GLX bundle function pointers typedef void (*GlxExtensionInitPtr)(void); static GlxExtensionInitPtr GlxExtensionInit = NULL; - typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *); static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL; - -typedef Bool (*QuartzModeBundleInitPtr)(void); - void * __DarwinglXMesaProvider = NULL; typedef void (*GlxPushProviderPtr)(void *); GlxPushProviderPtr GlxPushProvider = NULL; +# endif #endif /* @@ -123,7 +124,7 @@ void DarwinHandleGUI( } } -#ifdef INX11APP +#ifdef INXQUARTZ /* Initially I ran the X server on the main thread, and received events on the second thread. But now we may be using Carbon, that needs to run on the main thread. (Otherwise, when it's @@ -143,7 +144,7 @@ void DarwinHandleGUI( exit(main_exit); } -#ifndef INX11APP +#ifndef INXQUARTZ /* * QuartzLoadDisplayBundle * Try to load the appropriate bundle containing the back end display code. @@ -201,7 +202,7 @@ Bool QuartzLoadDisplayBundle( return TRUE; } - +#ifdef GLXEXT /* * LoadGlxBundle * The Quartz mode X server needs to dynamically load the appropriate @@ -268,7 +269,7 @@ static void LoadGlxBundle(void) CFRelease(bundleName); CFRelease(bundleURL); } - +# endif #else Bool QuartzLoadDisplayBundle(const char *dpyBundleName) @@ -278,9 +279,10 @@ Bool QuartzLoadDisplayBundle(const char *dpyBundleName) #endif +#ifdef GLXEXT void DarwinGlxPushProvider(void *impl) { -#ifndef INX11APP +#ifndef INXQUARTZ if (!GlxExtensionInit) LoadGlxBundle(); #endif @@ -294,7 +296,7 @@ void DarwinGlxPushProvider(void *impl) */ void DarwinGlxExtensionInit(void) { -#ifndef INX11APP +#ifndef INXQUARTZ if (!GlxExtensionInit) LoadGlxBundle(); #endif @@ -308,13 +310,13 @@ void DarwinGlxExtensionInit(void) void DarwinGlxWrapInitVisuals( miInitVisualsProcPtr *procPtr) { -#ifndef INX11APP +#ifndef INXQUARTZ if (!GlxWrapInitVisuals) LoadGlxBundle(); #endif GlxWrapInitVisuals(procPtr); } - +#endif int DarwinModeProcessArgument( int argc, char *argv[], int i ) {