$NetBSD: patch-aa,v 1.6 2008/12/18 16:19:07 bjs Exp $

--- configure.orig	2008-12-12 16:45:07.000000000 -0500
+++ configure
@@ -130,7 +130,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"
@@ -150,7 +150,7 @@ for opt do
             shared="yes"
             ;;
         --enable-visualize)
-            LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+            LDFLAGS="$LDFLAGS -lX11"
             CFLAGS="$CFLAGS -DVISUALIZE=1"
             vis="yes"
             ;;
@@ -192,6 +192,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"
@@ -247,7 +251,7 @@ case $host_cpu in
       ASFLAGS="$ASFLAGS -f elf"
     fi
     ;;
-  x86_64)
+  x86_64|amd64)
     ARCH="X86_64"
     if [ "$SYS" = MACOSX ];then
       ASFLAGS="-f macho64 -m amd64 -DPIC -DPREFIX"
@@ -258,11 +262,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"
     fi
     ;;
@@ -322,7 +326,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
@@ -348,7 +352,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
 
@@ -378,7 +382,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"
