Mercurial > mplayer.hg
comparison configure @ 12666:eaf04e9f66dc
silence gcc 3.4 warnings, patch by VMiklos <mamajom@axelero.hu>
author | diego |
---|---|
date | Fri, 25 Jun 2004 18:49:24 +0000 |
parents | 05d46af5e2bf |
children | 0392f36045f4 |
comparison
equal
deleted
inserted
replaced
12665:751a27fc8895 | 12666:eaf04e9f66dc |
---|---|
736 | 736 |
737 # check that gcc supports our CPU, if not, fall back to earlier ones | 737 # check that gcc supports our CPU, if not, fall back to earlier ones |
738 # LGB: check -mcpu and -march swithing step by step with enabling | 738 # LGB: check -mcpu and -march swithing step by step with enabling |
739 # to fall back till 386. | 739 # to fall back till 386. |
740 | 740 |
741 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead | |
742 | |
743 if [ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ]) ; then | |
744 cpuopt=-mtune | |
745 else | |
746 cpuopt=-mcpu | |
747 fi | |
748 | |
741 echocheck "GCC & CPU optimization abilities" | 749 echocheck "GCC & CPU optimization abilities" |
742 cat > $TMPC << EOF | 750 cat > $TMPC << EOF |
743 int main(void) { return 0; } | 751 int main(void) { return 0; } |
744 EOF | 752 EOF |
745 if test "$_runtime_cpudetection" = no ; then | 753 if test "$_runtime_cpudetection" = no ; then |
746 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then | 754 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then |
747 cc_check -march=$proc -mcpu=$proc || proc=athlon | 755 cc_check -march=$proc $cpuopt=$proc || proc=athlon |
748 fi | 756 fi |
749 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then | 757 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then |
750 cc_check -march=$proc -mcpu=$proc || proc=k6 | 758 cc_check -march=$proc $cpuopt=$proc || proc=k6 |
751 fi | 759 fi |
752 if test "$proc" = "k6"; then | 760 if test "$proc" = "k6"; then |
753 if not cc_check -march=$proc -mcpu=$proc; then | 761 if not cc_check -march=$proc $cpuopt=$proc; then |
754 if cc_check -march=i586 -mcpu=i686; then | 762 if cc_check -march=i586 $cpuopt=i686; then |
755 proc=i586-i686 | 763 proc=i586-i686 |
756 else | 764 else |
757 proc=i586 | 765 proc=i586 |
758 fi | 766 fi |
759 fi | 767 fi |
760 fi | 768 fi |
761 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then | 769 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then |
762 cc_check -march=$proc -mcpu=$proc || proc=i686 | 770 cc_check -march=$proc $cpuopt=$proc || proc=i686 |
763 fi | 771 fi |
764 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then | 772 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then |
765 cc_check -march=$proc -mcpu=$proc || proc=i586 | 773 cc_check -march=$proc $cpuopt=$proc || proc=i586 |
766 fi | 774 fi |
767 if test "$proc" = "i586" ; then | 775 if test "$proc" = "i586" ; then |
768 cc_check -march=$proc -mcpu=$proc || proc=i486 | 776 cc_check -march=$proc $cpuopt=$proc || proc=i486 |
769 fi | 777 fi |
770 if test "$proc" = "i486" ; then | 778 if test "$proc" = "i486" ; then |
771 cc_check -march=$proc -mcpu=$proc || proc=i386 | 779 cc_check -march=$proc $cpuopt=$proc || proc=i386 |
772 fi | 780 fi |
773 if test "$proc" = "i386" ; then | 781 if test "$proc" = "i386" ; then |
774 cc_check -march=$proc -mcpu=$proc || proc=error | 782 cc_check -march=$proc $cpuopt=$proc || proc=error |
775 fi | 783 fi |
776 if test "$proc" = "error" ; then | 784 if test "$proc" = "error" ; then |
777 echores "Your $_cc does not even support \"i386\" for '-march' and '-mcpu'." | 785 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'." |
778 _mcpu="" | 786 _mcpu="" |
779 _march="" | 787 _march="" |
780 _optimizing="" | 788 _optimizing="" |
781 elif test "$proc" = "i586-i686"; then | 789 elif test "$proc" = "i586-i686"; then |
782 _march="-march=i586" | 790 _march="-march=i586" |
783 _mcpu="-mcpu=i686" | 791 _mcpu="$cpuopt=i686" |
784 _optimizing="$proc" | 792 _optimizing="$proc" |
785 else | 793 else |
786 _march="-march=$proc" | 794 _march="-march=$proc" |
787 _mcpu="-mcpu=$proc" | 795 _mcpu="$cpuopt=$proc" |
788 _optimizing="$proc" | 796 _optimizing="$proc" |
789 fi | 797 fi |
790 else | 798 else |
791 # i686 is probably the most common CPU - optimize for it | 799 # i686 is probably the most common CPU - optimize for it |
792 _mcpu="-mcpu=i686" | 800 _mcpu="$cpuopt=i686" |
793 # at least i486 required, for bswap instruction | 801 # at least i486 required, for bswap instruction |
794 _march="-march=i486" | 802 _march="-march=i486" |
795 cc_check $_mcpu || _mcpu="" | 803 cc_check $_mcpu || _mcpu="" |
796 cc_check $_march $_mcpu || _march="" | 804 cc_check $_march $_mcpu || _march="" |
797 fi | 805 fi |
800 ## autodetected mcpu/march parameters | 808 ## autodetected mcpu/march parameters |
801 if test "$_target" ; then | 809 if test "$_target" ; then |
802 # TODO: it may be a good idea to check GCC and fall back in all cases | 810 # TODO: it may be a good idea to check GCC and fall back in all cases |
803 if test "$host_arch" = "i586-i686"; then | 811 if test "$host_arch" = "i586-i686"; then |
804 _march="-march=i586" | 812 _march="-march=i586" |
805 _mcpu="-mcpu=i686" | 813 _mcpu="$cpuopt=i686" |
806 else | 814 else |
807 _march="-march=$host_arch" | 815 _march="-march=$host_arch" |
808 _mcpu="-mcpu=$host_arch" | 816 _mcpu="$cpuopt=$host_arch" |
809 fi | 817 fi |
810 | 818 |
811 proc="$host_arch" | 819 proc="$host_arch" |
812 | 820 |
813 case "$proc" in | 821 case "$proc" in |