$NetBSD: patch-aa,v 1.19 2007/12/21 16:07:48 tron Exp $

--- configure.orig	2007-10-07 20:49:33.000000000 +0100
+++ configure	2007-12-21 15:21:48.000000000 +0000
@@ -718,7 +718,7 @@
     _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
     ;;
   --with-extralibdir=*)
-    _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
+    _ld_extra="${_ld_extra} -Wl,-R"`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -Wl\,-R,g'`" -L"`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
     ;;
 
   --with-install=*)
@@ -1411,11 +1411,11 @@
   esac
   echores "$cc_version"
  else
- for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
+ for _cc in "$_cc" gcc cc ; do
   echocheck "$_cc version"
   cc_vendor=gnu
   cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
-  cc_version=`$_cc -dumpversion 2>&1`
+  cc_version=`( $_cc -dumpversion | sed -e 's/-nb[0-9]//' ) 2>&1`
   if test "$?" -gt 0; then
     cc_version="not found"
   fi
@@ -1548,7 +1548,7 @@
   # gather more CPU information
   pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
   pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2 | _head 1`
-  pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
+  pfamily=`$_cpuinfo | grep -i 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
   pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
   pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
 
@@ -3098,7 +3098,6 @@
 echores "$_w32threads"
 
 echocheck "rpath"
-netbsd &&_rpath=yes
 if test "$_rpath" = yes ; then
   for I in `echo $_ld_extra | sed 's/-L//g'` ; do
     tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
@@ -3884,7 +3883,11 @@
   for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
            -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
     if netbsd; then
-      _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
+      if test -n "$I" ; then
+        _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
+      else
+        _ld_tmp="-lXext -lX11 $_ld_pthread"
+      fi
     else
       _ld_tmp="$I -lXext -lX11 $_ld_pthread"
     fi
@@ -4368,7 +4371,7 @@
 if test "$_aa" = yes ; then
   _def_aa='#define HAVE_AA 1'
   if cygwin ; then
-    _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
+    _libs_mplayer="$_libs_mplayer `${AALIB_CONFIG} --libs | cut -d " " -f 2,5,6`"
   fi
   _vosrc="$_vosrc vo_aa.c"
   _vomodules="aa $_vomodules"
