There are only a few modifications you need to make to the
robot.c sample to get it compiled on your Mac. These
instructions were tested under OS X 10.3 (Panther) with XCode 1.1.
XCode comes with everything you need to build GL apps, including stable versions of OpenGL, GLUT, gcc and all the related make tools.
XCode by default places the include files for GLUT in a different location than MESA, so to build robot.c you need to change line 46 from
#include <GL/glut.h>
to
#include <GLUT/glut.h>
After making this change you are ready to build from the command line:
gcc -framework GLUT -framework OpenGL -framework Cocoa
robot.c -o robot
Note the use of the -framework option to make use
of OS X's packaged libraries. The Cocoa framework provides the OS
services required by GLUT, such as interfacing with the window
manager (Aqua).
I will post a sample makefile here which can be used to compile your files under OS X or Linux as necessary without modification; as soon as my Sutherland account is activated.