$NetBSD: patch-aa,v 1.32 2015/04/05 08:27:08 dsainty Exp $ o Handle properly sh3 and evbarm ports on NetBSD. o Fix CPU family detection on NetBSD with /proc mounted with "-o linux" (please see also kern/25076). o Fix a bug which broke the detection of a lot of X11 libraries. o Add necessary libs for aalib support even if the aa option is turned on with --enable-aa. o Add support for dvb capture on NetBSD. --- configure.orig 2012-05-22 14:01:51.000000000 -0400 +++ configure 2013-01-11 22:15:07.000000000 -0500 @@ -1519,8 +1519,9 @@ alpha) host_arch=alpha ;; sun4*|sparc*) host_arch=sparc ;; parisc*|hppa*|9000*) host_arch=hppa ;; - arm*|zaurus|cats) host_arch=arm ;; - sh3|sh4|sh4a) host_arch=sh ;; + arm*|zaurus|cats|evbarm) host_arch=arm ;; + sh3*) host_arch=sh ;; + sh4|sh4a) host_arch=sh4 ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; *mips*) host_arch=mips ;; @@ -1674,7 +1675,7 @@ 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 @@ -1798,7 +1799,7 @@ # 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) @@ -2274,7 +2275,12 @@ test $_fast_clz = "auto" && _fast_clz=yes ;; - sh|sh4) + sh) + arch='sh' + iproc='sh' + ;; + + sh4) arch='sh4' iproc='sh4' ;; @@ -2591,7 +2597,7 @@ # Checking for CFLAGS _install_strip="-s" if test "$_profile" != "" || test "$_debug" != "" ; then - CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile" + CFLAGS="$CFLAGS $_debug $_profile" WARNFLAGS="-W -Wall" _install_strip= elif test -z "$CFLAGS" ; then @@ -4288,7 +4294,11 @@ -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 @@ -4669,6 +4679,8 @@ def_aa='#define CONFIG_AA 1' if cygwin ; then libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" + else + libs_mplayer="$libs_mplayer $(aalib-config --libs)" fi vomodules="aa $vomodules" else @@ -4756,7 +4768,6 @@ extra_cflags="$extra_cflags $inc_tmp" && break done fi -echores "$_dvb" if test "$_dvb" = yes ; then _dvbin=yes inputmodules="dvb $inputmodules" @@ -4765,14 +4776,29 @@ aomodules="mpegpes(dvb) $aomodules" vomodules="mpegpes(dvb) $vomodules" else - _dvbin=no - noinputmodules="dvb $noinputmodules" - def_dvb='#undef CONFIG_DVB' - def_dvbin='#undef CONFIG_DVBIN ' - aomodules="mpegpes(file) $aomodules" - vomodules="mpegpes(file) $vomodules" + cat >$TMPC < +int main(void) {return 0;} +EOF + cc_check && _dvb=yes + if test "$_dvb" = yes ; then + _dvbin=yes + inputmodules="dvb $inputmodules" + def_dvb='#undef CONFIG_DVB' + def_dvbin='#define CONFIG_DVBIN 1' + aomodules="mpegpes(file) $aomodules" + vomodules="mpegpes(file) $vomodules" + else + _dvbin=no + noinputmodules="dvb $noinputmodules" + def_dvb='#undef CONFIG_DVB' + def_dvbin='#undef CONFIG_DVBIN ' + aomodules="mpegpes(file) $aomodules" + vomodules="mpegpes(file) $vomodules" + fi fi +echores "$_dvb" if darwin; then @@ -7764,8 +7790,8 @@ cflags_libdvdnav="-Ilibdvdnav" inputmodules="dvdnav(internal) $inputmodules" else - extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)" - extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)" + extra_cflags="$extra_cflags $($_pkg_config --cflags dvdnav)" + extra_ldflags="$extra_ldflags $($_pkg_config --libs dvdnav)" inputmodules="dvdnav $inputmodules" fi else