• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
X11 source code: structure, building
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X11 source code: structure, building


  • Subject: X11 source code: structure, building
  • From: Ben Byer <email@hidden>
  • Date: Tue, 06 Nov 2007 03:44:48 -0800

History (XFree86 on Tiger):
The X11.app that shipped with Tiger was based off of the "monolithic" XFree86 codebase.
Source: http://www.opensource.apple.com/darwinsource/Current/X11-0.46.4/
The README for that source code (which doesn't seem to be up there on DarwinSource) states:


	This is a modified version of the XonX / XDarwin rootless X11
	environment for OS X.

	The rootless X server was derived from the HEAD of cvs.xfree86.org as
	of 2002-10-08. The rest of the tree is currently from the XFree86 4.3.0
	release.

4.3.0 release: http://ftp.xfree86.org/pub/XFree86/4.3.0/source/

I point these sources out mostly for anyone who wants to see what changes Apple made to the open-source codebase to make it into X11.app. Look in xc/programs/Xserver/hw/apple.

The monolithic codebase had the advantage of being one big blob of code -- 30,000 files in one big directory structure, which includes the X server, libraries (including Mesa), apps (xterm, etc), fonts, etc. There's one "build.sh" in the root directory which you can run to build the whole thing -- be prepared to leave it running for an hour or two. It uses Imake to generate makefiles, which works well enough for X11 but it's essentially a dead system, having been replaced by the GNU automake/autoconf system. (./configure, etc)

X.org codebase on Leopard:
X11.app on Leopard is based on the "modular" X.org codebase. The server is based on X11R7.2 (server-1.2); many other modules are newer versions, when possible. Such is the luxury of a modular codebase!


The downside of this modularity is that we built the X11 subsystem on 10.5 out of (IIRC) about 230 individual modules. For most of that, we maintained a tarball downloaded from x.org and a set of patches to apply against it, as well as any configure flags needed to build.
For the sake of manageability, I split the packages up into six "projects":
http://www.opensource.apple.com/darwinsource/10.5/X11apps-13/
http://www.opensource.apple.com/darwinsource/10.5/X11fonts-5/
http://www.opensource.apple.com/darwinsource/10.5/X11libs-16/
http://www.opensource.apple.com/darwinsource/10.5/X11misc-6/
http://www.opensource.apple.com/darwinsource/10.5/X11proto-14/
http://www.opensource.apple.com/darwinsource/10.5/X11server-46/


Each of those projects has a perl script called "build" that performs impedance matching between XBS, Apple's proprietary build system and the GNU autoconf system. The script unpacks each tarball, applies patches, and builds it using the appropriate configure flags. Looking at those directories, I guess you see the result of the unpacking; if anyone needs to see the actual patch, email me and I can send you that file. Or, if possible, download the latest version of the module from ftp://ftp.x.org/pub/individual; in most cases, I have been able to submit all necessary patches back upstream to be incorporated in those releases. In most cases, you can just unpack the tarball and run "./configure --prefix=/usr/X11; make; sudo make install" and expect it to work correctly.

I'm happy to help with any compilation problems here; I do not recommend trying to build all of the packages. The perl scripts will probably require some modification to work, and it will take a couple of hours to build. In contrast, it's fairly easy to build individual modules. So, if you'd like to test some modifications to an individual part, just rebuild it and install it over your existing / usr/X11 (after making a backup, of course).

The X server is special -- it required so many changes that I gave up on maintaining a patchset about a year ago! In principle, I made it by taking the X.org server-1.2 release and applying patches from Peter O'Gorman (to make it build on OS X) and Torrey Lyons (to make it build Xquartz in addition to XDarwin; he had been maintaining those patches against XFree86 for some time, but XFree86 showed no interest in incorporating them.)

I think my first public announcement of this was back in March: http://www.spinics.net/lists/xorg/msg22075.html

Making Torrey's patches apply took some effort, and his patches were based on an oldish version of Apple's code, so I also had to diff Apple's latest Tiger code against XFree86, looking for changes that I then needed to merge into X.org.

The goal, all this time, has been to make building the X server on OS X as easy as building the individual libraries. After we took in server-1.2, many (good!) architectural changes were made in the X server, which prevented us from merging in those changes; it took me several weeks just to get the mouse and keyboard working at all! I did eventually make those changes, and you can actually download the latest code from http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=shortlog;h=master and build it easily, but it's unstable.

Therefore, I made the branch at http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=shortlog;h=xorg-server-1.2-apple
by branching off of xorg-server-1.2 and applying the differences between Apple's 7.2 code and the normal 7.2 tarball. I then made changes to make it easier to build as a standalone unit (for example, I changed many defaults in the configure script so that you would need fewer arguments to configure to make it build).


The X server is a whole lot of code, but most of the code that is specific to OS X is confined to two directory trees:
hw/darwin
miext/rootless


If anyone is still reading at this point, I'd be happy to answer any questions.
--
Ben Byer
CoreOS / BSD Technology Group, XDarwin maintainer


_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)
This email sent to email@hidden


  • Follow-Ups:
    • Re: X11 source code: structure, building
      • From: Bill Janssen <email@hidden>
    • Re: X11 source code: structure, building
      • From: "Nathaniel Gray" <email@hidden>
  • Prev by Date: X11 and the accessibility API
  • Next by Date: Re: X11 and the accessibility API
  • Previous by thread: Re: X11 and the accessibility API
  • Next by thread: Re: X11 source code: structure, building
  • Index(es):
    • Date
    • Thread