diff -uNr Mesa-7.2/bin/mklib Mesa-7.2.fink/bin/mklib
--- Mesa-7.2/bin/mklib	2008-08-25 10:46:41.000000000 -0400
+++ Mesa-7.2.fink/bin/mklib	2009-01-01 10:12:42.000000000 -0500
@@ -638,7 +638,7 @@
             else
                 LIBSUFFIX="dylib"
                 if [ -z "$ID" ] ; then
-                    ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
+                    ID="@FINKPREFIX@/lib/liblib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
                 fi
                 OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}"
             fi
diff -uNr Mesa-7.2/configs/darwin Mesa-7.2.fink/configs/darwin
--- Mesa-7.2/configs/darwin	2008-08-25 10:46:41.000000000 -0400
+++ Mesa-7.2.fink/configs/darwin	2009-01-01 11:12:05.000000000 -0500
@@ -4,7 +4,7 @@
 
 CONFIG_NAME = darwin
 
-INSTALL_DIR = /usr/X11
+INSTALL_DIR = @FINKPREFIX@
 
 # Compiler and flags
 CC = gcc
@@ -29,7 +29,7 @@
 GL_LIB_NAME = libGL.dylib
 GLU_LIB_NAME = libGLU.dylib
 GLUT_LIB_NAME = libglut.dylib
-GLW_LIB_NAME = libGLw.dylib
+GLW_LIB_NAME = libGLw-@MOTIF@.dylib
 OSMESA_LIB_NAME = libOSMesa.dylib
 
 # globs used to install the lib and all symlinks
@@ -43,11 +43,9 @@
 OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
 GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
 GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB)  -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
-GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt
+GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -l$(GL_LIB) /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt -L/@FINKPREFIX@/lib -lXm
 APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
 
-# omit glw lib for now:
-SRC_DIRS = glx/x11 mesa glu glw glut/glx
 GLU_DIRS = sgi
 DRIVER_DIRS = osmesa
 #DRIVER_DIRS = dri
diff -uNr Mesa-7.2/configs/default Mesa-7.2.fink/configs/default
--- Mesa-7.2/configs/default	2008-09-13 16:32:10.000000000 -0400
+++ Mesa-7.2.fink/configs/default	2009-01-01 10:12:42.000000000 -0500
@@ -43,7 +43,7 @@
 GL_LIB = GL
 GLU_LIB = GLU
 GLUT_LIB = glut
-GLW_LIB = GLw
+GLW_LIB = GLw-@MOTIF@
 OSMESA_LIB = OSMesa
 
 
@@ -66,13 +66,13 @@
 
 # GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
 # order to build the Motif widget too)
-GLW_SOURCES = GLwDrawA.c
-MOTIF_CFLAGS = -I/usr/include/Motif1.2
+GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
+MOTIF_CFLAGS = -I@FINKPREFIX@/include
 
 
 # Directories to build
 LIB_DIR = lib
-SRC_DIRS = mesa glu glut/glx glw
+SRC_DIRS = glw
 GLU_DIRS = sgi
 DRIVER_DIRS = x11 osmesa
 # Which subdirs under $(TOP)/progs/ to enter:
@@ -85,7 +85,7 @@
 OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
 GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
 GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXi -lm
-GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
+GLW_LIB_DEPS = -l$(GL_LIB) -lXt -lX11
 
 # Program dependencies - specific GL/glut libraries added in Makefiles
 APP_LIB_DEPS = -lm
diff -uNr Mesa-7.2/src/glw/Makefile Mesa-7.2.fink/src/glw/Makefile
--- Mesa-7.2/src/glw/Makefile	2008-08-25 10:46:42.000000000 -0400
+++ Mesa-7.2.fink/src/glw/Makefile	2009-01-01 10:12:42.000000000 -0500
@@ -34,13 +34,13 @@
 glw.pc: glw.pc.in
 	$(pcedit) $< > $@
 
-install: glw.pc
+install: 
 	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
 	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
 	$(INSTALL) -m 644 *.h $(DESTDIR)$(INSTALL_INC_DIR)/GL
-	$(INSTALL) $(TOP)/$(LIB_DIR)/$(GLW_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
-	$(INSTALL) -m 644 glw.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
+	$(INSTALL) $(TOP)/$(LIB_DIR)/lib$(GLW_LIB).$(MAJOR).$(MINOR).dylib $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) $(TOP)/$(LIB_DIR)/lib$(GLW_LIB).$(MAJOR).dylib $(DESTDIR)$(INSTALL_LIB_DIR)
+	$(INSTALL) $(TOP)/$(LIB_DIR)/lib$(GLW_LIB).dylib $(DESTDIR)$(INSTALL_LIB_DIR)
 
 clean:
 	-rm -f depend depend.bak
@@ -53,7 +53,7 @@
 		-major $(MAJOR) -minor $(MINOR) -patch $(TINY) \
 		$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
 		-id $(INSTALL_LIB_DIR)/lib$(GLW_LIB).$(MAJOR).dylib \
-		$(GLW_LIB_DEPS) $(OBJECTS)
+		$(OBJECTS) $(GLW_LIB_DEPS)
 
 
 #
