$NetBSD: patch-aa,v 1.7 2005/12/11 11:20:51 markd Exp $

--- configure.orig	2005-11-26 20:14:02.000000000 +1300
+++ configure
@@ -34500,7 +34500,7 @@ fi
 
   if test "x$have_ossaudio" = xyes; then
     # for kmix/ and akode/
-    LIBOSSAUDIO="-lossaudio"
+    LIBOSSAUDIO="${LIBOSSAUDIO}"
   fi
 
 
@@ -35097,7 +35097,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <cdda_interface.h>
+#include <cdparanoia/cdda_interface.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -35141,7 +35141,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <cdda_interface.h>
+#include <cdparanoia/cdda_interface.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -37888,7 +37888,7 @@ if test "${ac_cv_lib_FLAC_FLAC__seekable
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lFLAC  $LIBS"
+LIBS="-lFLAC -lm $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -40058,8 +40058,23 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-                x11_dga2=yes
-
+ 	lib=Xxf86dga
+ 	shared_lib_found=no
+ 	for i in ${LDFLAGS}; do
+ 		case "$i" in
+ 		-L*)
+ 			dir=`echo $i | sed "s,^-L,,"`
+ 			if [ -e $dir/lib${lib}.so ] ||
+ 			   [ "`echo $dir/lib${lib}.so.*`" != "$dir/lib${lib}.so.*" ]; then
+ 				shared_lib_found=yes
+ 				break;
+ 			fi
+ 		esac
+ 	done
+ 	if [ "$shared_lib_found" = "yes" ]; then
+ 		x11_dga2=yes
+ 	fi
+   
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -40122,7 +40137,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
+       lib=Xv
+       shared_lib_found=no
+      for i in ${LDFLAGS}; do
+                case "$i" in
+               -L*)
+                       dir=`echo $i | sed "s,^-L,,"`
+                       if [ -e $dir/lib${lib}.so ] ||
+                          [ "`echo $dir/lib${lib}.so.*`" != "$dir/lib${lib}.so.*" ]; then
+                               shared_lib_found=yes
+                               break;
+                       fi
+               esac
+        done
+       if [ "$shared_lib_found" = "yes" ]; then
                 x11_xv=yes
+       fi
 
 else
   echo "$as_me: failed program was:" >&5
@@ -40186,7 +40216,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
+       lib=Xxf86vm
+       shared_lib_found=no
+       for i in ${LDFLAGS}; do
+                case "$i" in
+               -L*)
+                       dir=`echo $i | sed "s,^-L,,"`
+                       if [ -e $dir/lib${lib}.so ] ||
+                          [ "`echo $dir/lib${lib}.so.*`" != "$dir/lib${lib}.so.*" ]; then
+                               shared_lib_found=yes
+                               break;
+                       fi
+               esac
+       done
+       if [ "$shared_lib_found" = "yes" ]; then
                 x11_xvidmode=yes
+       fi
 
 else
   echo "$as_me: failed program was:" >&5
@@ -40536,10 +40581,10 @@ _ACEOF
     ;;
 
   NetBSD)
-    echo "$as_me:$LINENO: result: NetBSD :Unknown hardware. You will have problems!!" >&5
-echo "${ECHO_T}NetBSD :Unknown hardware. You will have problems!!" >&6
-    OS_TYPE="BSD"
-
+     echo "$as_me:$LINENO: result: using -lpthread" >&5
+     echo $ECHO_N "using -lpthread... $ECHO_C" >&6
+     OS_TYPE="BSD"
+     LIBPTHREAD="-lpthread"
 cat >>confdefs.h <<\_ACEOF
 #define OS_BSD 1
 _ACEOF
