--- configure.orig	2013-12-12 18:52:32.304356162 +0000
+++ configure	2013-12-12 19:50:44.434111814 +0000
@@ -5393,7 +5393,7 @@
     ;;
 *freebsd* | dragonfly*)
     case "$host_cpu" in
-    i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
+    i*86|x86_64|ia64|powerpc*|sparc*) default_driver="dri";;
     esac
     ;;
 esac
@@ -6946,12 +6946,35 @@
             CXXFLAGS="$CXXFLAGS -ansi -pedantic"
         fi
 
-        # ffb and gamma are missing because they have not been converted
-        # to use the new interface.
-        if test "x$DRI_DIRS" = "xyes"; then
-            DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
+        case "$host_cpu" in
+        x86_64|ia64)
+            # i810 is missing because there is no x86-64 system where it
+            # could *ever* be used.
+            if test "x$DRI_DIRS" = "xyes"; then
+                DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
                 unichrome savage sis swrast"
-        fi
+            fi
+            ;;
+        i*86)
+            if test "x$DRI_DIRS" = "xyes"; then
+                DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
+                unichrome savage sis swrast"
+            fi
+            ;;
+        powerpc*)
+            # Build only the drivers for cards that exist on PowerPC.
+            # At some point MGA will be added, but not yet.
+            if test "x$DRI_DIRS" = "xyes"; then
+                DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
+            fi
+            ;;
+        sparc*)
+            # Build only the drivers for cards that exist on SPARC.
+            if test "x$DRI_DIRS" = "xyes"; then
+                DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
+            fi
+            ;;
+        esac
         ;;
     gnu*)
         DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
