Web hosting, cheap domain registrar & web ranking services
  

 Home

DRI Compilation Guide : Compiling the XFree86/DRI tree
Previous: Mesa
Next: Normal Installation and Configuration

8. Compiling the XFree86/DRI tree

8.1. Make a build tree

Rather than placing object files and library files right in the source tree, they're instead put into a parallel build tree. The build tree is made with the lndir command:

            cd ~/DRI-CVS
            ln -s xc XFree40
            mkdir build
            cd build
            lndir -silent -ignorelinks ../XFree40
          

The build tree will be populated with symbolic links which point back into the CVS source tree.

Advanced users may have several build trees for compiling and testing with different options.

8.2. Edit the host.def file

The ~/DRI-CVS/build/xc/config/cf/host.def file is used to configure the XFree86 build process. You can change it to customize your build options or make adjustments for your particular system configuration

The default host.def file will look something like this:

            #define DefaultCCOptions -Wall
(i386)      #define DefaultGcc2i386Opt -O2
(Alpha)     #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar)
            #define LibraryCDebugFlags -O2
            #define BuildServersOnly YES
            #define XF86CardDrivers vga tdfx mga ati i810
            #define LinuxDistribution LinuxRedHat
            #define DefaultCCOptions -ansi GccWarningOptions -pipe
            #define BuildXF86DRI YES
            /* Optionally turn these on for debugging */
            /* #define GlxBuiltInTdfx YES */
            /* #define GlxBuiltInMga YES */
            /* #define GlxBuiltInR128 YES */
            /* #define GlxBuiltInRadeon YES */
            /* #define DoLoadableServer NO */
            #define SharedLibFont NO
          

The ProjectRoot variable specifies where the XFree86 files will be installed. We recommend installing the DRI files over your existing XFree86 installation - it's generally safe to do and less error-prone. This policy is different than what we used to recommend.

If XFree86 4.x is not installed in /usr/X11R6/ you'll have to add the following to the host.def file:

            #define ProjectRoot pathToYourXFree86installation
          

Note the XF86CardDrivers line to be sure your card's driver is listed.

If you want to enable 3DNow! optimizations in Mesa and the DRI drivers, you should add the following:

            #define MesaUse3DNow YES
          

You don't have to be using an AMD processor in order to enable this option. The DRI will look for 3DNow! support and runtime and only enable it if applicable.

If you want to enable SSE optimizations in Mesa and the DRI drivers, you must upgrade to a Linux 2.4.x kernel. Mesa will verify that SSE is supported by both your processor and your operating system, but to build Mesa inside the DRI you need to have the Linux 2.4.x kernel headers in /usr/src/linux. If you enable SSE optimizations with an earlier version of the Linux kernel in /usr/src/linux, Mesa will not compile. You have been warned. If you do have a 2.4.x kernel, you should add the following:

            #define MesaUseSSE YES
          

If you want to build the DRM kernel modules as part of the full build process, add the following:

            #define BuildXF86DRM YES
          

Otherwise, you'll need to build them separately as described below.

8.3. Compilation

To compile the complete DRI tree:

            cd ~/DRI-CVS/build/xc/
            make World >& world.log
          

Or if you want to watch the compilation progress:

            cd ~/DRI-CVS/build/xc/
            make World >& world.log &
            tail -f world.log
          

With the default compilation flags it's normal to get a lot of warnings during compilation.

Building will take some time so you may want to go check your email or visit slashdot.

WARNING: do not use the -j option with make. It's reported that it does not work with XFree86/DRI.

8.4. Check for compilation errors

Using your text editor, examine world.log for errors by searching for the pattern ***.

After fixing the errors, run make World again. Later, you might just compile parts of the source tree but it's important that the whole tree will build first.

If you edited your host.def file to enable automatic building of the DRI kernel module(s), verify that they were built:

          cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
          ls
          

Otherwise, build them now by running

          cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
          make -f Makefile.linux
          

For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI Radeon, you should see radeon.o. For the Intel i810, you should see i810.o.

If the DRI kernel module(s) failed to build you should verify that you're using the right version of the Linux kernel. The most recent kernels are not always supported.

If your build machine is running a different version of the kernel than your target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel source tree. This can be fixed by explicitly setting the value of LINUXDIR. If the path to your kernel source is /usr/src/linux-2.4.x,

          cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
          make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x
          

or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LINUXDIR line.

8.5. DRI kernel module installation

The DRI kernel modules will be in ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/.

To load the appropriate DRM module in your running kernel you can either use ismod and restart your X server or copy the kernel module to /lib/modules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X server.

Make sure you first unload any older DRI kernel modules that might be already loaded.

Note that some DRM modules require that the agpgart module be loaded first.


DRI Compilation Guide : Compiling the XFree86/DRI tree
Previous: Mesa
Next: Normal Installation and Configuration

 

 

 

 

Web ranking services | Cheap domain by Cheap Domain Registrar | Cheap domain registrar 

Disclaimers: This document is provided as free service for the benefits of Active-Venture.com's website hosting customers only.

 

 
Quotes: Where a government has come into power through some form of popular vote, fraudulent or not, and maintains at least an appearance of constitutional legality, the guerrilla outbreak cannot be promoted, since the possibilities of peaceful struggle have not yet been exhausted.Whenever death may surprise us, let it be welcome if our battle cry has reached even one receptive ear and another hand reaches out to take up our arms.There are no boundaries in this struggle to the death. We cannot be indifferent to what happens anywhere in the world, for a victory by any country over imperialism is our victory; just as any country's defeat is a defeat for all of us.The amount of poverty and suffering required for the emergence of a Rockefeller, and the amount of depravity that the accumulation of a fortune of such magnitude entails, are left out of the picture, and it is not always possible to make the people in general see this.Many will call me an adventurer - and that I am, only one of a different sort: one of those who risks his skin to prove his platitudes.Whoever, in middle age, attempts to realize the wishes and hopes of his early youth, invariably deceives himself. Each ten years of a man's life has its own fortunes, its own hopes, its own desires.Life belongs to the living, and he who lives must be prepared for changes.Fools and sensible men are equally innocuous. It is in the half fools and the half wise that the danger lies.Destiny grants us our wishes, but in its own way, in order to give us something beyond our wishes.We must learn to be still in the midst of activity and to be vibrantly alive in repose.There is certainly no absolute standard of beauty. That precisely is what makes its pursuit so interesting.The conventional view serves to protect us from the painful job of thinking.Power is not something that can be assumed or discarded at will like underwear.People are the common denominator of progress. So - no improvement is possible with unimproved people, and advance is certain when people are liberated and educated.Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof.It is a far, far better thing to have a firm anchor in nonsense than to put out on the troubled sea of thought.The world is full of willing people, some willing to work, the others willing to let them.