Subject: porting XF3 servers to XF4
To: None <>
From: matthew green <>
List: tech-x11
Date: 12/28/2003 17:09:32
hi folks.

it seems pretty easy to port XF3 servers to XF4.  i ported Xmacppc
and the biggest problem was dealing with the fact that in XF4 much
of the Xserver is built with more options.. this won't be the case
for most platforms remaining.  i've also got Xmacppc building in
src/x11/Xserver (cross)...

the steps i recommend are:

	- copy the XF3 xc/programs/Xserver/hw/netbsd/<foo> directory
	to the XF4 tree.

	- find the relevant parts of xc/prgrams/Xserver/Imakefile for
	this Xserver (most platforms should have a single patch that
	can be moved across) and apply it to the XF4 tree.

	- find the relevant "XfooServer" part of xc/config/cf/
	and apply those to the XF4 tree.

	- you probably need to add the "DDXDIR" for this platform to the
	"DDXDIRS" variable at the bottom (for Xmacppc, i renamed the
	variable from "DDXDIR1" to "MACPPCDDXDIR".)

	- try a build.. this is where i got massive link failures...
	hopefully these are the parts i meantioned above won't happen
	for the rest of the hw/netbsd servers.

after a bit of lossage trying to make it work natively, and my mac
hanging, i added support for hw/netbsd/macppc and Xserver/Xmacppc
to src/x11/Xserver and made it build there first.  i later got it
working natively as well.

some quick background about how Xserver builds, and some of my tips
on making it suck less when doing it:

	- the toplevel programs/Xserver/Imakefile contains the segments
	to link all the Xservers that are supported.

	- all of the objects and libraries used are built in subdirs
	(or some are linked from lib/*)

	- when changing the "hw/netbsd/foo/Imakefile", you can just
	run "make Makefiles" in programs/Xserver directly. [*]

	- when changing the programs/Xserver/Imakefile, you need to
	run "make Makefiles" in programs. [*]

	- it actually took me much less time to make it build with the
	reach-over src/x11 framework than native, but this is probably
	not going to be common.

	- individual Xserver programs are built in their own subdir
	in src/x11/Xserver/Xserver, unlike native builds.

[*] you can of course call imake directly, but figuring out the options
has never been a fun thing for me.  it may be useful on slow machines

we need people to look at porting these hw/netbsd servers:

	alpha amiga arm32vidc dec dreamcast hpc mac68k pmax vax x68k

though i'm told there is some colour mac68k server that isn't part
of the above...