Tips for Setting Up an Xorg Development Environment
First you should go here. I would also recommend is who-t.blogspot.com, where you can find a neat git super module that, if you can get it working, would be the best solution. If you are still pulling your hair out, read on.
I had many frustrations getting an X development environment set up for the first time so I will try and list some tips so that you can avoid the trouble I did.
First install the following packages, I may have missed a few but you should be able to tell by errors you get along the way what packages you need.
The build script at the website above is good, but when you can't get stuff working and find yourself repeatedly running the script, you want something that will let you pick up where you left off. I modified the script to possibly save you hours you can find the script at the bottom of this post.
You can use it the same way you used the other script, with one added feature. If it quits on you run:
Do not run the script with sudo, use su. The pkgconfig doesn't like sudo.
I am using nvidia, you will have to replace the nv driver in the script with whatever driver you have.
If you still have trouble building, look in the output to see where it is going wrong. If a package is missing install it, then try again.
The Build Script
Follow the instructions here to get it running, you will probably need to link your xkeyboard-config to your current setup unless you want to build that too.
I had many frustrations getting an X development environment set up for the first time so I will try and list some tips so that you can avoid the trouble I did.
First install the following packages, I may have missed a few but you should be able to tell by errors you get along the way what packages you need.
sudo apt-get install autoconf libtool gettext xutils-dev libssl-dev
The build script at the website above is good, but when you can't get stuff working and find yourself repeatedly running the script, you want something that will let you pick up where you left off. I modified the script to possibly save you hours you can find the script at the bottom of this post.
You can use it the same way you used the other script, with one added feature. If it quits on you run:
export stage=$?when you want to try building again from that step, run:
./build.sh build $stageor if you have a different step that you want to go from, you can just type the step number.
Do not run the script with sudo, use su. The pkgconfig doesn't like sudo.
I am using nvidia, you will have to replace the nv driver in the script with whatever driver you have.
If you still have trouble building, look in the output to see where it is going wrong. If a package is missing install it, then try again.
The Build Script
PREFIX="/opt/gfx-test"Running your new X
PKG_CONFIG_PATH=/opt/gfx-test/lib/pkgconfig
# Attempt to detect proper concurrency level
CPU_CORES=`cat /proc/cpuinfo | grep -m1 "cpu cores" | sed s/".*: "//`
CONCURRENCY_LEVEL=$(( $CPU_CORES + 1 ))
MAKE="make"
REPOS="\
git://git.freedesktop.org/git/xorg/util/macros \
git://git.freedesktop.org/git/xorg/proto/x11proto \
git://git.freedesktop.org/git/xorg/proto/damageproto \
git://git.freedesktop.org/git/xorg/proto/xextproto \
git://git.freedesktop.org/git/xorg/proto/fontsproto \
git://git.freedesktop.org/git/xorg/proto/videoproto \
git://git.freedesktop.org/git/xorg/proto/renderproto \
git://git.freedesktop.org/git/xorg/proto/inputproto \
git://git.freedesktop.org/git/xorg/proto/xf86vidmodeproto \
git://git.freedesktop.org/git/xorg/proto/xf86dgaproto \
git://git.freedesktop.org/git/xorg/proto/xf86driproto \
git://git.freedesktop.org/git/xorg/proto/xcmiscproto \
git://git.freedesktop.org/git/xorg/proto/scrnsaverproto \
git://git.freedesktop.org/git/xorg/proto/bigreqsproto \
git://git.freedesktop.org/git/xorg/proto/resourceproto \
git://git.freedesktop.org/git/xorg/proto/compositeproto \
git://git.freedesktop.org/git/xorg/proto/fixesproto \
git://git.freedesktop.org/git/xorg/proto/evieproto \
git://git.freedesktop.org/git/xorg/proto/kbproto \
git://git.freedesktop.org/git/xorg/lib/libxtrans \
git://git.freedesktop.org/git/xorg/lib/libX11 \
git://git.freedesktop.org/git/xorg/lib/libXext \
git://git.freedesktop.org/git/xorg/lib/libxkbfile \
git://git.freedesktop.org/git/xorg/lib/libfontenc \
git://git.freedesktop.org/git/xorg/lib/libXfont \
git://git.freedesktop.org/git/xorg/lib/libXfixes \
git://git.freedesktop.org/git/xorg/lib/libXdamage \
git://git.freedesktop.org/git/xorg/lib/libXv \
git://git.freedesktop.org/git/xorg/lib/libXvMC \
git://git.freedesktop.org/git/xorg/lib/libXxf86vm \
git://git.freedesktop.org/git/xorg/lib/libXinerama \
git://git.freedesktop.org/git/xorg/proto/dri2proto \
git://git.freedesktop.org/git/xorg/proto/glproto \
git://git.freedesktop.org/git/xorg/lib/libpciaccess \
git://git.freedesktop.org/git/pixman \
git://git.freedesktop.org/git/xcb/proto \
git://git.freedesktop.org/git/xcb/pthread-stubs \
git://git.freedesktop.org/git/xcb/libxcb \
git://git.freedesktop.org/git/xorg/proto/randrproto \
git://git.freedesktop.org/git/mesa/drm \
git://git.freedesktop.org/git/mesa/mesa \
git://git.freedesktop.org/git/xorg/xserver \
git://git.freedesktop.org/git/xorg/driver/xf86-input-mouse \
git://git.freedesktop.org/git/xorg/driver/xf86-input-keyboard \
git://git.freedesktop.org/git/xorg/driver/xf86-video-nv"
modules="\
fontsproto \
x11proto \
xextproto \
videoproto \
renderproto \
inputproto \
damageproto \
xf86vidmodeproto \
xf86dgaproto \
xf86driproto \
xcmiscproto \
scrnsaverproto \
bigreqsproto \
resourceproto \
compositeproto \
resourceproto \
evieproto \
kbproto \
fixesproto \
libxtrans \
proto \
pthread-stubs \
libxcb \
libX11 \
libXext \
libxkbfile \
libfontenc \
libXfont \
libXv \
libXvMC \
libXxf86vm \
libXinerama \
libXfixes \
libXdamage \
dri2proto \
glproto \
libpciaccess \
pixman \
randrproto"
init()
{
for repo in $REPOS; do
echo "Cloning $repo"
git clone $repo
done
cd macros
echo "Building macros"
./autogen.sh --prefix="$PREFIX"
($MAKE)
make install
cd ..
}
update_modules()
{
for module in $modules; do
echo "Updating $module"
cd $module
git pull
cd ..
done
}
build_module()
{
cd $1
echo ======================
echo configuring $1
echo ======================
./autogen.sh --prefix="$PREFIX"
echo ======================
echo building $1
echo ======================
if [ $? -ne 0 ]; then
echo "Failed to configure $1."
exit $build_stage
fi
($MAKE)
make install
cd ..
}
build_drm()
{
cd drm
./autogen.sh --prefix="$PREFIX"
($MAKE)
make -C linux-core
# assuming you're on Linux, otherwise use bsd-core
make install
cd ..
}
build_mesa()
{
cd mesa
./autogen.sh --prefix=$PREFIX --with-driver=dri --disable-glut #--with-state-trackers="egl dri2"
if [ $? -ne 0 ]; then
echo "Failed to configure Mesa."
exit $build_stage
fi
($MAKE)
make install
mkdir -p $PREFIX/bin
install -m755 progs/xdemos/{glxinfo,glxgears} $PREFIX/bin/
cd ..
}
build_xserver()
{
cd xserver
./autogen.sh --prefix=$PREFIX --enable-builtin-fonts --with-xkb-path=/usr/share/X11/xkb
if [ $? -ne 0 ]; then
echo "Failed to configure X server."
exit $build_stage
fi
($MAKE)
make install
chown root $PREFIX/bin/Xorg
chmod +s $PREFIX/bin/Xorg
cd ..
}
build_mouse()
{
cd xf86-input-mouse
./autogen.sh --prefix=$PREFIX
($MAKE)
make install
cd ..
}
build_keyboard()
{
cd xf86-input-keyboard
./autogen.sh --prefix=$PREFIX
($MAKE)
make install
cd ..
}
build_nvidia()
{
cd xf86-video-nv
./autogen.sh --prefix=$PREFIX
($MAKE)
make install
cd ..
}
build ()
{
export ACLOCAL="aclocal -I $PREFIX/share/aclocal"
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export build_stage=0
for i in $modules; do
if [ $build_stage -ge $1 ]; then
build_module $i
fi
let "build_stage += 1"
done
# build drm
if [ $build_stage -ge $1 ]; then
build_drm
fi
let "build_stage += 1"
#build mesa
if [ $build_stage -ge $1 ]; then
build_mesa
fi
let "build_stage += 1"
#buildxserver
if [ $build_stage -ge $1 ]; then
build_xserver
fi
let "build_stage += 1"
#mouse
if [ $build_stage -ge $1 ]; then
build_mouse
fi
let "build_stage += 1"
#keyboard
if [ $build_stage -ge $1 ]; then
build_keyboard
fi
let "build_stage += 1"
#nvidia
if [ $build_stage -ge $1 ]; then
build_nvidia
fi
let "build_stage += 1"
}
case "$1" in
init)
init
;;
build)
case "$2" in
?*)
build $2
;;
*)
build 0
;;
esac
;;
update)
update_modules
;;
*)
echo "Usage: $0 init | build [stage] | update"
exit -1
esac
Follow the instructions here to get it running, you will probably need to link your xkeyboard-config to your current setup unless you want to build that too.
Comments
A New Summer with New Projects
Wed, May 13 2009 09:40 | Permalink
The focus of this summer is going to be on open source projects and CSH related projects. Now anyone who is reading this should know what open source is, but you probably don't know what I mean by a CSH project. CSH is the Computer Science House at Rochester Institute Of Technology where I am wrapping up my Freshman year. I have been living on CSH all year, and have benefited greatly from the experience.
Each year CSHers work on big projects, we have a great deal of projects that receive a good deal of work. This summer I have a few that I plan to single out. One thing I have always wanted to work on, and finally have an excuse to, is multi-touch technology. CSHers this year built a new Frustrated Total Internal Reflection (FTIR) table and has been working hard to get the hardware working as much as they can.
They are using TouchLib, or TBeta, which ever will co-operate for one demo or the next, and they are interfacing with home-brew TUIO applications that several people have been working on.
Now the part that bothers me, is that the multi-touch input completely bypasses the computers native systems, and goes directly to whatever applications are implementing the protocol. This works for demos, but it isn't a multi-touch computer, its a multi-touch demo. Multi-touch demos are all too common, but multi-touch computers are few and far between.
My first goal for this summer is to get the foundations for an open source multi-touch computer working using the groundwork already laid by Peter Hutterer with MPX, which was recently merged with the mainstream X. I have contacted Peter, and my first goal is to accomplish the task he gave me. While it is a relatively simple task, the hard part will be familiarizing myself with the X code base, and even setting up a proper building and testing environment.
Each year CSHers work on big projects, we have a great deal of projects that receive a good deal of work. This summer I have a few that I plan to single out. One thing I have always wanted to work on, and finally have an excuse to, is multi-touch technology. CSHers this year built a new Frustrated Total Internal Reflection (FTIR) table and has been working hard to get the hardware working as much as they can.
They are using TouchLib, or TBeta, which ever will co-operate for one demo or the next, and they are interfacing with home-brew TUIO applications that several people have been working on.
Now the part that bothers me, is that the multi-touch input completely bypasses the computers native systems, and goes directly to whatever applications are implementing the protocol. This works for demos, but it isn't a multi-touch computer, its a multi-touch demo. Multi-touch demos are all too common, but multi-touch computers are few and far between.
My first goal for this summer is to get the foundations for an open source multi-touch computer working using the groundwork already laid by Peter Hutterer with MPX, which was recently merged with the mainstream X. I have contacted Peter, and my first goal is to accomplish the task he gave me. While it is a relatively simple task, the hard part will be familiarizing myself with the X code base, and even setting up a proper building and testing environment.