$NetBSD: patch-aa,v 1.12 2005/07/21 14:24:48 wiz Exp $

--- configure.orig	2005-04-13 13:46:35.000000000 +0200
+++ configure
@@ -408,7 +408,7 @@ for ac_option do
     _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'`
     ;;
   --enable-runtime-cpudetection)
     _runtime_cpudetection=yes
@@ -596,7 +596,7 @@ if test "$_skip_cc_check" != yes ; then
   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
@@ -743,7 +743,7 @@ case "$host_arch" in
 
   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`
 
@@ -1797,7 +1797,8 @@ for ac_option do
     _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
     ;;
   --with-x11libdir=*)
-    _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
+#    _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
+    _ld_x11="${_ld_x11} -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-dxr2incdir=*)
     _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
@@ -2382,7 +2383,7 @@ echores "$_posix4"
 echocheck "lrintf"
 cat > $TMPC << EOF
 #include <math.h>
-int main(void) { (void) lrintf(0.0); return 0; }
+int main(void) { long (*foo)(double); foo = lrintf; (void)(*foo)(0.0); return 0; }
 EOF
 _lrintf=no
 cc_check $_ld_lm && _lrintf=yes
@@ -3788,7 +3789,7 @@ fi
 if test "$_aa" = yes ; then
   _def_aa='#define HAVE_AA 1'
   if cygwin ; then
-    _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
+    _ld_aa=`${AALIB_CONFIG} --libs | cut -d " " -f 2,5,6`
   fi
   _vosrc="$_vosrc vo_aa.c"
   _vomodules="aa $_vomodules"
