$NetBSD: patch-ag,v 1.12 2009/01/22 07:27:28 jmmv Exp $

--- configure.orig	2008-01-06 20:38:42.000000000 +0100
+++ configure
@@ -44,7 +44,7 @@ case "$cpu" in
   alpha)
     cpu="alpha"
   ;;
-  "Power Macintosh"|ppc|ppc64)
+  "Power Macintosh"|ppc|ppc64|powerpc)
     cpu="powerpc"
   ;;
   mips)
@@ -136,6 +136,12 @@ if [ "$cpu" = "i386" -o "$cpu" = "x86_64
     kqemu="yes"
 fi
 ;;
+DragonFly)
+bsd="yes"
+oss="yes"
+dragonfly="yes"
+;;
+
 NetBSD)
 bsd="yes"
 oss="yes"
@@ -478,6 +484,16 @@ EOF
     fi
 fi
 
+# Check for stack protector
+cat > $TMPC <<EOF
+extern int foo;
+EOF
+if "$cc" -o $TMPE $TMPC -fno-stack-protector 2> /dev/null ; then
+  stack_protector_present="yes"
+else
+  stack_protector_present="no"
+fi
+
 #
 # Solaris specific configure tool chain decisions
 #
@@ -680,7 +696,7 @@ else
   if test -z "$prefix" ; then
       prefix="/usr/local"
   fi
-  mansuffix="/share/man"
+  mansuffix="/$PKGMANDIR"
   datasuffix="/share/qemu"
   docsuffix="/share/doc/qemu"
   binsuffix="/bin"
@@ -848,8 +864,13 @@ int main(void) { return bswap_32(0); }
 EOF
   if $cc -o $TMPE $TMPC 2> /dev/null ; then
     echo "#define HAVE_BYTESWAP_H 1" >> $config_h
+  elif test -f "/usr/include/machine/bswap.h" ; then
+    echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
   fi
 fi
+if test "$dragonfly" = "yes" ; then
+  echo "CONFIG_DRAGONFLY=yes" >> $config_mak
+fi
 if test "$darwin" = "yes" ; then
   echo "CONFIG_DARWIN=yes" >> $config_mak
   echo "#define CONFIG_DARWIN 1" >> $config_h
@@ -960,6 +981,10 @@ if [ "$bsd" = "yes" ] ; then
   echo "#define _BSD 1" >> $config_h
 fi
 
+if [ "$stack_protector_present" = "yes" ] ; then
+  echo "STACK_PROTECTOR_PRESENT=yes" >> $config_mak
+fi
+
 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
 
 tools=
