Typo
[linux_from_scratch_hints.git] / OLD / xfree86_42.txt
blob12c543228470e8f7537cde23ca1d8c6b7cd202fd
1 TITLE:          Installing XFree86 4.2 using latest 4.2 source or from
2                 a patched 4.1 source. (3-24-02)
4 UPDATED:        4-8-02
6 LFS VERSION:    3.x
8 AUTHOR:         Dave Ayers <fogey@mindspring.com>
10 CREDITS:        Matthias S. Benkmann <m.s.b@gmx.net>
11                 Sergey Ostrovsky <sostrovsky@snip.net>
12                 Ryan Strayer <rstrayer@kc.rr.com>
14 REFERENCES:     xfree86_41.txt (Benkmann)
15                 x11.txt (Ostrovsky)
17 SYNOPSIS:       This hint takes the xfree_41.txt hint by Matthias
18                 Benkmann and adapts it for a straightforward
19                 installation of XFree86 4.2 without any special
20                 optimizations.
21 HINT:
23 Download the newest zlib from http://www.gzip.org/zlib (unless it is
24 already installed.)  Unpack the source tar file in a temporary
25 directory of your choice, then cd to the source tree directory created
26 for installation. Install with
28    ./configure --shared &&
29    make test &&
30    make prefix=/usr install &&
31    cp zlib.3 /usr/share/man/man3 &&
32    /sbin/ldconfig
34 Option A - Install from latest XFree86 4.2 packages.
35 ----------------------------------------------------
37 Download from ftp://ftp.xfree86.org/pub/XFree86/4.2.0/source/
39    X420src-1.tgz
40    X420src-2.tgz
41    X420src-3.tgz
43 Unpack these tarballs into your temporary source directory.
45 Option B - Install 4.2 from a fresh XFree86 4.1 source tree
46 -----------------------------------------------------------
48 Download from ftp://ftp.xfree86.org/pub/XFree86/4.2.0/patches/
50    4.1.0-4.2.0.diff1.gz
51    4.1.0-4.2.0.diff2.gz
52    4.1.0-4.2.0.diff3.gz
53    4.1.0-4.2.0.diff4.gz
54    4.2.0.tgz
56 This patch should be applied to an unmodified XFree86 version 4.1.0
57 source tree.  There are four patches that change the 4.1.0 source tree
58 to XFree86 version 4.2.0.
60 To apply this patch, move the 5 files to the directory containing your
61 XFree86 4.1 'xc' directory. Then run:
63    gzip -d < 4.1.0-4.2.0.diff1.gz | patch -p0 -E
64    gzip -d < 4.1.0-4.2.0.diff2.gz | patch -p0 -E
65    gzip -d < 4.1.0-4.2.0.diff3.gz | patch -p0 -E
66    gzip -d < 4.1.0-4.2.0.diff4.gz | patch -p0 -E
67    rm -f xc/extras/freetype2/builds/mac/ftlib.prj
68    rm -fr xc/extras/freetype2/docs/design
69    rm -fr xc/extras/freetype2/docs/glyphs
70    rm -fr xc/extras/freetype2/docs/image
71    rm -fr xc/extras/freetype2/docs/tutorial
72    rm -f  xc/programs/Xserver/hw/darwin/bundle/English.lproj\
73      /MainMenu.nib/objects.nib
74    rm -f xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj\
75      /Localizable.strings
76    rm -f xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj\
77      /MainMenu.nib/objects.nib
78    gzip -d < 4.2.0.tgz | tar vxf -
80 Continue from here (either option)
81 ----------------------------------
83    cd xc
85 Edit config/cf/site.def to change XKB from NO to YES. Then run:
87    echo $'\n #define HasZlib YES\n' >> config/cf/site.def &&
88    echo $'\n #define HasNCurses YES\n' >> config/cf/site.def &&
89    make World &&
90    make install &&
91    make install.man &&
93 NOTE: If you used Option B (started with a 4.1 source tree) change all
94 references to X11R6 to X11R6.4. The lines needing this change are
95 marked with "*"
97 * Manually add /usr/X11R6/lib to /etc/ld.so.conf
99    /sbin/ldconfig
101 Configure XFree86:
103 *  export PATH=$PATH:/usr/X11R6/bin 
104 (You will also want to put this in your .bashrc and .bash_profile)
106    cd /dev
108    ln -s /dev/psaux mouse   
110 (Use your own mouse device if not /dev/psaux, e.g. /dev/ttys0 for a serial
111 mouse connected to COM1)
113    XFree86 -configure
115 This will auto-detect your graphics hardware. Your screen will turn
116 black for several seconds. Don't panic. When the probing is finished,
117 a file /root/XF86Config.new will be created. Make sure that the
118 information in XF86Config.new regarding your mouse, video card and
119 monitor is correct, then test the server with the following command:
121    XFree86 -xf86config /root/XF86Config.new
123 You won't get anything but a flimmering 640 x 480 screen with an
124 annoying pattern and an X-shaped mouse cursor that you can move (if
125 the mouse works). Press Ctrl-Alt-Backspace to exit, then move your
126 config file to its final location
128    mv /root/XF86Config.new /etc/X11/XF86Config
130 Congratulations! You have just installed X.
132 But you'll probably want to do some more configuring in
133 XF86Config. Read the XF86Config(5x) manpage. It won't tell you much,
134 though. Maybe you should skip it and read
135 * /usr/X11R6/lib/X11/XF86Config.eg which is a well-commented example.
137 Some things you will surely want to set are 
139    Section "InputDevice"
140       Identifier  "Keyboard0"
141       Driver      "keyboard"
142       Option "XkbModel" "pc102"
143       Option "XkbLayout" "<your layout>"
144       Option "AutoRepeat"  "250 30"
145    EndSection
149    Section "Monitor"
150       Identifier   "Monitor0"
151       VendorName   "Iiyama"
152       ModelName    "VisionMaster 450"
153       HorizSync    27-102
154       VertRefresh  50-160
155    EndSection
157 Of course you will need to enter the correct values for your monitor. If 
158 you set the right values you don't need to fiddle with modelines anymore 
159 (what a relief!) because XFree86 will choose an appropriate VESA mode with 
160 a high refresh rate. Just specify what mode you want like this:
162    Section "Screen"
163      Identifier "Screen0"
164      Device     "Card0"
165      Monitor    "Monitor0"
166      DefaultDepth 16
167      SubSection "Display"
168        Depth     16
169        Modes   "1024x768"
170        Virtual 1280 960
171      EndSubSection
172    EndSection
174 This is all it takes to get a nice virtual screen of 1280x960 with a real 
175 resolution of 1024x768 with eye-friendly 85Hz (on my system, it depends on 
176 your monitor's capabilities of course).
178 Now read the XFree86-HOWTO you get from linuxdoc.org. It will give
179 you an overview of how X is started. Read the scripts
180 * /usr/X11R6/bin/startx  and /usr/X11R6/lib/X11/xinit/xinitrc
181 These scripts determine what happens when you type "startx".
183 NOTE:
185 Ryan Strayer offers these cautions based on his 4.2 install: "No
186 special flags or anything .. but I did have to manually edit the
187 site.def file and change the XKB from NO to YES .. otherwise I kept
188 bombing out on the install. I also had another issue compiling, but
189 only if you use GCC 2.95 - which you will if you're using LFS 3.1RC1
190 .. I guess I skipped patching GCC. Once I recompiled GCC 2.95 with the
191 patch, and then recompiled GLIBC, X4.2 compiled right off the bat
192 using a clean source tree."
194 ENABLING TTF SUPPORT:
196 The following was adapted from the x11.txt hint.
198 Enabling TTF support
199 --------------------
200    To use TrueType fonts we need to have not just fonts but also
201    auxiliary files which X server uses like "directory listing" for ttf files
202    installed. One of these files, fonts.scale, could be created
203    using utility ttmkfdir, which is not included in XFree86-4.02 package.
204    In turn, ttmkfdir requires package freetype-1.x.x installed.
205    However, because ttmkfdir tarball includes the prebuilt executable,
206    one might try to use this executable. In this case, one might decide
207    to skip both installation of freetype-1.3.1 library and building ttmkfdir.
209 FreeType-1.3.1 library
210 ----------------------
212 Download freetype-1.3.1.tar.gz from http://www.freetype.org/. Unpack
213 and run:
215    ./configure --prefix=/usr
216    make
217    make install
219 Ttmkfdir utility
220 ----------------
222 Download ttmkfdir.tar.gz from
223 http://freshmeat.net/projects/ttmkfdir/ and unpack it.
225 Make the following changes in Makefile
227    FREETYPE_INCL = $(FREETYPE_BASE)/include/freetype
228    FREETYPE_LIB = -L$(FREETYPE_BASE)/lib -lttf
231    make FREETYPE_BASE=/usr
232    install -m755 ttmkfdir /usr/bin
234 TTF configuration
235 -----------------
236 * Create the /usr/X11R6/lib/X11/fonts/ttf directory.
237    Copy to this directory .ttf fonts you desire.
240 *  cd /usr/X11R6/lib/X11/fonts/ttf
241    ttmkfdir -o fonts.scale
242    mkfontdir
244 Specify which font module the X server should be using by appending to
245 the "Module" section of your XF86Config file:
247    Section "Module"
248      ...
249      Load  "freetype"
250      Load  "speedo"
251    EndSection
253 and appending the path to your font directory in "Module" section:
255    Section "Files"
256         ...
257 *       FontPath "/usr/X11R6/lib/X11/fonts/ttf/"
258    EndSection
260 Now your X server will be able to render TrueType fonts.
262 -----------
264 Here's a little trick to view all of the many X manpages (except for
265 the C API):
267 *  man /usr/X11R6/man/man{1,4,5,7,8}/*
269 This will let you read all of the manpages, one after another (press q
270 to go to the next page.) Plow through this and you will know more
271 about X than 99% of the rest of us.
277