$NetBSD: patch-aa,v 1.26 2010/12/05 16:42:16 tsutsui Exp $ --- configure.orig 2010-09-13 03:12:07.000000000 +0000 +++ configure @@ -1471,6 +1471,12 @@ if test -z "$_target" ; then powerpc) # Darwin returns 'powerpc' host_arch=ppc ;; + mipseb|mipsel) # NetBSD + host_arch=mips + ;; + sh3eb|sh3el) # NetBSD + host_arch=sh + ;; *) # uname -p on Linux returns 'unknown' for the processor type, # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' @@ -1488,7 +1494,8 @@ if test -z "$_target" ; then sparc64) host_arch=sparc64 ;; parisc*|hppa*|9000*) host_arch=hppa ;; arm*|zaurus|cats) host_arch=arm ;; - sh3|sh4|sh4a) host_arch=sh ;; + sh3) host_arch=sh ;; + sh4|sh4a) host_arch=sh4 ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; *mips*) host_arch=mips ;; @@ -1645,7 +1652,7 @@ else cc_name=$cc_name_tmp echocheck "$_cc version" cc_vendor=gnu - cc_version=$($_cc -dumpversion 2>&1) + cc_version=$( ( $_cc -dumpversion | sed -e 's/-nb[0-9]//' ) 2>&1 ) case $cc_version in 2.96*) cc_fail=yes @@ -1763,7 +1770,7 @@ if x86 ; then # gather more CPU information pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1) pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) - pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) + pfamily=$($_cpuinfo | grep -i 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) @@ -2238,7 +2245,12 @@ case "$host_arch" in test $_fast_clz = "auto" && _fast_clz=yes ;; - sh|sh4) + sh) + arch='sh' + iproc='sh' + ;; + + sh4) arch='sh4' iproc='sh4' ;; @@ -3713,7 +3725,6 @@ test "$_w32threads" = yes && def_threads echores "$_w32threads" echocheck "rpath" -netbsd &&_rpath=yes if test "$_rpath" = yes ; then for I in $(echo $extra_ldflags | sed 's/-L//g') ; do tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')" @@ -3978,7 +3989,6 @@ echores "$_vsscanf" echocheck "swab()" cat > $TMPC << EOF -#define _XOPEN_SOURCE 600 #include int main(void) { swab(0, 0, 0); return 0; } EOF @@ -4488,7 +4498,11 @@ EOF -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -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 @@ -5623,8 +5637,13 @@ if test "$_ivtv" = auto ; then cat > $TMPC << EOF #include #include ++#ifdef __linux__ #include #include +#elif defined(__NetBSD__) || defined(__OpenBSD__) +#include +#include +#endif #include #include int main(void) { @@ -8057,7 +8076,7 @@ echores "$_tv_v4l1" echocheck "Video 4 Linux 2 TV interface" if test "$_tv_v4l2" = auto ; then _tv_v4l2=no - if test "$_tv" = yes && linux ; then + if test "$_tv" = yes && (linux || netbsd || openbsd) ; then header_check linux/videodev2.h && _tv_v4l2=yes fi fi