$NetBSD: patch-aa,v 1.10 2010/05/07 09:34:43 drochner Exp $

--- configure.orig	2009-09-20 20:45:09.000000000 +0000
+++ configure
@@ -117,7 +117,7 @@ for opt do
             LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
             ;;
         --enable-pthread)
-            pthread="auto" # can't skip detection, since it differs by OS
+            pthread="yes"
             ;;
         --disable-pthread)
             pthread="no"
@@ -137,7 +137,7 @@ for opt do
             shared="yes"
             ;;
         --enable-visualize)
-            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+            LDFLAGS="$LDFLAGS -lX11"
             CFLAGS="$CFLAGS -DVISUALIZE=1"
             vis="yes"
             ;;
@@ -187,6 +187,10 @@ case $host_os in
     SYS="FREEBSD"
     LDFLAGS="$LDFLAGS -lm"
     ;;
+  dragonfly*)
+    SYS="DRAGONFLY"
+    LDFLAGS="$LDFLAGS -lm"
+    ;;
   kfreebsd*-gnu)
     SYS="FREEBSD"
     CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
@@ -250,7 +254,7 @@ case $host_cpu in
       ASFLAGS="$ASFLAGS -f elf"
     fi
     ;;
-  x86_64)
+  x86_64|amd64)
     ARCH="X86_64"
     AS="yasm"
     if [ "$SYS" = MACOSX ];then
@@ -264,11 +268,11 @@ case $host_cpu in
     fi
     ;;
   powerpc|powerpc64)
-    ARCH="PPC"
     if [ $SYS = MACOSX ]
     then
-      ALTIVECFLAGS="$ALTIVECFLAGS -faltivec -fastf -mcpu=G4"
+      ARCH="POWERPC"
     else
+      ARCH="PPC"
       ALTIVECFLAGS="$ALTIVECFLAGS -maltivec -mabi=altivec -DHAVE_ALTIVEC_H"
     fi
     ;;
@@ -354,7 +358,7 @@ grep -q BIGE conftest.o && CFLAGS="$CFLA
 
 # autodetect options that weren't forced nor disabled
 
-libpthread=""
+libpthread="$PTHREAD_LDFLAGS $PTHREAD_LIBS"
 if test "$pthread" = "auto" ; then
     pthread="no"
     case $SYS in
@@ -387,7 +391,7 @@ if test "$pthread" = "auto" ; then
     esac
 fi
 if test "$pthread" = "yes" ; then
-    CFLAGS="$CFLAGS -DHAVE_PTHREAD"
+    CFLAGS="$CFLAGS -DHAVE_PTHREAD $PTHREAD_CFLAGS"
     LDFLAGS="$LDFLAGS $libpthread"
 fi
 
@@ -424,7 +428,8 @@ if [ "$avis_input" = "yes" ] ; then
 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"
