(file) Return to BUILD.txt CVS log (file) (dir) Up to [XFree86 CVS] / xc

  1 dawes 1.1                 Building XFree86® from a Source Distribution
  2           
  3                                    David Dawes, Matthieu Herrb
  4           
  5 dawes 1.2                                 16 March 2005
  6 dawes 1.1 
  7                                             Abstract
  8           
  9                 This document describes how to build XFree86 from the source dis-
 10                tribution and is designed to be used in conjunction with the oper-
 11                ating system (OS) specific README files.
 12           
 13 dawes 1.2      NOTE: Refer to the appropriate OS-specific README file before
 14 dawes 1.1      attempting to build XFree86.  These files often contain additional
 15                information that you need to successfully build for your OS.
 16           
 17 dawes 1.2 We recommend using gcc to build XFree86, but XFree86 generally builds with
 18           the native compiler for each OS platform.
 19 dawes 1.1 
 20 dawes 1.2 1.  How to get the XFree86 4.5.0 source
 21 dawes 1.1 
 22 dawes 1.2 The recommended way of getting the XFree86 4.5.0 source is to obtain it
 23 dawes 1.1 directly from the XFree86 CVS repository.  There are several ways of doing
 24           that, and they are described at our CVS web page
 25 dawes 1.2 <URL:http://www.xfree86.org/cvs/>.
 26 dawes 1.1 
 27 dawes 1.2 The CVS tag for this release is "xf-4_5_0".  The tag for the maintenance
 28           branch for this release is "xf-4_5-branch".
 29 dawes 1.1 
 30 dawes 1.2 Another method of getting the XFree86 4.5.0 source is to either download the
 31           4.5.0 source tarballs from the XFree86 ftp site.  The procedure for this is
 32           as follows:
 33 dawes 1.1 
 34 dawes 1.2    o The XFree86 4.5.0 source is contained in the files:
 35           
 36                     XFree86-4.5.0-src-1.tgz
 37           
 38                     XFree86-4.5.0-src-2.tgz
 39           
 40                     XFree86-4.5.0-src-3.tgz
 41           
 42                     XFree86-4.5.0-src-4.tgz
 43           
 44                     XFree86-4.5.0-src-5.tgz
 45           
 46                     XFree86-4.5.0-src-6.tgz
 47           
 48                     XFree86-4.5.0-src-7.tgz
 49           
 50                These can be found at ftp://ftp.xfree86.org/pub/XFree86/4.5.0/source/
 51                and similar locations on XFree86 mirror sites.  XFree86-4.5.0-src-4.tgz
 52                and XFree86-4.5.0-src-5.tgz contains the fonts.  XFree86-4.5.0-src-6.tgz
 53                contains the documentation source.  XFree86-4.5.0-src-7.tgz contains the
 54                hardcopy documentation.  XFree86-4.5.0-src-1.tgz,
 55 dawes 1.2      XFree86-4.5.0-src-2.tgz and XFree86-4.5.0-src-3.tgz contains everything
 56                else.
 57           
 58                If you do not need either the documentation or the fonts, then you need
 59                only XFree86-4.5.0-src-1.tgz, XFree86-4.5.0-src-2.tgz and
 60                XFree86-4.5.0-src-3.tgz.
 61           
 62              o Extract each of these files by running the following from a directory on
 63                a filesystem containing enough space (the full source requires around
 64                270MB, with a similar amount being required for the compiled binaries):
 65           
 66                     gzip -d < XFree86-4.5.0-src-1.tgz | tar vxf -
 67           
 68                     gzip -d < XFree86-4.5.0-src-2.tgz | tar vxf -
 69           
 70                     gzip -d < XFree86-4.5.0-src-3.tgz | tar vxf -
 71           
 72                     gzip -d < XFree86-4.5.0-src-4.tgz | tar vxf -
 73           
 74                     gzip -d < XFree86-4.5.0-src-5.tgz | tar vxf -
 75           
 76 dawes 1.2           gzip -d < XFree86-4.5.0-src-6.tgz | tar vxf -
 77           
 78                     gzip -d < XFree86-4.5.0-src-7.tgz | tar vxf -
 79           
 80           Alternatively, if you already have a pristine copy of the XFree86 4.4.0
 81           source, you can download patches from
 82           ftp://ftp.xfree86.org/pub/XFree86/4.5.0/patches/ that will allow you to con-
 83           vert it to 4.5.0.  Information about which patch files to download and how to
 84           apply them can be found in the "How to get XFree86" section of the README for
 85           this release.
 86           
 87           Each of the methods outlined above will produce one main source directory
 88           called xc.
 89 dawes 1.1 
 90           2.  Configuring the source before building
 91           
 92 dawes 1.2 In most cases it should not be necessary to configure anything before build-
 93 dawes 1.1 ing.
 94           
 95 dawes 1.2 If you do want to make configuration changes, you should start by going to
 96           the xc/config/cf directory, and copying the file xf86site.def to host.def.
 97           After that, read thoroughly the the host.def file, which is heavily com-
 98           mented, and set your configuration parameters. Usually you can find the
 99           default settings by checking the .cf file(s) relevant to your OS.
100           
101           A good rule of thumb is to only change that you understand, as it is very
102           easy to create build problems by changing the default configuration unneces-
103           sarily.  Before making too many modifications, check the configuration param-
104           eters specified in the xc/config/cf/README file.
105           
106           If you are using just the XFree86-4.5.0-src-1.tgz, XFree86-4.5.0-src-2.tgz
107           and XFree86-4.5.0-src-3.tgz parts of the source dist, you will need to define
108           BuildFonts to NO.
109 dawes 1.1 
110           3.  Using a shadow directory of symbolic links for the build
111           
112 dawes 1.2 We recommend that you use a shadow directory of symbolic links to do the
113           build of XFree86, because it allows you to keep the source directory unmodi-
114           fied during the build process.  It has the following benefits:
115           
116              o Foreign files not under CVS's control are not touched.
117           
118              o Greater flexibility in building XFree86 for several different Operating
119                Systems or hardware architectures from the same sources; shared by read-
120                only NFS mounts.
121           
122              o Different configuration options can be created by putting a real copy of
123                the host.def file in each build tree and by customizing it separately in
124                each build tree, and then customizing it separately.
125 dawes 1.1 
126           To make a shadow directory of symbolic links, use the following steps:
127           
128 dawes 1.2    o create the directory at the top of the build tree. This is often created
129                at the same level that the xc directory.
130 dawes 1.1 
131 dawes 1.2           cd the directory containing the xc directory
132 dawes 1.1 
133                     mkdir build
134           
135              o use the "lndir" command to make the shadow tree:
136           
137                     cd build
138           
139                     lndir ../xc
140           
141 dawes 1.2      Note: You can refer to the xc directory by referencing it with an abso-
142                lute path also.
143 dawes 1.1 
144                See the lndir(1) manual page for details.
145           
146 dawes 1.2 If the lndir command is not already available on your system, you can build
147           it manually from the XFree86 sources by running the following commands:
148 dawes 1.1 
149                cd xc/config/util
150           
151                make -f Makefile.ini lndir
152           
153                cp lndir some directory in your PATH
154           
155 dawes 1.2 Occasionally there may be stale links in the build tree.  This happens when
156           files in the source tree are either removed or renamed.  These stale links
157           can be cleaned by running the "cleanlinks" script from the build directory
158           (see the cleanlinks(1) manual page for further details).
159           
160           Rarely will there be changes that require the build tree to be re-created
161           from scratch.  If you think that this may be the case, look for build prob-
162           lems, which could indicate that this is the problem.  The best solution in
163           this scenario is to remove the build tree,and then re-create it using the
164           steps outlined above.
165 dawes 1.1 
166           4.  Building and installing the distribution
167           
168 dawes 1.2 Before building the distribution, read through your  OS-specific documenta-
169           tion in README file in xc/programs/Xserver/hw/xfree86/doc.  After that go to
170           your build directory  which will either be the xc directory or the shadow
171           tree which was create previously, and run "make World".
172           
173           It is also advisable to that you redirect standard output stdout and standard
174           error output stderr to World.Log,  so that you can track down problems that
175           might occur during the build.
176 dawes 1.1 
177 dawes 1.2 With Bourne-like shells (examples include the Bash, the Korn, and zsh shells)
178           use the following command:
179 dawes 1.1 
180                make World > World.log 2>&1
181           
182 dawes 1.2 for C-shell variants (csh, tcsh, etc), use:
183 dawes 1.1 
184                make World >& World.log
185           
186 dawes 1.2 You can then follow the progress of the build by running:
187 dawes 1.1 
188                tail -f World.log
189           
190 dawes 1.2 in a terminal window.
191 dawes 1.1 
192           When the build is finished, you should check the World.Log file to see if
193 dawes 1.2 there were any problems.  If there were not, then install the binaries.  By
194           default "make World" stops when the first error is found.  To restart that
195           same build process after correcting the various problems, run just 'make'.
196           
197           If Imakefiles or part of the build configuration were changed as part of cor-
198           recting the problem, then either re-run "make World", or run "make Every-
199 dawes 1.1 thing".
200           
201 dawes 1.2 If instead, you want "make World" to continue past errors, then instead exe-
202           cute it as follows:
203 dawes 1.1 
204           for Bourne-like shells:
205           
206                make WORLDOPTS=-k World > World.log 2>&1
207           
208           for C-shell variants:
209           
210                make WORLDOPTS=-k World >& World.log
211           
212 dawes 1.2 For installation, run "make install" and "make install.man" and ensure that
213           there is enough space in the /usr/X11R6 directory.
214           
215           If instead you want to install XFree86 on a filesystem other than /usr, make
216           a symbolic link to /usr/X11R6 before running the install process.
217 dawes 1.1 
218 dawes 1.2 5.  Reconfiguring the server (using the source distribution)
219 dawes 1.1 
220 dawes 1.2 If you would like to build several different sets of servers or server(s)
221           with a various sets of drivers then you should follow this procedure:
222 dawes 1.1 
223 dawes 1.2   1.  Ensure that the source for any new drivers is in the correct place
224                 (e.g., all driver source should be in a subdirectory of xc/pro-
225 dawes 1.1       grams/Xserver/hw/xfree86/drivers).
226           
227 dawes 1.2   2.  Change the settings of the server definitions in host.def to specify
228                 which servers you wish to build.  Also, change the driver lists to suit
229                 your needs.
230 dawes 1.1 
231             3.  From xc/programs/Xserver, run:
232           
233                           make Makefile
234                           make Makefiles
235                           make includes
236                           make depend
237                           make
238           
239           6.  Other useful make targets
240           
241           There are some other useful targets defined in the top level Makefile of
242           XFree86:
243           
244 dawes 1.2       Everything
245                       After a make World, make Everything replicates make World except
246                       for the cleaning of the source tree. make Everything very quickly
247                       rebuilds the tree after a source patch, but there are times when
248                       it is better to force a full build by using make World.
249           
250                 clean
251                       This does a partial cleaning of the source tree. Removes object
252                       files and generated manual pages, but leaves the Makefiles and
253                       the generated dependencies files in place. After a make clean you
254                       need to re-run
255           
256                                    make includes
257                                    make depend
258                                    make
259           
260                       to rebuild the XFree86.
261           
262                 distclean
263                       This does a full cleaning of the source tree, removing all gener-
264                       ated files. After a make distclean, make World is the only option
265 dawes 1.2             to rebuild XFree86.
266           
267                 includes
268                       This generates all generated header files and in-tree symbolic
269                       links  needed by the build. These files are removed by a make
270                       clean.
271           
272                 depend
273                       This recomputes the dependencies for the various targets in all
274                       Makefiles. Depending on the operating system, the dependencies
275                       are stored in the Makefile, or as a separate file, called
276                       .depend. This target needs the generated include files produced
277                       by make includes.
278           
279                 VerifyOS
280                       This displays the detected operating system version. If the num-
281                       bers shown do not match your system, you probably need to set
282                       them manually in host.def and report the problem to
283                       <XFree86@XFree86.org>.
284 dawes 1.1 
285 dawes 1.2      Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/BUILD.sgml,v 3.19 dawes Exp $
286 dawes 1.1 
287           
288 dawes 1.2 $XFree86$

Powered by
ViewCVS 0.9.2