10 Building and Installing the X Window System
30 Updated For Release 6.3
41 Copyright c 1995, 1996 X Consortium
43 Permission is hereby granted, free of charge, to any person obtaining a
44 copy of this software and associated documentation files (the
45 "Software"), to deal in the Software without restriction, including
46 without limitation the rights to use, copy, modify, merge, publish, dis-
47 tribute, sublicense, and/or sell copies of the Software, and to permit
48 persons to whom the Software is furnished to do so, subject to the fol-
51 The above copyright notice and this permission notice shall be included
52 in all copies or substantial portions of the Software.
54 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
55 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
56 ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
57 SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
58 ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
62 Except as contained in this notice, the name of the X Consortium shall
63 not be used in advertising or otherwise to promote the sale, use or
64 other dealings in this Software without prior written authorization from
67 X Window System is a trademark of X Consortium, Inc.
70 1. Easy Build Instructions
72 This quick summary is no substitute for reading the full build instruc-
73 tions later in this document.
75 Edit xc/config/cf/site.def for local preferences. If you want to build
76 with gcc uncomment the HasGcc2 line. If you want to install somewhere
77 other than /usr/X11R6.3, change ProjectRoot. (Do not use DESTDIR.)
79 If any fixes have been released by the X Consortium, stop here and fol-
80 low the instructions at the top of each patch, but don't do any of the
81 make commands suggested in the patches. Then continue here.
83 Check the appropriate vendor-specific .cf file in xc/config/cf/ to make
84 sure that OSMajorVersion and OSMinorVersion are set correctly for your
85 system. Override them in site.def if necessary.
87 See if there is a BootstrapCFlags mentioned in the comments in the
88 vendor-specific .cf file. If there isn't one, cd to the xc directory
91 % make World >& world.log
94 If there is a BootstrapCFlags, take its value and type:
96 % make World BOOTSTRAPCFLAGS="value" >& world.log
99 Do not call the output file "make.log" when doing "make World". After a
100 successful build, you can install with:
102 % make install >& install.log
105 You can install manual pages with:
107 % make install.man >& man.log
110 While the system is building (or if things fail), read the rest of these
111 installation instructions.
118 This document gives detailed instructions for building Release 6: get-
119 ting it off the distribution medium, configuring, compiling, installing,
120 running, and updating.
122 Release Notes are in xc/RELNOTES.* (various formats) in the distribu-
125 More recent information about newly-discovered problems may be found in
126 the Frequently Asked Questions posting appearing monthly on the
127 comp.windows.x newsgroup and xpert mailing list. It is also available
128 via anonymous FTP on ftp.x.org in the file contrib/faqs/FAQ.Z, or on
129 your local X mirror site.
132 2.1. Preparing the Site
135 If you are unpacking tar files, you will need about 130 Mb to hold the
136 xc/ part. To install requires 30-50 Mb assuming you have shared
137 libraries (80-100 Mb without). You will need an equivalent amount of
138 extra space to build, since you also need room for all the object files.
140 Distributed as tar files, Release 6.3 core is divided into parts as fol-
144 xc-1.tar contains everything in xc/ that isn't in the other tar files
145 xc-2.tar contains xc/fonts, xc/doc/specs, xc/util
146 xc-3.tar contains xc/doc/hardcopy
149 If you define BuildFonts to NO, you only need to unpack xc-1.tar to
150 build. If you build fonts, then you will also need xc-2.tar to build.
153 2.2. Unpacking the Distribution
156 The distribution normally comes as multiple tar files, either on tape or
157 across a network, or as a CD-ROM.
160 2.2.1. Unpacking a Compressed FTP Distribution
163 If you have obtained compressed tar files over the network, create a
164 directory to hold the sources and cd into it:
169 Then for each tar file xc-*.tar.Z, execute this:
171 zcat ftp-dir/xc-N.tar.Z | tar xf -
175 2.2.2. Unpacking a gzipped FTP Distribution
178 If you have obtained gzipped tar files over the network, create a direc-
179 tory to hold the sources and cd into it:
184 Then for each tar file xc-*.tar.gz, execute this:
186 gunzip -c ftp-dir/xc-N.tar.gz | tar xf -
190 2.2.3. Unpacking a Split Compressed FTP Distribution
193 If you have obtained compressed and split tar files over the network,
194 create a directory to hold the sources:
198 Then for each directory xc-*:
201 cat xc-N.?? | uncompress | (cd sourcedir; tar xf -)
205 2.2.4. Unpacking the Tape Distribution
208 If you have obtained a tape, create a directory to hold the sources and
209 untar everything into that directory:
217 2.2.5. Using the CD-ROM
220 If you have obtained a CD-ROM, you don't have to do anything to unpack
221 it. However, you will have to create a symbolic link tree to build X.
222 See the next section.
224 To mount the CD-ROM, see the mount(8) manual page on your system or the
225 liner notes that came with the CD-ROM. Some systems, e.g., Solaris 2,
226 can automatically mount the CD-ROM for you.
232 If there are fixes released that are more recent than your distribution,
233 apply them now. Follow the instructions at the top of each patch, but
234 don't do any make commands. See the section "Public Patches" later in
235 this document. Then continue here.
238 2.4. Symbolic Link Trees
241 If you expect to build the distribution on more than one machine using a
242 shared source tree, or you are building from CD-ROM, or you just want to
243 keep the source tree pure, you may want to use the program
244 xc/config/util/lndir.c to create a symbolic link tree on each build
245 machine. The links may use an additional 10 megabytes, but it is
246 cheaper than having multiple copies of the source tree.
248 It may be tricky to compile lndir before the distribution is built. If
249 you have a copy from a previous release, use that. Makefile.ini can be
250 used for building lndir the first time. You may have to specify
251 OSFLAGS=-Dsomething to get it to compile. What you would pass as
252 BOOTSTRAPCFLAGS might work. The command line looks something like this:
254 make -f Makefile.ini OSFLAGS=-Dflag
257 To use a symbolic link tree, create a directory for the build, cd to it,
263 where sourcedir is the pathname of the directory where you stored the
264 sources. All of the build instructions given below should then be done
265 in the build directory on each machine, rather than in the source direc-
268 xc/config/util/mkshadow/ contains mkshadow, an alternative program to
272 2.5. Configuration Parameters
275 Build information for each source directory is in files called
276 Imakefile. An Imakefile, along with local configuration information in
277 xc/config/cf/, is used by the program imake to generate a Makefile.
279 Most of the configuration work prior to building the release is to set
280 parameters so that imake will generate correct files. Most of those
281 parameters are set in xc/config/cf/site.def. You will also need to
282 check the appropriate vendor-specific .cf file in xc/config/cf/ to make
283 sure that OSMajorVersion, OSMinorVersion, and OsTeenyVersion are set
284 correctly for your system. Override them in site.def if necessary.
286 The site.def file has two parts, one protected with "#ifdef BeforeVen-
287 dorCF" and one with "#ifdef AfterVendorCF". The file is actually pro-
288 cessed twice, once before the .cf file and once after. About the only
289 thing you need to set in the "before" section is HasGcc2; just about
290 everything else can be set in the "after" section.
292 The sample site.def also has commented out support to include another
293 file, host.def. This scheme may be useful if you want to set most
294 parameters site-wide, but some parameters vary from machine to machine.
295 If you use a symbolic link tree, you can share site.def across all
296 machines, and give each machine its own copy of host.def.
298 The config parameters are listed in xc/config/cf/README, but here are
299 some of the more common parameters that you may wish to set in site.def.
302 The destination where X will be installed. This variable needs to
303 be set before you build, as some programs that read files at run-
304 time have the installation directory compiled in to them. Assuming
305 you have set the variable to some value /path, files will be
306 installed into /path/bin, /path/include/X11, /path/lib, and
309 HasGccSet to YES to build with gcc version 1.
312 Set to YES to build with gcc version 2. Both this option and
313 HasGcc look for a compiler named gcc, but HasGcc2 will cause the
314 build to use more features of gcc 2, such as the ability to compile
318 Set to YES to build the X Input Extension. This extension requires
319 device-dependent support in the X server, which exists only in Xhp
320 in our implementation.
323 Set to NO to not build the PEX server extension and fonts.
326 This is a directory where programs will be found even if PATH is
327 not set in the environment. It is independent of ProjectRoot and
328 defaults to /usr/bin. It is used, for example, when connecting
329 from a remote system via rsh. The rstart program installs its
330 server in this directory.
333 Some systems require the X server to run as root to access the dev-
334 ices it needs. If you are on such a system and will not be using
335 xdm, you can set this variable to YES to install the X server
336 setuid to root. Note that the X server has not been analyzed by
337 the X Consortium for security in such an installation; talk to your
338 system manager before setting this variable.
341 By default set to NO, which suppresses installing xdm config files
342 over existing ones. Leave it set to NO if your site has customized
343 the files in /usr/X11R6.3/lib/X11/xdm, as many sites do. If you
344 don't install the new files, merge any changes present in the new
348 Causes Xlib and Xt to work around some bugs in older versions of
349 Motif. Set to YES only if you will be linking with Motif version
350 1.1.1, 1.1.2, or 1.1.3.
353 Setting this variable to YES allows illegal XtGetValues requests
354 with NULL ArgVal to usually succeed, as R5 did. Some applications
355 erroneously rely on this behavior. Support for this will be
356 removed in a future release.
358 The following vendor-specific .cf files are in the release but have not
359 been tested recently and hence probably need changes to work:
360 apollo.cf, bsd.cf, convex.cf, DGUX.cf, luna.cf, macII.cf, Mips.cf,
361 moto.cf, Oki.cf, pegasus.cf, x386.cf. Amoeba.cf is known to require
364 The file xc/lib/Xdmcp/Wraphelp.c, for XDM-AUTHORIZATION-1, is not
365 included in this release.
368 2.6. System Build Notes
371 This section contains hints on building X with specific compilers and
374 If the build isn't finding things right, make sure you are using a com-
375 piler for your operating system. For example, a pre-compiled gcc for a
376 different OS will not have right symbols defined, so imake will not work
382 gcc version 2 is in regular use at the X Consortium on Sparc platforms.
383 Set the variable HasGcc2. X will not compile on some systems with gcc
384 version 2.5, 2.5.1, or 2.5.2 because of an incorrect declaration of mem-
385 move() in a gcc include file.
387 If you are using a gcc version older than 2.7 on Solaris x86, you need
388 to specify BOOTSTRAPCFLAGS="-Dsun" in the "make World" command.
391 2.6.2. Other GNU tools
393 Use of the GNU assembler, as, or linker, ld, is not supported. GNU make
397 2.6.3. SparcWorks 2.0
400 If you have a non-threaded program and want to debug it with the old
401 SparcWorks 2.0 dbx, you will need to use the thread stubs library in
402 xc/util/misc/thr_stubs.c. Compile it as follows:
405 ar cq libthr_stubs.a thr_stubs.o
406 ranlib libthr_stubs.a
408 Install libthr_stubs.a in the same directory with your X libraries
409 (e.g., /usr/X11R6.3/lib/libthr_stubs.a). Add the following line to
412 #define ExtraLibraries -lsocket -lnsl $(CDEBUGFLAGS:-g=-lthr_stubs)
414 This example uses a make macro substitution; not all make implementa-
415 tions support this feature.
418 2.6.4. CenterLine C under Solaris 2
421 If you are using the CenterLine C compiler to compile the distribution
422 under Solaris 2, place the following line in your site.def:
424 #define HasCenterLineC YES
426 If clcc is not in your default search path, add this line to site.def:
428 #define CcCmd /path/to/your/clcc
431 If you are using CodeCenter 4.0.4 or earlier, the following files
432 trigger bugs in the clcc optimizer:
434 xc/programs/Xserver/cfb16/cfbgetsp.c
435 xc/programs/Xserver/cfb16/cfbfillsp.c
436 xc/programs/Xserver/cfb/cfbgetsp.c
439 Thus to build the server, you will have to compile these files by hand
442 % cd xc/programs/Xserver/cfb16
443 % make CDEBUGFLAGS="-g" cfbgetsp.o cfbfillsp.o
445 % make CDEBUGFLAGS="-g" cfbgetsp.o
447 This optimizer bug appears to be fixed in CodeCenter 4.0.6.
453 On AIX 4.1.4, the file lib/font/Type1/objects.c must be compiled without
454 optimization (-O) else the X server will exit when Type 1 fonts are
461 SunOS 4.0 and earlier need BOOTSTRAPCFLAGS=-DNOSTDHDRS because they do
462 not have unistd.h nor stdlib.h. Do not supply a BOOTSTRAPCFLAGS when
463 building any SunOS 4.1 version.
466 2.6.7. Microsoft Windows NT
469 All of the base libraries are supported, including multi-threading in
470 Xlib and Xt, but some of the more complicated applications, specifically
471 xterm and xdm, are not supported.
473 There are also some other rough edges in the implementation, such as
474 lack of support for non-socket file descriptors as Xt alternate inputs
475 and not using the registry for configurable parameters like the system
476 filenames and search paths.
478 The Xnest server has been made to run on NT. It requires a real X
479 server for output still.
485 The Omron Luna platform is no longer supported. The Luna version of the
486 make program doesn't define the standard macro MAKE, so you must run it
487 as "make MAKE=make" at top level, e.g., "make MAKE=make World".
495 nmake World.Win32 > world.log
497 On other systems, find the BootstrapCFlags line, if any, in the vendor-
498 specific .cf file. If there isn't one, type
500 % make World >& world.log
504 % make World BOOTSTRAPCFLAGS="value" >& world.log
507 You can call the output file something other than "world.log", but do
508 not call it "make.log" because files with this name are automatically
509 deleted during the "cleaning" stage of the build.
511 Because the build can take several hours to complete, you will probably
512 want to run it in the background and keep a watch on the output. For
515 % make World >& world.log &
519 If something goes wrong, the easiest thing is to just start over (typing
520 "make World" again) once you have corrected the problem.
526 If everything is built successfully, you can install the software by
527 typing the following as root:
529 % make install >& install.log
532 Again, you might want to run this in the background and use tail to
535 You can install the manual pages by typing the following as root:
537 % make install.man >& man.log
541 2.8.1. System Installation Notes
544 This section contains hints on installing and using X with specific com-
545 pilers and operating systems.
548 2.8.1.1. The X Server on AIX 4
551 For IBM's AIX 4, you need to make sure the LFT device is associated with
552 the correct graphics adapter. It's a one-time setup that does not hap-
553 pen automatically, even if there's only one graphics adapter in the sys-
554 tem. To configure the LFT device properly, become root and start SMIT.
555 Go to the "Devices" category, choose "LFT", then "Displays", then "Move
556 the LFT to Another Display".
558 Select "Both" for when the change should take effect, then select the
559 display adapter where you want to run the X server. Confirm the changes
560 and exit SMIT; from now on, you should be able to run the server just
563 To run Xibm from xdm, you must provide the "-force" flag on the server
564 command line in the Xservers file.
567 2.9. Shared Libraries
570 The version number of some of the the shared libraries has been changed.
571 On SunOS 4, which supports minor version numbers for shared libraries,
572 programs linked with the R6 libraries will use the new libraries with no
573 special action required. On other platforms you have the following
576 1. Keep the old versions of the libraries around.
578 2. Relink all applications with the new libraries.
580 3. Create a link from the old name to the new name.
582 For example, to have programs that were linked against
583 libX11.so.6.0 use libX11.so.6.3, make this link:
585 ln -s libX11.so.6.3 libX11.so.6.0
589 2.10. Setting Up xterm
592 If your /etc/termcap and /usr/lib/terminfo databases do not have correct
593 entries for xterm, use the sample entries provided in the directory
594 xc/programs/xterm/. System V users may need to compile and install the
595 terminfo entry with the tic utility.
597 Since each xterm will need a separate pseudoterminal, you need a reason-
598 able number of them for normal execution. You probably will want at
599 least 32 on a small, multiuser system. On most systems, each pty has
600 two devices, a master and a slave, which are usually named
601 /dev/tty[pqrstu][0-f] and /dev/pty[pqrstu][0-f]. If you don't have at
602 least the "p" and "q" sets configured (try typing "ls /dev/?ty??"), you
603 should have your system administrator add them. This is commonly done
604 by running the MAKEDEV script in the /dev directory with appropriate ar-
608 2.11. Starting Servers at System Boot
611 The xfs and xdm programs are designed to be run automatically at system
612 startup. Please read the manual pages for details on setting up confi-
613 guration files; reasonable sample files are in xc/programs/xdm/config/
614 and xc/programs/xfs/.
617 2.11.1. On BSD-based systems using /etc/rc
620 If your system uses an /etc/rc file at boot time, you can usually enable
621 these programs by placing the following at or near the end of the file:
623 if [ -f /usr/X11R6.3/bin/xfs ]; then
624 /usr/X11R6.3/bin/xfs & echo -n ' xfs'
627 if [ -f /usr/X11R6.3/bin/xdm ]; then
628 /usr/X11R6.3/bin/xdm; echo -n ' xdm'
632 Since xfs can serve fonts over the network, you do not need to run a
633 font server on every machine with an X display. You should start xfs
634 before xdm, since xdm may start an X server which is a client of the
637 The examples here use /usr/X11R6.3/bin, but if you have installed into a
638 different directory by setting (or unsetting) ProjectRoot then you need
639 to substitute the correct directory.
641 If you are unsure about how system boot works, or if your system does
642 not use /etc/rc, consult your system administrator for help.
645 2.11.2. On SystemV-based systems
648 There are two ways you can get On systems with a /etc/inittab file, you
649 can edit this file to add the lines
651 xfs:3:once:/usr/X11R6.3/bin/xfs
652 xdm:3:once:/usr/X11R6.3/bin/xdm
655 On some systems, you can edit a file in /etc/init.d to run the X Consor-
656 tium xdm instead of the vendor's product xdm. On Sony this file is
657 /etc/init.d/consxdm. On IRIX edit /etc/init.d/xdm.
660 2.12. Using OPEN LOOK applications
663 You can use the X11R6 Xsun server with OPEN LOOK applications, but you
664 must pass the -swapLkeys flag to the server on startup, or the OPEN LOOK
665 Undo, Copy, Paste, Find, and Cut keys may not work correctly. For exam-
666 ple, to run Sun's OpenWindows 3.3 desktop environment with an X11R6
667 server, use the command:
669 % openwin -server /usr/X11R6.3/bin/Xsun -swapLkeys
672 The keysyms reported by keys on the numeric keypad have also changed
673 since X11R5; if you find that OpenWindows applications do not respond to
674 keypad keys and cursor control keys when using the R6 server, you can
675 remap the keypad to generate R5 style keysyms using the following xmod-
681 keysym KP_Equal = F24
682 keysym KP_Divide = F25
683 keysym KP_Multiply = F26
686 keysym KP_Prior = F29
687 keysym KP_Left = Left
689 keysym KP_Right = Right
691 keysym KP_Down = Down
693 keysym KP_Insert = Insert
694 keysym KP_Delete = Delete
698 2.13. Rebuilding after Patches
701 You shouldn't need this right away, but eventually you are probably go-
702 ing to make changes to the sources, for example by applying any public
703 patches that may be released.
705 Each patch comes with explicit instructions at the top of it saying what
706 to do. Thus the procedure here is only an overview of the types of com-
707 mands that might be necessary to rebuild X after changing it.
709 If you are building from CD-ROM, apply the patches to the symbolic link
710 tree. The links to changed files will be replaced with local files con-
711 taining the new contents.
713 If only source files are changed, you should be able to rebuild just by
714 going to the xc directory in your build tree and typing:
719 If configuration files are changed, the safest thing to do is type:
721 % make Everything >& every.log
724 "Everything" is similar to "World" in that it rebuilds every Makefile,
725 but unlike "World" it does not delete the existing objects, libraries,
726 and executables, and only rebuilds what is out of date.
729 2.14. Formatting the Documentation
732 The PostScript files in xc/doc/hardcopy can be generated from the
733 sources in xc/doc/specs. Most of the documentation is in troff using
734 the -ms macros. The easiest way to format it is to use the Imakefiles
737 Set the name of your local troff program by setting the variable
738 TroffCmd in xc/config/cf/site.def. Then build the Makefiles:
741 make SUBDIRS=specs Makefiles
744 Finally, go to the directory you are interested in and type "make"
745 there. This command will generate .PS files. You can also generate
746 text files by specifying the document name with a .txt extension as a
747 make target, e.g., "make icccm.txt".