summaryrefslogtreecommitdiff
path: root/Development/BuildingX.mdwn
diff options
context:
space:
mode:
authorAlanCoopersmith <AlanCoopersmith@web>2013-09-14 10:05:52 -0700
committerxorg <iki-xorg@freedesktop.org>2013-09-14 10:05:52 -0700
commitce9e4b8495fd3c0f04664e67eb71432d630c8d64 (patch)
treecbba7cfaf586a9404d708e05a5a83c6d37fb2880 /Development/BuildingX.mdwn
parent066f8cb1e702e80788f0e5f988029d5b6ea873e5 (diff)
fix formatting after moin->iki conversion
Diffstat (limited to 'Development/BuildingX.mdwn')
-rw-r--r--Development/BuildingX.mdwn226
1 files changed, 116 insertions, 110 deletions
diff --git a/Development/BuildingX.mdwn b/Development/BuildingX.mdwn
index 218b61ad..77104630 100644
--- a/Development/BuildingX.mdwn
+++ b/Development/BuildingX.mdwn
@@ -1,25 +1,26 @@
+**This page contains some outdated information. To get an up-to-date description of how to build the packages, please take a look at [[ModularDevelopersGuide|ModularDevelopersGuide]].**
-**This page contains some outdated information. To get an up-to-date description of how to build the packages, please take a look at [[ModularDevelopersGuide|ModularDevelopersGuide]].**
# Modular X development using the git trees
-Since it's fairly common to do development that touches several layers of the graphics stack, this guide will cover building the whole thing, from the DRM up through the X server and drivers. We'll install the whole stack into a separate directory, just to keep things separated from the distribution packages we (presumably) want to keep working as we break things in our sandbox.
+Since it's fairly common to do development that touches several layers of the graphics stack, this guide will cover building the whole thing, from the DRM up through the X server and drivers. We'll install the whole stack into a separate directory, just to keep things separated from the distribution packages we (presumably) want to keep working as we break things in our sandbox.
-On a basic level, you'll need to build things in roughly this order:
+On a basic level, you'll need to build things in roughly this order:
-1. kernel
-1. Dependencies
-1. DRM (both libdrm & the DRM modules for non-intel)
-1. Mesa
-1. X server
-1. X drivers
-An alternate method of building the packages in a more automated fashion using the jhbuild utility can be found in the [[JhBuildInstructions|JhBuildInstructions]].
+1. kernel
+1. Dependencies
+1. DRM (both libdrm & the DRM modules for non-intel)
+1. Mesa
+1. X server
+1. X drivers
-Everything described underneath is also available as a pre made script, located at the bottom of this page.
+An alternate method of building the packages in a more automated fashion using the jhbuild utility can be found in the [[JhBuildInstructions|JhBuildInstructions]].
+
+Everything described underneath is also available as a pre made script, located at the bottom of this page.
## Minimum requirements
-Basically, Linux 2.6.x, Free/Net/OpenBSD, OpenSolaris/Solaris 10, Hurd, OS X 10.5, and Cygwin systems should work fine on any architecture these are likely to run on. Compiler-wise, gcc 3.x, Intel icc, Sun Studio, and llvm-clang are generally known to work. See below if you're looking at a port:
+Basically, Linux 2.6.x, Free/Net/OpenBSD, OpenSolaris/Solaris 10, Hurd, OS X 10.5, and Cygwin systems should work fine on any architecture these are likely to run on. Compiler-wise, gcc 3.x, Intel icc, Sun Studio, and llvm-clang are generally known to work. See below if you're looking at a port:
[[!format txt """
@@ -61,7 +62,7 @@ Non-server compiler pretty much just needs to be C89 or better.
## Kernel
-As of linux 2.6.28, the canonical upstream for the Intel DRM (direct rendering manager) code is the linux kernel, and replaces the linux-core build below for other chipsets. There are plenty of instructions on building your own kernel out there, but the quick summary is:
+As of linux 2.6.28, the canonical upstream for the Intel DRM (direct rendering manager) code is the linux kernel, and replaces the linux-core build below for other chipsets. There are plenty of instructions on building your own kernel out there, but the quick summary is:
[[!format txt """
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
cd linux-2.6
@@ -78,167 +79,172 @@ sudo reboot
## Building Dependencies
-Autoconf (part of the autotools system X uses for its build system) likely needs macros defined by X. These are included in the util/macros package:
+Autoconf (part of the autotools system X uses for its build system) likely needs macros defined by X. These are included in the util/macros package:
+
+* macros - _git://git.freedesktop.org/git/xorg/util/macros_
+Once you've installed the macros, you need to let the other packages use them:
-* macros - _git://git.freedesktop.org/git/xorg/util/macros_
-Once you've installed the macros, you need to let the other packages use them:
+1. `export ACLOCAL="aclocal -I /opt/gfx-test/share/aclocal"`
+Mesa and the X server proper have several dependencies, and depending on your distribution you may need to update some of the libraries, headers, and prototypes it depends on before configuring the build. Common examples include:
-1. `export ACLOCAL="aclocal -I /opt/gfx-test/share/aclocal"`
-Mesa and the X server proper have several dependencies, and depending on your distribution you may need to update some of the libraries, headers, and prototypes it depends on before configuring the build. Common examples include:
+* libx11proto - _git://git.freedesktop.org/git/xorg/proto/x11proto_
+* libxtrans - _git://git.freedesktop.org/git/xorg/lib/libxtrans_
+* libX11 - _git://git.freedesktop.org/git/xorg/lib/libX11_
+* libXext - _git://git.freedesktop.org/git/xorg/lib/libXext_
+* dri2proto - _git://git.freedesktop.org/git/xorg/proto/dri2proto_
+* glproto - _git://git.freedesktop.org/git/xorg/proto/glproto_
+* pciaccess - _git://git.freedesktop.org/git/xorg/lib/libpciaccess_
+* pixman - _git://git.freedesktop.org/git/pixman_
-* libx11proto - _git://git.freedesktop.org/git/xorg/proto/x11proto_
-* libxtrans - _git://git.freedesktop.org/git/xorg/lib/libxtrans_
-* libX11 - _git://git.freedesktop.org/git/xorg/lib/libX11_
-* libXext - _git://git.freedesktop.org/git/xorg/lib/libXext_
-* dri2proto - _git://git.freedesktop.org/git/xorg/proto/dri2proto_
-* glproto - _git://git.freedesktop.org/git/xorg/proto/glproto_
-* pciaccess - _git://git.freedesktop.org/git/xorg/lib/libpciaccess_
-* pixman - _git://git.freedesktop.org/git/pixman_
-The usual _git clone path; cd package; ./autogen.sh --prefix=/opt/gfx-test; make; make install_ sequence should build these modules.
+The usual _git clone path; cd package; ./autogen.sh --prefix=/opt/gfx-test; make; make install_ sequence should build these modules.
-Once the build & install has completed, you'll need to set your PKG_CONFIG_PATH environment variable, so subsequent configurations will pick up your new bits.
+Once the build & install has completed, you'll need to set your PKG_CONFIG_PATH environment variable, so subsequent configurations will pick up your new bits.
-1. `export PKG_CONFIG_PATH=/opt/gfx-test/lib/pkgconfig`
+1. `export PKG_CONFIG_PATH=/opt/gfx-test/lib/pkgconfig`
## Building DRM
-See [[http://dri.freedesktop.org/wiki/Building|http://dri.freedesktop.org/wiki/Building]]. In short:
+See [[http://dri.freedesktop.org/wiki/Building|http://dri.freedesktop.org/wiki/Building]]. In short:
-The DRM (Direct Rendering Manager) provides kernel and library interfaces to clients wanting access to kernel managed resources like interrupts, buffer swaps, DMA memory mapping and graphics memory management. Building it is fairly straightforward:
+The DRM (Direct Rendering Manager) provides kernel and library interfaces to clients wanting access to kernel managed resources like interrupts, buffer swaps, DMA memory mapping and graphics memory management. Building it is fairly straightforward:
-1. `git clone git://git.freedesktop.org/git/mesa/drm`
-1. `cd drm`
-1. `./autogen.sh --prefix=/opt/gfx-test` _# or wherever you want to install it._
-1. `make`
-1. `make -C linux-core` _# assuming you're on Linux, otherwise use bsd-core. Don't bother for intel._
-1. `make install` _# with new drm gem, like Intel. On make install try don't overwrite drm kernel headers with this drm headers of libdrm. _
+1. `git clone git://git.freedesktop.org/git/mesa/drm`
+1. `cd drm`
+1. `./autogen.sh --prefix=/opt/gfx-test` _# or wherever you want to install it._
+1. `make`
+1. `make -C linux-core` _# assuming you're on Linux, otherwise use bsd-core. Don't bother for intel._
+1. `make install` _# with new drm gem, like Intel. On make install try don't overwrite drm kernel headers with this drm headers of libdrm. _
## Building Mesa
-See [[http://dri.freedesktop.org/wiki/Building|http://dri.freedesktop.org/wiki/Building]]. In short:
+See [[http://dri.freedesktop.org/wiki/Building|http://dri.freedesktop.org/wiki/Building]]. In short:
-The Mesa package contains the GL stack and its associated chip specific drivers, which provide direct and indirect rendering acceleration. Note that to build some of the test programs there is a dependency on the development packages for GLUT. You'll have to ensure those development packages have been installed, or you can disable building the GLUT programs by adding_ --disable-glut_ to the autogen line below. You will still be able to build the common demo programs such as glxgears without GLUT, though.
+The Mesa package contains the GL stack and its associated chip specific drivers, which provide direct and indirect rendering acceleration. Note that to build some of the test programs there is a dependency on the development packages for GLUT. You'll have to ensure those development packages have been installed, or you can disable building the GLUT programs by adding_ --disable-glut_ to the autogen line below. You will still be able to build the common demo programs such as glxgears without GLUT, though.
-1. `git clone git://git.freedesktop.org/git/mesa/mesa`
-1. `cd mesa`
-1. `./autogen.sh --prefix=/opt/gfx-test --with-driver=dri --disable-glut`
-1. `make`
-1. `make install`
-1. `mkdir -p /opt/gfx-test/bin`
-1. `install -m755 progs/xdemos/{glxinfo,glxgears} /opt/gfx-test/bin/`
+1. `git clone git://git.freedesktop.org/git/mesa/mesa`
+1. `cd mesa`
+1. `./autogen.sh --prefix=/opt/gfx-test --with-driver=dri --disable-glut`
+1. `make`
+1. `make install`
+1. `mkdir -p /opt/gfx-test/bin`
+1. `install -m755 progs/xdemos/{glxinfo,glxgears} /opt/gfx-test/bin/`
### Gallium build instructions
-Gallium is an alternative architecture for hardware acceleration in mesa. It is currently a branch in the official mesa tree.
+Gallium is an alternative architecture for hardware acceleration in mesa. It is currently a branch in the official mesa tree.
-1. `git clone git://git.freedesktop.org/git/mesa/mesa`
-1. `cd mesa`
-1. `git checkout origin/gallium-0.1`
-1. `make` with whatever target you want (the list of targets is in mesa/configs/, common targets are linux, linux-dri, linux-dri-x86 and linux-dri-x86-64)
+1. `git clone git://git.freedesktop.org/git/mesa/mesa`
+1. `cd mesa`
+1. `git checkout origin/gallium-0.1`
+1. `make` with whatever target you want (the list of targets is in mesa/configs/, common targets are linux, linux-dri, linux-dri-x86 and linux-dri-x86-64)
## Building the X Server
-* Here we build the X server with builtin fonts so we don't have to do too much configuration later. Note if you're building DMX or Xgl for example you need the `--with-mesa-source` option.
-* `git clone git://git.freedesktop.org/git/xorg/xserver`
-* `cd xserver`
-* `./autogen.sh --prefix=/opt/gfx-test --enable-builtin-fonts`
-* `make`
-* `make install`
-* `chown root /opt/gfx-test/bin/Xorg; chmod +s /opt/gfx-test/bin/Xorg` _# assuming you don't run as root_
+* Here we build the X server with builtin fonts so we don't have to do too much configuration later. Note if you're building DMX or Xgl for example you need the `--with-mesa-source` option.
+* `git clone git://git.freedesktop.org/git/xorg/xserver`
+* `cd xserver`
+* `./autogen.sh --prefix=/opt/gfx-test --enable-builtin-fonts`
+* `make`
+* `make install`
+* `chown root /opt/gfx-test/bin/Xorg; chmod +s /opt/gfx-test/bin/Xorg` _# assuming you don't run as root_
### Making the keyboard work
#### Using disto setup
-If you have a non qwerty keyboard, and don't want to install XKeyboardConfig, you might want to add the following flag to the autogen.sh script, when building the X server :
+If you have a non qwerty keyboard, and don't want to install XKeyboardConfig, you might want to add the following flag to the autogen.sh script, when building the X server :
-* `--with-xkb-path=/usr/share/X11/xkb`
-(You may need to adjust the path depending on your distribution).
+* `--with-xkb-path=/usr/share/X11/xkb`
+(You may need to adjust the path depending on your distribution).
-Also the X server will search for the xkbcomp program in `/opt/gfx-test/bin`. So you will need to create a symbolic link to your distribution xkbcomp :
+Also the X server will search for the xkbcomp program in `/opt/gfx-test/bin`. So you will need to create a symbolic link to your distribution xkbcomp :
-* `cd /opt/gfx-test/bin`
-* `ln -s /usr/bin/xkbcomp xkbcomp`
+* `cd /opt/gfx-test/bin`
+* `ln -s /usr/bin/xkbcomp xkbcomp`
#### From scratch
-Or you can install the XKeyboardConfig definitations
+Or you can install the XKeyboardConfig definitations
-* git clone git://anongit.freedesktop.org/git/xkeyboard-config
-* cd xkeyboard-config/
-* ./autogen.sh --prefix=$PREFIX
-* make
-* make install And the xkbcomp tool
-* git clone git://git.freedesktop.org/git/xorg/app/xkbcomp
-* cd xkbcomp/
-* ./autogen.sh --prefix=$PREFIX
-* make
-* make install
+* git clone git://anongit.freedesktop.org/git/xkeyboard-config
+* cd xkeyboard-config/
+* ./autogen.sh --prefix=$PREFIX
+* make
+* make install And the xkbcomp tool
+* git clone git://git.freedesktop.org/git/xorg/app/xkbcomp
+* cd xkbcomp/
+* ./autogen.sh --prefix=$PREFIX
+* make
+* make install
## Building X drivers
-Presumably you'll want a video driver and a couple of input drivers at a minimum. We'll do xf86-input-mouse, xf86-input-keyboard, and xf86-video-intel here.
+Presumably you'll want a video driver and a couple of input drivers at a minimum. We'll do xf86-input-mouse, xf86-input-keyboard, and xf86-video-intel here.
### xf86-input-mouse
-1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-mouse`
-1. `cd xf86-input-mouse`
-1. `./autogen.sh --prefix=/opt/gfx-test`
-1. `make`
-1. `make install`
+1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-mouse`
+1. `cd xf86-input-mouse`
+1. `./autogen.sh --prefix=/opt/gfx-test`
+1. `make`
+1. `make install`
### xf86-input-keyboard
-1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-keyboard`
-1. `cd xf86-input-keyboard`
-1. `./autogen.sh --prefix=/opt/gfx-test`
-1. `make`
-1. `make install`
-You possibly will want the evdev driver, especially if your distro uses the evdev system
+1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-keyboard`
+1. `cd xf86-input-keyboard`
+1. `./autogen.sh --prefix=/opt/gfx-test`
+1. `make`
+1. `make install`
+
+You possibly will want the evdev driver, especially if your distro uses the evdev system
### xf86-input-evdev
-1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-evdev`
-1. `cd xf86-input-evdev`
-1. `./autogen.sh --prefix=/opt/gfx-test`
-1. `make`
-1. `make install`
+1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-evdev`
+1. `cd xf86-input-evdev`
+1. `./autogen.sh --prefix=/opt/gfx-test`
+1. `make`
+1. `make install`
### xf86-video-intel
-1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-video-intel`
-1. `cd xf86-video-intel`
-1. `./autogen.sh --prefix=/opt/gfx-test`
-1. `make`
-1. `make install`
+1. `git clone git://git.freedesktop.org/git/xorg/driver/xf86-video-intel`
+1. `cd xf86-video-intel`
+1. `./autogen.sh --prefix=/opt/gfx-test`
+1. `make`
+1. `make install`
## Running your new stack
-Now that your development environment is set up, you can try running it (as root).
+Now that your development environment is set up, you can try running it (as root).
+
+This first 4 steps are no longer need, for the drives which use new drm gem, which is the case of Intel.
-This first 4 steps are no longer need, for the drives which use new drm gem, which is the case of Intel.
+1. `rmmod i915` _# assuming you're using Intel_
+1. `rmmod drm`
+1. `insmod `_<path_to_drm_tree_above>_`/linux-core/drm.ko`
+1. `insmod `_<path_to_drm_tree_above>_`/linux-core/i915.ko`
+1. `export LD_LIBRARY_PATH=/opt/gfx-test/lib`
+1. `startx -- /opt/gfx-test/bin/Xorg -verbose` _# make sure you have a ~/.xinitrc with what you want to run_
-1. `rmmod i915` _# assuming you're using Intel_
-1. `rmmod drm`
-1. `insmod `_<path_to_drm_tree_above>_`/linux-core/drm.ko`
-1. `insmod `_<path_to_drm_tree_above>_`/linux-core/i915.ko`
-1. `export LD_LIBRARY_PATH=/opt/gfx-test/lib`
-1. `startx -- /opt/gfx-test/bin/Xorg -verbose` _# make sure you have a ~/.xinitrc with what you want to run_
-And there you have it, a fresh stack ready for tracking & doing upstream development. Enjoy!
+And there you have it, a fresh stack ready for tracking & doing upstream development. Enjoy!
## Troubleshooting
-If you can't install the drm kernel module with the message (can't allocate memory), you perhaps set the virtual size in xorg.conf higher than your graphic memory size.
+If you can't install the drm kernel module with the message (can't allocate memory), you perhaps set the virtual size in xorg.conf higher than your graphic memory size.
## Quick and easy way to install a development build
-on debian/ubuntu this script depends on the following packages: build-essential git-core autoconf automake sudo libtool pkg-config xsltproc xcb-proto libfreetype6-dev libexpat1-dev libssl-dev
+on debian/ubuntu this script depends on the following packages: build-essential git-core autoconf automake sudo libtool pkg-config xsltproc xcb-proto libfreetype6-dev libexpat1-dev libssl-dev
+
[[!format txt """
+
# !/bin/bash
## X.org development build script
@@ -388,7 +394,7 @@ configure ()
./autogen.sh --prefix="$PREFIX"
if [ $? -ne 0 ]; then
echo "Failed to configure $i."
- if [[ "$i" == "libX11" ]]; then
+ if \[[ "$i" == "libX11" ]]; then
echo "If you are getting a libX11 error related to xtrans, install xtrans package into your system"
fi
exit -1
@@ -501,4 +507,4 @@ case "$1" in
exit 3
esac
-"""]] \ No newline at end of file
+"""]]