diff -uNr Mesa-7.8.2/bin/mklib Mesa-7.8.2.fink/bin/mklib
--- Mesa-7.8.2/bin/mklib	2010-06-15 13:43:41.000000000 -0400
+++ Mesa-7.8.2.fink/bin/mklib	2012-05-05 21:04:22.000000000 -0400
@@ -766,7 +766,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.8.2/configs/darwin Mesa-7.8.2.fink/configs/darwin
--- Mesa-7.8.2/configs/darwin	2010-06-15 13:43:41.000000000 -0400
+++ Mesa-7.8.2.fink/configs/darwin	2012-05-05 21:11:25.000000000 -0400
@@ -4,7 +4,7 @@
 
 CONFIG_NAME = darwin
 
-INSTALL_DIR = /usr/X11
+INSTALL_DIR = @FINKPREFIX@
 
 X11_DIR = $(INSTALL_DIR)
 
@@ -34,7 +34,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
@@ -48,11 +48,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) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
-GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
+GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L@FINKPREFIX@/lib -L@X11DIR@/lib -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt -lXm
 APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
 
-# omit glw lib for now:
-SRC_DIRS = glsl glx/apple mesa gallium glu glut/glx glew
 GLU_DIRS = sgi
 DRIVER_DIRS = osmesa
 #DRIVER_DIRS = dri
diff -uNr Mesa-7.8.2/configs/default Mesa-7.8.2.fink/configs/default
--- Mesa-7.8.2/configs/default	2010-06-16 17:22:17.000000000 -0400
+++ Mesa-7.8.2.fink/configs/default	2012-05-05 21:14:37.000000000 -0400
@@ -53,7 +53,7 @@
 GLU_LIB = GLU
 GLUT_LIB = glut
 GLEW_LIB = GLEW
-GLW_LIB = GLw
+GLW_LIB = GLw-@MOTIF@
 OSMESA_LIB = OSMesa
 EGL_LIB = EGL
 
@@ -80,13 +80,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 = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw
+SRC_DIRS = glw
 GLU_DIRS = sgi
 DRIVER_DIRS = x11 osmesa
 # Which subdirs under $(TOP)/progs/ to enter:
@@ -114,7 +114,7 @@
 OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
 GLU_LIB_DEPS    = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
 GLUT_LIB_DEPS   = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
-GLW_LIB_DEPS    = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
+GLW_LIB_DEPS    = -l$(GL_LIB) -lXt -lX11
 APP_LIB_DEPS    = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
 
 # Program dependencies - specific GL/glut libraries added in Makefiles
diff -uNr Mesa-7.8.2/src/glw/Makefile Mesa-7.8.2.fink/src/glw/Makefile
--- Mesa-7.8.2/src/glw/Makefile	2010-02-04 19:10:40.000000000 -0500
+++ Mesa-7.8.2.fink/src/glw/Makefile	2012-05-05 21:07:29.000000000 -0400
@@ -38,13 +38,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
-	$(MINSTALL) $(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
@@ -57,7 +57,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)
 
 
 #
