tar xzvf MesaLib-3.0.tar.gz
tar xzvf MesaDemos-3.0.tar.gz
cd Mesa-3.0
make linux-elf
make linux-elf-shared
# I like these better, actually.  But then you have to link with -pthread,
# which none of the Mesa sources I've come across are able to automatically
# detect.  So, I fear building them this way will confuse the average user.
# Still, I'm adding in these commented out make lines in case you have an
# SMP machine and/or are building with threads:
#make linux-386-pthread
#make linux-386-pthread-shared
( cd widgets-mesa
 ./configure --prefix=/usr/X11R6 --with-x
 make
 make demo.gl
 make demo.mesa
 make demo.ws 
 make demo.tea )
mkdir -p /usr/include/GL
cp -a include/GL/*.h /usr/include/GL
chown root.root /usr/include/GL/*
cp -a lib/* /usr/lib
( cd /usr/lib ; rm -f libGL.a ; ln -sf libMesaGL.a libGL.a )
( cd /usr/lib ; rm -f libGLU.a ; ln -sf libMesaGLU.a libGLU.a )
( cd /usr/lib ; rm -f libGL.so ; ln -sf libMesaGL.so libGL.so )
( cd /usr/lib ; rm -f libGLU.so ; ln -sf libMesaGLU.so libGLU.so )
# Make documentation directory: 
mkdir -p /usr/doc/Mesa-3.0
cp -a CONFORM FUTURE IAFA-PACKAGE LICENSE README* RELNOTES VERSIONS /usr/doc/Mesa-3.0
chown root.root /usr/doc/Mesa-3.0/*
chmod 644 /usr/doc/Mesa-3.0/*
# Install the Mesa demos:
mkdir -p /usr/lib/Mesa
cp -a demos xdemos book samples 3Dfx/demos mtdemos ggi/demos /usr/lib/Mesa
# Install the Mesa widgets:
mkdir -p /usr/X11R6/include/GL
( cd widgets-mesa ; make install )
# Widget demos, docs symlink:
mkdir -p /usr/lib/Mesa/widgets-mesa
( cd widgets-mesa ; cp -a COPYING ChangeLog README TODO demos /usr/lib/Mesa/widgets-mesa )
chown -R root.root /usr/lib/Mesa
( cd /usr/doc/Mesa-3.0 ; ln -sf /usr/lib/Mesa demos )
chmod 755 /usr/lib/Mesa
