diff -Naur mesa-7.1rc1-20080706.orig/bin/mklib mesa-7.1rc1-20080706/bin/mklib
--- mesa-7.1rc1-20080706.orig/bin/mklib	2008-07-06 14:09:54.000000000 +0200
+++ mesa-7.1rc1-20080706/bin/mklib	2008-07-06 14:11:03.000000000 +0200
@@ -211,9 +211,9 @@
 	if [ "x$LINK" = "x" ] ; then
 	    # -linker was not specified so set default link command now
             if [ $CPLUSPLUS = 1 ] ; then
-                LINK=g++
+                LINK=$CXX
             else
-                LINK=gcc
+                LINK=$CC
             fi
 	fi
 
diff -Naur mesa-7.1rc1-20080706.orig/configs/linux-dri mesa-7.1rc1-20080706/configs/linux-dri
--- mesa-7.1rc1-20080706.orig/configs/linux-dri	2008-07-06 14:09:54.000000000 +0200
+++ mesa-7.1rc1-20080706/configs/linux-dri	2008-07-06 14:16:00.000000000 +0200
@@ -14,6 +14,7 @@
 #MKDEP_OPTIONS = -MF depend
 
 OPT_FLAGS  = -O2 -g
+HOST_OPT_FLAGS = $(OPT_FLAGS)
 PIC_FLAGS  = -fPIC
 
 # Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
@@ -29,6 +30,8 @@
 
 CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
 	$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
+HOST_CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
+	$(HOST_OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
 
 CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
 
