Compilation Instructions for Mesa3D, GLUT, and your own programs under Famliar Linux


This document has been tested with MesaLib-4.0.3 under Linux kernel 2.4.18-rmk3 and glut-3.7 under X11R6 (XFree86-4.2.0).
Mesa3D is actually very easy to compile. Following the instructions does work if you
have a large enough disk. However, most iPAQs don't, so you should have some kind
of development platform with about 70 megs of disk space available. Install gcc and
task-gcc from an ipkg feed by running:

ipkg update
ipkg install gcc
ipkg install task-gcc

Once gcc is installed, you should follow Mesa3D's README file on how to compile
for linux. It's very straightforward if you want to install to the default locations. However
if you do not, simply create a temporary directory:
i.e. mkdir /home/username/mesainstall
and set it as your prefix (instead of /usr/local):
./configure --prefix=/home/username/mesainstall
Once that's compiled, look in the directory. You can now copy those over to your intended
iPAQ under /usr/local, where gcc on that machine will locate them nicely.
One thing to watch out for: if you're using scp to copy files over, it will not copy symlinks as
symlinks and instead, fill your memory up with an additional 10 megabytes! Copy only the files
and not the links and relink afterwards! Congratulations! Mesa is now installed.

To install GLUT, it is equally straightforward. After extracting the tarball, follow linux/README
as it says. Before you come to the make step in step 4) you should go edit the Makefile. The -m486
option should be deleted from all instances of CDEBUGFLAGS = -O2 -m486
glut will not compile with the -m486 flag on.
After compilation, simply copy the lib/glut/libglut.so.3.7 file over to your intended iPAQ and link them
as it shows you in the README file. There is no need to use the path thing if you put it under
/usr/local/lib. Also copy over everything under include/GL over to /usr/local
I.e. glut-3.7/include/GL/glut.h goes to /usr/local/include/GL
To get your programs to work with glut, you may need to install libxt if it's not installed.

Compiling your own glut applications

Everything works just like on a desktop. For new users, the pitfall is not linking correctly.
gcc -lm -lGL -lGLU -lglut source.c
should give you a perfectly working a.out
Enjoy!