Skip to content

Commit

Permalink
Build system patches to remove XDarwin from the build (since it doesn't
Browse files Browse the repository at this point in the history
work anyway), courtesy of Jeremy Huddleston
  • Loading branch information
Ben Byer committed Nov 15, 2007
1 parent 481bca3 commit 64d832f
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 185 deletions.
47 changes: 18 additions & 29 deletions configure.ac
Expand Up @@ -513,9 +513,8 @@ AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no])
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: no)]), [XVFB=$enableval], [XVFB=no])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: no)]), [XNEST=$enableval], [XNEST=no])
AC_ARG_ENABLE(xdarwin, AS_HELP_STRING([--enable-xdarwin], [Build XDarwin server (default: auto)]), [XDARWIN=$enableval], [XDARWIN=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--disable-xquartz], [Build Xquartz server on Darwin (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(x11app, AS_HELP_STRING([--enable-x11app], [Build Apple's X11.app wrapper for Xquartz (default: auto)]), [X11APP=$enableval], [X11APP=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(x11app, AS_HELP_STRING([--enable-x11app], [Build Apple's X11.app for Xquartz (default: auto)]), [X11APP=$enableval], [X11APP=auto])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
AC_ARG_ENABLE(xprint, AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: no)]), [XPRINT=$enableval], [XPRINT=no])
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
Expand Down Expand Up @@ -1604,33 +1603,24 @@ AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])

dnl Darwin / OS X DDX
AC_MSG_CHECKING([whether to build XDarwin/Xquartz])
if test "x$XDARWIN" = xauto; then
case $host_os in
darwin*) XDARWIN="yes" ;;
*) XDARWIN="no" ;;
esac
fi
AC_MSG_RESULT([$XDARWIN])

if test "x$XDARWIN" = xyes; then
if test "X$XQUARTZ" = Xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])

if test "X$xorg_cv_Carbon_framework" = Xyes; then
AC_DEFINE([DARWIN_WITH_QUARTZ],[1],[Have Quartz])
XQUARTZ=yes
else
XQUARTZ=no
fi
if test "X$XQUARTZ" = Xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])

if test "X$xorg_cv_Carbon_framework" = Xyes; then
AC_DEFINE([DARWIN_WITH_QUARTZ],[1],[Have Quartz])
XQUARTZ=yes
else
XQUARTZ=no
fi
fi

if test "x$XQUARTZ" = xyes; then
if test "x$X11APP" = xauto; then
AC_MSG_CHECKING([whether to build X11.app])
if test "x$XQUARTZ" = xyes ; then
Expand Down Expand Up @@ -1694,7 +1684,6 @@ AC_SUBST([OBJCFLAGS])
_AM_DEPENDENCIES([OBJC])
AM_CONDITIONAL(HAVE_XPLUGIN, [test "x$ac_cv_lib_Xplugin_xp_init" = xyes])
AM_CONDITIONAL(HAVE_AGL_FRAMEWORK, [test "x$xorg_cv_AGL_framework" = xyes])
AM_CONDITIONAL(XDARWIN, [test "x$XDARWIN" = xyes])
AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
AM_CONDITIONAL(X11APP,[test "X$X11APP" = Xyes])

Expand Down
2 changes: 1 addition & 1 deletion hw/Makefile.am
Expand Up @@ -22,7 +22,7 @@ if XPRINT
XPRINT_SUBDIRS = xprint
endif

if XDARWIN
if XQUARTZ
DARWIN_SUBDIRS = darwin
endif

Expand Down
148 changes: 30 additions & 118 deletions hw/darwin/Makefile.am
@@ -1,98 +1,27 @@
noinst_LIBRARIES = libdarwinShared.a
libdarwin_XINPUT_SRCS = darwinXinput.c

AM_CFLAGS = @XORG_CFLAGS@
INCLUDES = @XORG_INCS@ -I../../miext/rootless

DEFS = @DEFS@ -DUSE_NEW_CLUT -DXFree86Server -DBUILD_DATE=\"$(BUILD_DATE)\"

if XQUARTZ
XQUARTZ_SUBDIRS = quartz
endif

SUBDIRS = \
iokit \
$(XQUARTZ_SUBDIRS) \
utils

DIST_SUBDIRS = \
iokit \
quartz \
utils

libdarwinShared_a_SOURCES = darwin.c \
darwinEvents.c \
darwinKeyboard.c \
$(darwin_XINPUT_SRCS)

if XQUARTZ
AM_CPPFLAGS = @XORG_INCS@ -I../../miext/rootless -DUSE_NEW_CLUT -DBUILD_DATE=\"$(BUILD_DATE)\" -DHAVE_XORG_CONFIG_H -DXFree86Server

SUBDIRS = quartz utils

bin_PROGRAMS = Xquartz
else
bin_PROGRAMS = XDarwin
endif

XDarwin_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c

Xquartz_SOURCES = \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/mi/miinitext.c \
$(top_srcdir)/Xi/stubs.c \
apple/X11Application.m \
apple/X11Controller.m \
quartz/applewm.c \
quartz/keysym2ucs.c \
quartz/pseudoramiX.c \
quartz/quartz.c \
quartz/quartzAudio.c \
quartz/quartzCocoa.m \
quartz/quartzKeyboard.c \
quartz/quartzPasteboard.c \
quartz/quartzStartup.c \
quartz/xpr/appledri.c \
quartz/xpr/dri.c \
quartz/xpr/xprAppleWM.c \
quartz/xpr/xprCursor.c \
quartz/xpr/xprFrame.c \
quartz/xpr/xprScreen.c \
quartz/xpr/x-hash.c \
quartz/xpr/x-hook.c \
quartz/xpr/x-list.c

XDarwin_LDADD = \
man1_MANS = apple/Xquartz.man

Xquartz_SOURCES = darwin.c \
darwinEvents.c \
darwinKeyboard.c \
darwinXinput.c \
$(top_srcdir)/fb/fbcmap.c \
$(top_srcdir)/mi/miinitext.c

# We should probably add these once they're working, or are these obsolete and to be removed?
# ./quartz/cr/libcr.a
# ./quartz/fullscreen/libfullscreen.a

Xquartz_LDADD = ./quartz/libXquartz.a \
./quartz/xpr/libxpr.a \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/dix/libdix.la \
$(top_builddir)/os/libos.la \
./libdarwinShared.a \
./iokit/libiokit.a \
$(top_builddir)/dix/libxpstubs.la \
$(top_builddir)/miext/shadow/libshadow.la \
$(top_builddir)/fb/libfb.la \
$(top_builddir)/composite/libcomposite.la \
$(top_builddir)/damageext/libdamageext.la \
$(top_builddir)/miext/damage/libdamage.la \
$(top_builddir)/xfixes/libxfixes.la \
$(top_builddir)/miext/cw/libcw.la \
$(top_builddir)/Xext/libXext.la \
$(top_builddir)/xkb/libxkb.la \
$(top_builddir)/xkb/libxkbstubs.la \
$(top_builddir)/Xi/libXi.la \
$(top_builddir)/dbe/libdbe.la \
$(top_builddir)/record/librecord.la \
$(top_builddir)/XTrap/libxtrap.la \
$(XGLX_LIBS) \
$(top_builddir)/miext/rootless/librootless.la \
$(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \
$(top_builddir)/miext/rootless/accel/librlAccel.la \
$(XSERVER_LIBS) -lXplugin

Xquartz_LDADD = \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/dix/libdix.la \
$(top_builddir)/os/libos.la \
./libdarwinShared.a \
$(top_builddir)/dix/libxpstubs.la \
$(top_builddir)/miext/shadow/libshadow.la \
$(top_builddir)/fb/libfb.la \
Expand All @@ -114,33 +43,24 @@ Xquartz_LDADD = \
$(top_builddir)/miext/rootless/accel/librlAccel.la \
$(DARWIN_LIBS) $(XSERVER_LIBS) -lXplugin

XDarwin_LDFLAGS = \
-XCClinker -Objc \
-Wl,-u,_miDCInitialize \
-Wl,-framework,IOKit

Xquartz_LDFLAGS = \
-XCClinker -Objc \
-Wl,-u,_miDCInitialize \
-Wl,-framework,Carbon \
-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
-Wl,-framework,OpenGL \
-Wl,-framework,Cocoa \
-Wl,-framework,CoreAudio \
-Wl,-framework,IOKit

XDarwin_CFLAGS = -DINXDARWIN
Xquartz_CFLAGS = -DINXQUARTZ -DHAS_CG_MACH_PORT -DHAS_KL_API -DHAVE_XORG_CONFIG_H
Xquartz_OBJCFLAGS = -DINXQUARTZ -DHAS_CG_MACH_PORT -DHAS_KL_API -DHAVE_XORG_CONFIG_H
Xquartz_LDFLAGS = -XCClinker -Objc \
-Wl,-u,_miDCInitialize \
-Wl,-framework,Carbon \
-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL \
-Wl,-framework,OpenGL \
-Wl,-framework,Cocoa \
-Wl,-framework,CoreAudio \
-Wl,-framework,IOKit

if X11APP
bin_SCRIPTS = x11app x11launcher

x11app:
cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
cd apple && xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

x11launcher:
cd launcher && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)"
cd launcher && xcodebuild CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

x11app-install:
cd apple && xcodebuild install DSTROOT=$(DESTDIR) INSTALL_PATH=$(prefix) DEPLOYMENT_LOCATION=YES SKIP_INSTALL=NO
Expand All @@ -156,19 +76,12 @@ x11launcher-clean:

install-data-hook: x11app-install x11launcher-install
clean-local: x11app-clean x11launcher-clean

endif

man1_MANS = XDarwin.man

EXTRA_DIST = \
darwin.c \
darwinClut8.h \
darwinEvents.c \
darwin.h \
darwinKeyboard.c \
darwinKeyboard.h \
darwinXinput.c \
apple/X11Application.h \
apple/X11Controller.h \
apple/Info.plist \
Expand All @@ -184,5 +97,4 @@ EXTRA_DIST = \
launcher/bundle-main.c \
launcher/Info.plist \
launcher/X11.icns \
launcher/X11.xcodeproj/project.pbxproj \
XDarwin.man
launcher/X11.xcodeproj/project.pbxproj
27 changes: 8 additions & 19 deletions hw/darwin/quartz/Makefile.am
Expand Up @@ -2,41 +2,30 @@ noinst_LIBRARIES = libXQuartz.a

AM_CFLAGS = @XORG_CFLAGS@
AM_OBJCFLAGS = @XORG_CFLAGS@
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@ -DXBINDIR=\"${bindir}\" -DINXQUARTZ -DHAS_KL_API -DHAVE_XORG_CONFIG_H

INCLUDES = -I$(srcdir) -I$(srcdir)/.. @XORG_INCS@
AM_DEFS = -DHAS_CG_MACH_PORT -DHAS_KL_API
AM_DEFS += -DBUILD_XPR
XPR = xpr

DEFS = @DEFS@ $(AM_DEFS) -DXBINDIR=\"${bindir}\"
SUBDIRS = cr fullscreen $(XPR)
SUBDIRS = cr fullscreen xpr

libXQuartz_a_SOURCES = \
Preferences.m \
XApplication.m \
XServer.m \
../apple/X11Application.m \
../apple/X11Controller.m \
applewm.c \
keysym2ucs.c \
pseudoramiX.c \
quartz.c \
quartzAudio.c \
quartzCocoa.m \
quartzPasteboard.c \
quartzKeyboard.c \
quartzStartup.c \
pseudoramiX.c
quartzPasteboard.c \
quartzStartup.c

EXTRA_DIST = \
applewmExt.h \
keysym2ucs.h \
Preferences.h \
pseudoramiX.h \
quartzAudio.h \
quartzCommon.h \
quartzCursor.c \
quartzCursor.h \
quartz.h \
quartzPasteboard.h \
XApplication.h \
XDarwin.pbproj/project.pbxproj \
XServer.h \
XDarwinStartup.man
quartzPasteboard.h
4 changes: 2 additions & 2 deletions hw/darwin/quartz/cr/Makefile.am
@@ -1,8 +1,8 @@
noinst_LIBRARIES = libcr.a
AM_CFLAGS = @XORG_CFLAGS@
AM_OBJCFLAGS = @XORG_CFLAGS@
DEFS = @DEFS@ -DDEFER_NSWINDOW
INCLUDES = @XORG_INCS@ \
AM_CPPFLAGS = -DDEFER_NSWINDOW \
@XORG_INCS@ \
-I../fullscreen \
-I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../.. \
-I$(top_srcdir)/miext/rootless \
Expand Down
2 changes: 1 addition & 1 deletion hw/darwin/quartz/fullscreen/Makefile.am
@@ -1,6 +1,6 @@
noinst_LIBRARIES = libfullscreen.a
AM_CFLAGS = @XORG_CFLAGS@
INCLUDES = @XORG_INCS@ -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../..
AM_CPPFLAGS = @XORG_INCS@ -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../..

libfullscreen_a_SOURCES = fullscreen.c \
quartzCursor.c
Expand Down
5 changes: 2 additions & 3 deletions hw/darwin/quartz/xpr/Makefile.am
@@ -1,6 +1,7 @@
noinst_LIBRARIES = libxpr.a
AM_CFLAGS = @XORG_CFLAGS@
INCLUDES = @XORG_INCS@ \
AM_CPPFLAGS = @XORG_INCS@ \
-DHAVE_XORG_CONFIG_H \
-I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../.. \
-I$(top_srcdir)/miext/rootless \
-I$(top_srcdir)/miext/rootless/safeAlpha \
Expand All @@ -17,8 +18,6 @@ libxpr_a_SOURCES = \
x-hook.c \
x-list.c

xprbundledir = @APPLE_APPLICATIONS_DIR@/Resources/xpr.bundle/Contents/MacOS

EXTRA_DIST = \
dri.h \
dristruct.h \
Expand Down
12 changes: 0 additions & 12 deletions mi/miinitext.c
Expand Up @@ -338,18 +338,11 @@ extern void XFree86DGAExtensionInit(INITARGS);
#endif
#ifdef GLXEXT
typedef struct __GLXprovider __GLXprovider;
#if defined(__DARWIN__) && defined(INXDARWINAPP)
extern __GLXprovider* __DarwinglXMesaProvider;
extern void DarwinGlxPushProvider(__GLXprovider *impl);
extern void DarwinGlxExtensionInit(INITARGS);
extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *);
#else
extern __GLXprovider __glXMesaProvider;
extern void GlxPushProvider(__GLXprovider *impl);
extern void GlxExtensionInit(INITARGS);
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
#endif
#endif
#ifdef XF86DRI
extern void XFree86DRIExtensionInit(INITARGS);
#endif
Expand Down Expand Up @@ -632,14 +625,9 @@ InitExtensions(argc, argv)
#endif
#endif
#ifdef GLXEXT
#if defined(__DARWIN__) && defined(INXDARWINAPP)
DarwinGlxPushProvider(__DarwinglXMesaProvider);
if (!noGlxExtension) DarwinGlxExtensionInit();
#else
GlxPushProvider(&__glXMesaProvider);
if (!noGlxExtension) GlxExtensionInit();
#endif
#endif
#ifdef XFIXES
/* must be before Render to layer DisplayCursor correctly */
if (!noXFixesExtension) XFixesExtensionInit();
Expand Down

0 comments on commit 64d832f

Please sign in to comment.