<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Building XFree86 From a Source Distribution</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="BUILD.html"><EM>Building XFree86</EM></A>
 <b>:</b> <EM>Building XFree86 From a Source Distribution</EM><BR>
<b>Previous:</b> <A HREF="BUILD.html"><EM>Building XFree86</EM></A><BR>
<b>Next:</b> <A HREF="BUILD2.html"><EM>Reconfiguring the server (source distribution)</EM></A>


<HR NOSHADE>
  <H2><A NAME="1"></A>1. Building XFree86 From a Source Distribution</H2>
<p>
<blockquote>
<b>NOTE:</b>  Refer to the appropriate OS-specific README file before attempting
to build XFree86.  These files contain additional information that 
you may need to successfully build under your OS.
</blockquote>
</p>

<p>We highly recommend using GCC-2 to build XFree86.
GCC-2 is available from prep.ai.mit.edu
and other sites archiving GNU source.
Note that both gcc-2.8.0 and egcs have been proven to break the code
multiple times.  Especially egcs seems to fail in several modules when
optimizing.</p>

<H3><A NAME="2"></A>1.1. How to get the XFree86 3.3.4 source</H3>
<p>There are a few starting points for getting the XFree86 source.  One option
is to start directly with the XFree86 3.3.4 source distribution.  In this
case, the procedure is as follows:
<ul>
<li>The XFree86 3.3.4 source is contained in files <code>X334src-1.tgz</code>,
<code>X334src-2.tgz</code> and <code>X334src-3.tgz</code>.  These can be found
at <A href="ftp://ftp.xfree86.org/pub/XFree86/3.3.4/source/">ftp://ftp.xfree86.org/pub/XFree86/3.3.4/source/</A> and similar
locations on XFree86 mirror sites.  <code>X334src-2.tgz</code> contains
the fonts and documentation source.  <code>X334src-3.tgz</code> contains
the hardcopy documentation.  <code>X334src-1.tgz</code> contains
everything else.  If you don't need the docs or fonts you can get
by with only <code>X334src-1.tgz</code>.</li>
<li>Extract each of these files by running the following from a directory
on a filesystem containing enough space (the full source requires
around 140MB, and a similar amount is required in addition to this
for the compiled binaries):
<blockquote>
<pre>
	gzip -d &lt; X334src-1.tgz | tar vxf -
	gzip -d &lt; X334src-2.tgz | tar vxf -
	gzip -d &lt; X334src-3.tgz | tar vxf -
	
</pre>
</blockquote>
</li>
</ul>
</p>
<p>Another option is to start with the X11R6.3 source distribution and patch
it up to XFree86 3.3.3 and then patch that to XFree86 3.3.4 (see below).  
In this case you need to do the following:
<ul>
<li>Start with the X Consortium's X11R6.3 distribution with public
patches 1 and 2 (but not 3) applied.  This can be obtained by
following the links
from the <A href="http://www.opengroup.org/tech/desktop/x/">The Open Group's X home page</A>.</li>
<li>Get the files <code>R6.3pl2-3.3.3.diff1.gz</code>,
<code>R6.3pl2-3.3.3.diff2.gz</code>, <code>R6.3pl2-3.3.3.diff3.gz</code>,
and <code>R6.3pl2-3.3.3.diff4.gz</code>
from <A href="ftp://ftp.xfree86.org/pub/XFree86/3.3.3/patches/">ftp://ftp.xfree86.org/pub/XFree86/3.3.3/patches/</A> (or a similar
location on mirror sites).  To upgrade the source to XFree86 3.3.3,
run the following from directory containing the <code>xc</code>
directory of the X11R6.3 pl2 source tree:
<blockquote>
<pre>
	gzip -d &lt; R6.3pl2-3.3.3.diff1.gz | patch -p0 -E
	gzip -d &lt; R6.3pl2-3.3.3.diff2.gz | patch -p0 -E
	gzip -d &lt; R6.3pl2-3.3.3.diff3.gz | patch -p0 -E
	gzip -d &lt; R6.3pl2-3.3.3.diff4.gz | patch -p0 -E
	
</pre>
</blockquote>

Be sure to do this with a clean unmodified source tree.  If you
don't some patches may fail.</li>
</ul>
</p>
<p>A further option is to start with the XFree86 3.3.3 source, and patch
it up to XFree86 3.3.4.  In this case you need to do the following:
<ul>
<li>If using this option, you would already have the XFree86 3.3.3
source.  If you have applied any of the public patches to 3.3.3,
back them out before starting the upgrade to 3.3.4.</li>
<li>Get the file <code>3.3.3-3.3.4.diff.gz</code>
from <A href="ftp://ftp.xfree86.org/pub/XFree86/3.3.4/patches/">ftp://ftp.xfree86.org/pub/XFree86/3.3.4/patches/</A> (or a similar
location on mirror sites).  To upgrade the source to XFree86 3.3.4,
run the following from directory containing the <code>xc</code>
directory of the XFree86 3.3.3 source tree:
<blockquote>
<pre>
	gzip -d &lt; 3.3.3-3.3.4.diff.gz | patch -p0 -E
	
</pre>
</blockquote>

Be sure to do this with a clean unmodified source tree.  If you
don't some patches may fail.</li>
</ul>
</p>
<p>If you only want to build the XFree86 X servers, you can use a cut-down
version of the XFree86 source tree called the ``servers only'' distribution.
If you choose this option, do the following:
<ul>
<li>Get the <code>X334servonly.tgz</code> file from
<A href="ftp://ftp.xfree86.org/pub/XFree86/3.3.4/source/">ftp://ftp.xfree86.org/pub/XFree86/3.3.4/source/</A> (or a similar
locations on mirror sites.</li>
<li>Extract this by running the following:
<blockquote>
<pre>
	gzip -d &lt; X334servonly.tgz | tar vxf -
	
</pre>
</blockquote>
</li>
</ul>
</p>
<p>XFree86 supports a small subset of the X Consortium X11R6.1 contrib
distribution.  If you wish to build this, you will need at least the
following files/directories from that distribution:
<blockquote><code>
<pre>
	contrib/Imakefile
	contrib/programs/Imakefile
	contrib/programs/ico
	contrib/programs/listres
	contrib/programs/showfont
	contrib/programs/viewres
	contrib/programs/xbiff
	contrib/programs/xcalc
	contrib/programs/xditview
	contrib/programs/xedit
	contrib/programs/xev
	contrib/programs/xeyes
	contrib/programs/xfontsel
	contrib/programs/xgc
	contrib/programs/xload
	contrib/programs/xman
	contrib/programs/xmessage
</pre>
</code></blockquote>

You will also need the XFree86 patch <code>contrib-3.3.3.diff.gz</code>.  To
apply the patch, run the following from the directory containing the
<code>contrib</code> directory:
<blockquote><code>
<pre>
	gzip -d &lt; contrib-3.3.3.diff.gz | patch -p0 -E
</pre>
</code></blockquote>

Alternatively, you can just get the file <code>X333contrib.tgz</code> from
the XFree86 source directory, and extract it by running:
<blockquote><code>
<pre>
	gzip -d &lt; X333contrib.tgz | tar vxf -
</pre>
</code></blockquote>
</p>
<p>If you wish to build the xtest distribution, get the source distribution
<code>X33test.tgz</code> from the XFree86 source directory, and extract it
by running:
<blockquote><code>
<pre>
	gzip -d &lt; X33test.tgz | tar vxf -
</pre>
</code></blockquote>

Note, xtest is no longer part of the core X11 distribution (since X11R6.3).</p>

<H3><A NAME="3"></A>1.2. Configuring the source before building</H3>
<p>It is recommended that you start the configuration process by going to the
<code>xc/config/cf</code> directory, and copying the file <code>xf86site.def</code>
to <code>host.def</code>.  Then read through the <code>host.def</code> file
(which is heavily commented), and set any parameters that you want for
your configuration.  You can usually find out what the default settings
are by checking the <code>.cf</code> file(s) relevant to your OS.</p>
<p>Unlike previous versions, imake can now automatically detect and set
the various <b>OS*Version</b> parameters, so you shouldn't need to
enter those settings explicitly.</p>
<p>If you are using just the <code>X334src-1.tgz</code> part of the source dist,
you will need to define <b>BuildFonts</b> to <b>NO</b>.</p>
<p>If you are using the ``servers only'' distribution, you will need to
define <b>BuildServersOnly</b> to <b>YES</b>.</p>

<H3><A NAME="4"></A>1.3. Building and installing the distribution</H3>
<p>Before building the distribution, read through the OS-specific <code>README</code>
file in <code>xc/programs/Xserver/hw/xfree86/doc</code> that is relevant to
you.  Once those OS-specific details have been taken care of, go the
<code>xc</code> directory and run ``<code>make World</code>'' with the <b>BOOTSTRAPCFLAGS</b>
set as described in the OS-specific README (if necessary).  It is
advisable to redirect stdout and stderr to <code>World.Log</code> so that you
can track down problems that might occur during the build.</p>
<p>When the build is finished, you should check <code>World.Log</code> to see
if there were any problems.  If there weren't any then you can install
the binaries.  When using the full source distribution, the installation
should be done from the <code>xc</code> directory.  When using the ``servers only''
distribution, the install should be done from the
<code>xc/programs/Xserver</code> directory.
To do
the install, run ``<code>make
install</code>'' and ``<code>make install.man</code>''.  Make sure you have enough
space in <code>/usr/X11R6</code> for the install to succeed.  If you want
to install on a filesystem other than <code>/usr</code>, make a symbolic
link to <code>/usr/X11R6</code> before installing.</p>
<p>To install the binary LinkKit (in <code>/usr/X11R6/lib/Server</code>),
run ``<code>make install.linkkit</code>'' from the <code>xc</code> directory.</p>
<p>To build the subset of the contrib release supported by
XFree86, make sure that you have first built and installed the core
distribution.  Then go to the <code>contrib</code> directory and run
``<code>xmkmf -a; make</code>''.  When that is completed, run
``<code>make install</code>'' and ``<code>make install.man</code>'' to install it.</p>
<p>To build/run the xtest distribution, refer to the instructions in
the file <code>test/xsuite/NOTES.xf86</code>.</p>

 <HR NOSHADE>
<A HREF="BUILD.html"><EM>Building XFree86</EM></A>
 <b>:</b> <EM>Building XFree86 From a Source Distribution</EM><BR>
<b>Previous:</b> <A HREF="BUILD.html"><EM>Building XFree86</EM></A><BR>
<b>Next:</b> <A HREF="BUILD2.html"><EM>Reconfiguring the server (source distribution)</EM></A>



</BODY>
</HTML>
