(no subject)

David Ayers fogey at mindspring.com
Mon Mar 4 11:10:10 PST 2002

TITLE:		Installing XFree86 4.2 using latest 4.2 source or from
		a patched 4.1 source.


AUTHOR:		Dave Ayers <fogey at mindspring.com>

CREDITS:	Matthias S. Benkmann <m.s.b at gmx.net>
		Sergey Ostrovsky <sostrovsky at snip.net>
		Ryan Strayer <rstrayer at kc.rr.com>

REFERENCES:	xfree86_41.txt (Benkmann)
		x11.txt (Ostrovsky)

SYNOPSIS:	This hint takes the xfree_41.txt hint by Matthias
		Benkmann and adapts it for a straightforward
		installation of XFree86 4.2 without any special

Download the newest zlib from http://www.gzip.org/zlib (unless it is
already installed.)  Unpack the source tar file in a temporary
directory of your choice, then cd to the source tree directory created
for installation. Install with

   ./configure --shared &&
   make test &&
   make prefix=/usr install &&
   cp zlib.3 /usr/share/man/man3 &&

Option A - Install from latest XFree86 4.2 packages.

Download from ftp://ftp.xfree86.org/pub/XFree86/4.2.0/source/


Unpack and cd to xc/ directory

Option B - Install 4.2 from a fresh XFree86 4.1 source tree

Download from ftp://ftp.xfree86.org/pub/XFree86/4.2.0/patches/


This patch should be applied to an unmodified XFree86 version 4.1.0
source tree.  There are four patches that change the 4.1.0 source tree
to XFree86 version 4.2.0.

To apply this patch, move the 5 files to the directory containing your
XFree86 4.1 'xc' directory. Then run:
   gzip -d < 4.1.0-4.2.0.diff1.gz | patch -p0 -E
   gzip -d < 4.1.0-4.2.0.diff2.gz | patch -p0 -E
   gzip -d < 4.1.0-4.2.0.diff3.gz | patch -p0 -E
   gzip -d < 4.1.0-4.2.0.diff4.gz | patch -p0 -E
   rm -f xc/extras/freetype2/builds/mac/ftlib.prj
   rm -fr xc/extras/freetype2/docs/design
   rm -fr xc/extras/freetype2/docs/glyphs
   rm -fr xc/extras/freetype2/docs/image
   rm -fr xc/extras/freetype2/docs/tutorial
   rm -f  xc/programs/Xserver/hw/darwin/bundle/English.lproj\
   rm -f xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj\
   rm -f xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj\
   gzip -d < 4.2.0.tgz | tar vxf -

Continue from here (either option)

   cd xc

Edit config/cf/site.def to change XKB from NO to YES. Then run:

   echo $'#define HasZlib YES\n' >> config/cf/site.def &&
   echo $'#define HasNCurses YES\n' >> config/cf/site.def &&
   make World &&
   echo /usr/X11R6.4/lib >> /etc/ld.so.conf &&
   make install &&
   make install.man &&

Configure XFree86:

   export PATH=$PATH:/usr/X11R6.4/bin
(You will also want to put this in your .bashrc or .bash_profile)

   cd /dev

   ln -s /dev/psaux mouse   

(Use your own mouse device if not /dev/psaux, e.g. /dev/ttys0 for a serial
mouse connected to COM1)

   XFree86 -configure

This will auto-detect your graphics hardware - black screen for
several seconds - and create /root/XF86Config.new. Make sure that the
information in XF86Config.new is correct.

   cp /root/XF86Config.new /etc/X11/XF86Config.new
   XFree86 -xf86config /etc/X11/XF86Config.new

This will test the server. You won't get anything but a flimmering
640x480 screen with an annoying pattern and an X shaped moused cursor
that you can move (if the mouse works). Press Ctrl-Alt-Backspace to exit

   cd /etc/X11
   mv XF86Config.new XF86Config

Congratulations! You have just installed X.

But you'll probably want to do some more configuring in
XF86Config. Read the XF86Config(5x) manpage. It won't tell you much,
though. Maybe you should skip it and read
/usr/X11R6/lib/X11/XF86Config.eg which is a well-commented example.

Some things you will surely want to set are 

   Section "InputDevice"
      Identifier  "Keyboard0"
      Driver      "keyboard"
      Option "XkbModel" "pc102"
      Option "XkbLayout" "<your layout>"
      Option "AutoRepeat"  "250 30"


   Section "Monitor"
      Identifier   "Monitor0"
      VendorName   "Iiyama"
      ModelName    "VisionMaster 450"
      HorizSync    27-102
      VertRefresh  50-160

Of course you will need to enter the correct values for your monitor. If 
you set the right values you don't need to fiddle with modelines anymore 
(what a relief!) because XFree86 will choose an appropriate VESA mode with

a high refresh rate. Just specify what mode you want like this:

   Section "Screen"
     Identifier "Screen0"
     Device     "Card0"
     Monitor    "Monitor0"
     DefaultDepth 16
     SubSection "Display"
       Depth     16
       Modes   "1024x768"
       Virtual 1280 960

This is all it takes to get a nice virtual screen of 1280x960 with a real 
resolution of 1024x768 with eye-friendly 85Hz (on my system, it depends on

your monitor's capabilities of course).

Now read the XFree86-HOWTO you get from linuxdoc.org. It will give
you an overview of how X is started. Read the scripts
/usr/X11R6/bin/startx  and /usr/X11R6/lib/X11/xinit/xinitrc
These scripts determine what happens when you type "startx".


Ryan Strayer offers these cautions based on his 4.2 install: "No
special flags or anything .. but I did have to manually edit the
site.def file and change the XKB from NO to YES .. otherwise I kept
bombing out on the install. I also had another issue compiling, but
only if you use GCC 2.95 - which you will if you're using LFS 3.1RC1
.. I guess I skipped patching GCC. Once I recompiled GCC 2.95 with the
patch, and then recompiled GLIBC, X4.2 compiled right off the bat
using a clean source tree."


The following was adapted from the x11.txt hint.

Enabling TTF support
   To use TrueType fonts we need to have not just fonts but also
   auxiliary files which X server uses like "directory listing" for ttf
   installed. One of these files, fonts.scale, could be created
   using utility ttmkfdir, which is not included in XFree86-4.02 package.
   In turn, ttmkfdir requires package freetype-1.x.x installed.
   However, because ttmkfdir tarball includes the prebuilt executable,
   one might try to use this executable. In this case, one might decide
   to skip both installation of freetype-1.3.1 library and building

FreeType-1.3.1 library

Download freetype-1.3.1.tar.gz from http://www.freetype.org/. Unpack
and run:

   ./configure --prefix=/usr
   make install

Ttmkfdir utility

Download ttmkfdir.tar.gz from
http://freshmeat.net/projects/ttmkfdir/ and unpack it.

Make the following changes in Makefile

   FREETYPE_INCL = $(FREETYPE_BASE)/include/freetype

   make FREETYPE_BASE=/usr/local
   install -m755 ttmkfdir /usr/bin

TTF configuration
Create the /usr/X11R6.4/lib/X11/fonts/ttf directory.
   Copy to this directory .ttf fonts you desire.

   cd /usr/X11R6.4/lib/X11/fonts/ttf
   ttmkfdir -o fonts.scale

Specify which font module the X server should be using by appending to
the "Module" section of your XF86Config file:

   Section "Module"
     Load  "freetype"
     Load  "speedo"

and appending the path to your font directory in "Module" section:

   Section "Files"
	FontPath "/usr/X11R6.4/lib/X11/fonts/ttf"

Now your X server will be able to render TrueType fonts.


Here's a little trick to view all of the many X manpages:

   man /usr/X11R6.4/man/man*/*

This will let you read all of the manpages, one after another (press q
to go to the next page.) Plow through this and you will know more
about X than 99% of the rest of us.


David Ayers
Quincy, Illinois, USA 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message

More information about the hints mailing list