--- config.orig	2014-01-06 08:47:42.000000000 -0500
+++ config	2014-03-09 12:35:57.656124774 -0400
@@ -197,7 +197,7 @@
 	echo "${MACHINE}-whatever-bsdi"; exit 0
 	;;
 
-    FreeBSD:*:*:*386*)
+    MidnightBSD:*:*:*386*)
         VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'`
         MACH=`sysctl -n hw.model`
         ARCH='whatever'
@@ -214,7 +214,7 @@
         echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
         ;;
 
-    FreeBSD:*)
+    MidnightBSD:*)
 	echo "${MACHINE}-whatever-freebsd"; exit 0
 	;;
 
@@ -734,14 +734,8 @@
   sparc64-*-*bsd*)	OUT="BSD-sparc64" ;;
   ia64-*-*bsd*)		OUT="BSD-ia64" ;;
   amd64-*-*bsd*)	OUT="BSD-x86_64" ;;
-  *86*-*-*bsd*)		# mimic ld behaviour when it's looking for libc...
-			if [ -L /usr/lib/libc.so ]; then	# [Free|Net]BSD
-			    libc=/usr/lib/libc.so
-			else					# OpenBSD
-			    # ld searches for highest libc.so.* and so do we
-			    libc=`(ls /usr/lib/libc.so.* /lib/libc.so.* | tail -1) 2>/dev/null`
-			fi
-			case "`(file -L $libc) 2>/dev/null`" in
+  *86*-*-*bsd*)	
+			case "`(file -L /bin/sh) 2>/dev/null`" in
 			*ELF*)	OUT="BSD-x86-elf" ;;
 			*)	OUT="BSD-x86"; options="$options no-sse2" ;;
 			esac ;;
@@ -880,7 +874,7 @@
 fi
 
 case "$GUESSOS" in
-  i386-*) options="$options 386" ;;
+  i386-*) options="$options" ;;
 esac
 
 for i in aes bf camellia cast des dh dsa ec hmac idea md2 md5 mdc2 rc2 rc4 rc5 ripemd rsa seed sha
