$NetBSD: patch-aa,v 1.11 2011/01/17 16:46:42 drochner Exp $

--- configure.orig	2011-01-02 06:45:05.000000000 +0900
+++ configure	2011-01-09 21:33:08.000000000 +0900
@@ -306,6 +306,10 @@
         SYS="FREEBSD"
         LDFLAGS="$LDFLAGS -lm"
         ;;
+    dragonfly*)
+        SYS="DRAGONFLY"
+        LDFLAGS="$LDFLAGS -lm"
+        ;;
     kfreebsd*-gnu)
         SYS="FREEBSD"
         define HAVE_MALLOC_H
@@ -369,7 +373,7 @@
             ASFLAGS="$ASFLAGS -f elf"
         fi
         ;;
-    x86_64)
+    x86_64|amd64)
         ARCH="X86_64"
         AS="yasm"
         if [ "$SYS" = MACOSX ]; then
@@ -386,13 +390,14 @@
         fi
         ;;
     powerpc|powerpc64)
-        ARCH="PPC"
         if [ $asm = auto ] ; then
             define HAVE_ALTIVEC
             AS="${AS-${cross_prefix}gcc}"
             if [ $SYS = MACOSX ] ; then
+	        ARCH="POWERPC"
                 CFLAGS="$CFLAGS -faltivec -fastf -mcpu=G4"
             else
+	        ARCH="PPC"
                 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
                 define HAVE_ALTIVEC_H
             fi
@@ -522,7 +527,7 @@
 # pthread-win32 is lgpl, prevent its use if --disable-gpl is specified and targeting windows
 [ "$SYS" = "MINGW" -a "$gpl" = "no" -a "$thread" = "auto" ] && thread="win32"
 
-libpthread=""
+libpthread="$PTHREAD_LDFLAGS $PTHREAD_LIBS"
 if [ "$thread" = "auto" ]; then
     thread="no"
     case $SYS in
@@ -712,7 +717,8 @@
 fi
 
 if [ "$pic" = "yes" ] ; then
-    CFLAGS="$CFLAGS -fPIC"
+    CFLAGS="$CFLAGS"
+    PICFLAG="-prefer-pic"
     ASFLAGS="$ASFLAGS -DPIC"
     # resolve textrels in the x86 asm
     cc_check stdio.h -Wl,-Bsymbolic && LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
