Index: Configure
--- Configure.orig	2012-04-10 18:35:48.000000000 +0200
+++ Configure	2012-08-03 12:18:36.290850960 +0200
@@ -440,7 +440,7 @@
       fi	# }
     fi	# }
     LSOF_TGT="aix"
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
 
@@ -594,7 +594,7 @@
 
 	    rm -f dialects/aix/aix5/j2/j2_snapshot.h
 	  fi	# }
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 
@@ -632,7 +632,7 @@
       # This is AIX >= 5 on ia64.
 
 	LSOF_TSTK64=1
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 
@@ -709,7 +709,7 @@
 	  fi	# }
 	  LSOF_TSTK64=1
 	  LSOF_TMP1=1
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 	    LSOF_CFGF="$LSOF_CFGF -maix64"
@@ -756,7 +756,7 @@
     fi	#}
     LSOF_CFGF="$LSOF_CFGF -DAIXV=$LSOF_VERS"
     LSOF_DIALECT_DIR=aix
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0 	# {
     then
 
@@ -2269,7 +2269,7 @@
 	fi	# }
       fi	# }
     fi	# }
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
       LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
@@ -2323,7 +2323,7 @@
       then
 	LSOF_CFGF="$LSOF_CFGF -Ae +DD32"
       else
-	echo $LSOF_CC | grep -q gcc
+	$LSOF_CC --version | grep -q GCC
 	if test $? -ne 0	# {
 	then
 	  LSOF_CFGF="$LSOF_CFGF +DD32"
@@ -2407,7 +2407,7 @@
 	    echo "* NOTICE!  Configuring for 64 bit HP-UX *"
 	    echo "*                                       *"
 	    echo "*****************************************"
-	    echo $LSOF_CC | grep gcc > /dev/null
+	    $LSOF_CC --version | grep GCC > /dev/null
 	    if test $? -eq 0	# {
 	    then
 
@@ -2476,7 +2476,7 @@
 	  else
 	    LSOF_CFGF="$LSOF_CFGF -D_FILE_OFFSET_BITS=64"
 	    LSOF_CINFO="${LSOF_CINFO}, 32 bit HP-UX"
-	    echo $LSOF_CC | grep gcc > /dev/null
+	    $LSOF_CC --version | grep GCC > /dev/null
 	    if test $? -ne 0	# {
 	    then
 	      LSOF_CFGF="$LSOF_CFGF +DAportable"
@@ -3710,7 +3710,7 @@
 	LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
       fi	# }
     fi	# }
-    echo $LSOF_CC | grep gcc > /dev/null
+    $LSOF_CC --version | grep GCC > /dev/null
     if test $? -eq 0	# {
     then
       LSOF_CFGL="$LSOF_CFGL -w"
@@ -4355,6 +4355,9 @@
 	LSOF_TSTBIGF=" "
 	LSOF_TSTLFLG="-lsocket -lnsl"
 	LSOF_VERS="100000"
+ 	if [ ".`isainfo -k`" = .amd64 ]; then
+ 	    LSOF_CFGL="$LSOF_CFGL -lmp -lmd5 -lscf -ldoor -luutil"
+ 	fi
 	;;
       5.11*)
 	LSOF_TSTBIGF=" "
@@ -4446,7 +4449,7 @@
 	echo "main(){" >> ${LSOF_TMPC}.c
 	echo "enum prnodetype p=PR_GWINDOWS;}" >> ${LSOF_TMPC}.c
 	echo "Testing prdata.h for PR_GWINDOWS, using $LSOF_CC"
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x  > /dev/null 2>&1
@@ -4471,7 +4474,7 @@
 	echo "main(){" >> ${LSOF_TMPC}.c
 	echo "enum prnodetype p=PR_LDT;}" >> ${LSOF_TMPC}.c
 	echo "Testing prdata.h for PR_LDT, using $LSOF_CC"
-	echo $LSOF_CC | grep gcc > /dev/null
+	$LSOF_CC --version | grep GCC > /dev/null
 	if test $? -eq 0	# {
 	then
 	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
@@ -4505,7 +4508,7 @@
 	echo $SOLARIS_KERNBITS | grep 64 > /dev/null
 	if test $? -eq 0	# {
 	then
-	  echo $LSOF_CC | grep gcc > /dev/null
+	  $LSOF_CC --version | grep GCC > /dev/null
 	  if test $? -eq 0	# {
 	  then
 
@@ -4836,7 +4839,7 @@
       echo "main(){" >> ${LSOF_TMPC}.c
       echo "enum vtype p=VSOCK;}" >> ${LSOF_TMPC}.c
       echo "Testing vnode.h for VSOCK, using $LSOF_CC"
-      echo $LSOF_CC | grep gcc > /dev/null
+      $LSOF_CC --version | grep GCC > /dev/null
       if test $? -eq 0	# {
       then
 	$LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
@@ -5525,7 +5528,7 @@
     echo "$i" >> $LSOF_TSTCFLG
   done	# }
 fi	# }
-echo $LSOF_CC | grep gcc > /dev/null 2>&1
+$LSOF_CC --version | grep GCC > /dev/null 2>&1
 if test $? -eq 0	# {
 then
   echo "-DLT_GCC" >> $LSOF_TSTCFLG
Index: dialects/freebsd/machine.h
--- dialects/freebsd/machine.h.orig	2010-07-29 18:04:31.000000000 +0200
+++ dialects/freebsd/machine.h	2012-08-03 12:18:36.291289597 +0200
@@ -441,6 +441,11 @@
  */
 
 /* #define	HASSECURITY	1 */
+#if    FREEBSDV>=6000
+#define        HASSECURITY     1
+#define        HAS_SI_PRIV     1
+#endif /* FREEBSDV>=6000 */
+
 
 
 /*
Index: dialects/sun/machine.h
--- dialects/sun/machine.h.orig	2011-09-07 21:16:07.000000000 +0200
+++ dialects/sun/machine.h	2012-08-03 12:18:36.291671855 +0200
@@ -105,6 +105,7 @@
 #include <sys/poll.h>
 
 # if	solaris>=80000
+#include <sys/types32.h>
 #include <sys/wait.h>
 #include <sys/types32.h>
 #define	_KERNEL	1
