--- configure.orig	2008-03-04 16:23:23.000000000 -0500
+++ configure	2009-03-03 18:10:09.000000000 -0500
@@ -1149,6 +1149,17 @@
     fi 
 fi 
 
+# BSD.
+if uname -s | grep BSD > 0; then
+    dmesg=/var/run/dmesg.boot
+    if test -f $dmesg ; then
+        processor=`grep ^CPU: $dmesg`
+# processor_flags is used only to determine whether the processor
+# supports MMX.  The script expexts lower-case 'mmx'.  Give it to it.
+        processor_flags=`grep '^  Features=' $dmesg | tr "[:upper:]" "[:lower:]"`
+    fi
+fi
+
 # OS
 targetos=$(tolower $(uname -s))
 
@@ -1466,7 +1477,7 @@
   x86_64|amd64)
     arch="x86_32"
     enable fast_unaligned
-    canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
+    canon_arch="`$cxx -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
     if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
       if [ -z "`echo $CFLAGS | grep -- -m32`"  ]; then
         arch="x86_64"
