Mercurial > mplayer.hg
comparison configure @ 13895:0109b5a6234f
Handle "tail" and "head" properly. If using "-1" does not work then use "-n 1". Throw away warnings in both cases.
author | mosu |
---|---|
date | Sun, 07 Nov 2004 21:58:29 +0000 |
parents | ae7fe5c13f50 |
children | 2fcc9d0da3ae |
comparison
equal
deleted
inserted
replaced
13894:7f22fdc992a4 | 13895:0109b5a6234f |
---|---|
537 _ldd=ldd | 537 _ldd=ldd |
538 if darwin; then | 538 if darwin; then |
539 _ldd="otool -L" | 539 _ldd="otool -L" |
540 fi | 540 fi |
541 | 541 |
542 # Check how to call 'head' and 'tail'. Newer versions spit out warnings | |
543 # if used as 'head -1' instead of 'head -n 1', but older versions don't | |
544 # know about '-n'. | |
545 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then | |
546 _head() { head -$1 2>/dev/null ; } | |
547 else | |
548 _head() { head -n $1 2>/dev/null ; } | |
549 fi | |
550 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then | |
551 _tail() { tail -$1 2>/dev/null ; } | |
552 else | |
553 _tail() { tail -n $1 2>/dev/null ; } | |
554 fi | |
555 | |
542 # Checking CC version... | 556 # Checking CC version... |
543 if test "$_skip_cc_check" != yes ; then | 557 if test "$_skip_cc_check" != yes ; then |
544 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) | 558 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) |
545 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then | 559 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then |
546 echocheck "$_cc version" | 560 echocheck "$_cc version" |
547 cc_vendor=intel | 561 cc_vendor=intel |
548 cc_name=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 1` | 562 cc_name=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 1` |
549 cc_version=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 2 | cut -d ' ' -f 3` | 563 cc_version=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3` |
550 _cc_major=`echo $cc_version | cut -d '.' -f 1` | 564 _cc_major=`echo $cc_version | cut -d '.' -f 1` |
551 _cc_minor=`echo $cc_version | cut -d '.' -f 2` | 565 _cc_minor=`echo $cc_version | cut -d '.' -f 2` |
552 # TODO verify older icc/ecc compatibility | 566 # TODO verify older icc/ecc compatibility |
553 case $cc_version in | 567 case $cc_version in |
554 '') | 568 '') |
567 echores "$cc_version" | 581 echores "$cc_version" |
568 else | 582 else |
569 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do | 583 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do |
570 echocheck "$_cc version" | 584 echocheck "$_cc version" |
571 cc_vendor=gnu | 585 cc_vendor=gnu |
572 cc_name=`( $_cc -v ) 2>&1 | tail -1 | cut -d ' ' -f 1` | 586 cc_name=`( $_cc -v ) 2>&1 | _tail 1 | cut -d ' ' -f 1` |
573 cc_version=`( $_cc -dumpversion ) 2>&1` | 587 cc_version=`( $_cc -dumpversion ) 2>&1` |
574 if test "$?" -gt 0; then | 588 if test "$?" -gt 0; then |
575 cc_version="not found" | 589 cc_version="not found" |
576 fi | 590 fi |
577 case $cc_version in | 591 case $cc_version in |
682 _cpuinfo="TOOLS/cpuinfo" | 696 _cpuinfo="TOOLS/cpuinfo" |
683 fi | 697 fi |
684 | 698 |
685 x86_exts_check() | 699 x86_exts_check() |
686 { | 700 { |
687 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1` | 701 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1` |
688 if test -z "$pparam" ; then | 702 if test -z "$pparam" ; then |
689 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1` | 703 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1` |
690 fi | 704 fi |
691 | 705 |
692 _mmx=no | 706 _mmx=no |
693 _3dnow=no | 707 _3dnow=no |
694 _3dnowex=no | 708 _3dnowex=no |
713 case "$host_arch" in | 727 case "$host_arch" in |
714 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) | 728 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) |
715 _def_arch="#define ARCH_X86 1" | 729 _def_arch="#define ARCH_X86 1" |
716 _target_arch="TARGET_ARCH_X86 = yes" | 730 _target_arch="TARGET_ARCH_X86 = yes" |
717 | 731 |
718 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1` | 732 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1` |
719 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` | 733 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` |
720 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` | 734 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` |
721 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` | 735 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` |
722 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` | 736 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` |
723 | 737 |
724 x86_exts_check | 738 x86_exts_check |
725 | 739 |
726 echocheck "CPU vendor" | 740 echocheck "CPU vendor" |
727 echores "$pvendor ($pfamily:$pmodel:$pstepping)" | 741 echores "$pvendor ($pfamily:$pmodel:$pstepping)" |
978 _optimizing='' | 992 _optimizing='' |
979 _altivec=no | 993 _altivec=no |
980 | 994 |
981 echocheck "CPU type" | 995 echocheck "CPU type" |
982 if linux && test -n "$_cpuinfo"; then | 996 if linux && test -n "$_cpuinfo"; then |
983 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1` | 997 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1` |
984 if test -n "`$_cpuinfo | grep altivec`"; then | 998 if test -n "`$_cpuinfo | grep altivec`"; then |
985 _altivec=yes | 999 _altivec=yes |
986 fi | 1000 fi |
987 fi | 1001 fi |
988 if darwin ; then | 1002 if darwin ; then |