Revision 14ca9cd0

View differences:

configure
1657 1657
        CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
1658 1658
        AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
1659 1659
    fi
1660
    speed_cflags='-O3'
1661
    size_cflags='-Os'
1660 1662
elif $cc --version 2>/dev/null | grep -q Intel; then
1661 1663
    cc_type=icc
1662 1664
    cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
1663 1665
    CC_DEPFLAGS='-MMD'
1664 1666
    AS_DEPFLAGS='-MMD'
1667
    speed_cflags='-O3'
1668
    size_cflags='-Os'
1665 1669
elif $cc -v 2>&1 | grep -q xlc; then
1666 1670
    cc_type=xlc
1667 1671
    cc_version="AV_STRINGIFY(__IBMC__)"
1672
    speed_cflags='-O5'
1673
    size_cflags='-O5 -qcompact'
1668 1674
elif $cc -V 2>/dev/null | grep -q Compaq; then
1669 1675
    cc_type=ccc
1670 1676
    cc_version="AV_STRINGIFY(__DECC_VER)"
1671 1677
    DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
1672 1678
    debuglevel=3
1673 1679
    add_ldflags -Wl,-z,now # calls to libots crash without this
1680
    speed_cflags='-fast'
1681
    size_cflags='-O1'
1674 1682
elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
1675 1683
    test -d "$sysroot" || die "No valid sysroot specified."
1676 1684
    cc_type=armcc
......
1685 1693
    as_default="${cross_prefix}gcc"
1686 1694
    CC_DEPFLAGS='-MMD'
1687 1695
    AS_DEPFLAGS='-MMD'
1696
    speed_cflags='-O3'
1697
    size_cflags='-Os'
1688 1698
elif $cc -version 2>/dev/null | grep -q TMS470; then
1689 1699
    cc_type=tms470
1690 1700
    cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
......
1697 1707
    add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
1698 1708
    CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
1699 1709
    AS_DEPFLAGS='-MMD'
1710
    speed_cflags='-O3 -mf=5'
1711
    size_cflags='-O3 -mf=2'
1700 1712
    filter_cflags=tms470_flags
1701 1713
    tms470_flags(){
1702 1714
        for flag; do
......
1716 1728
                -mfpu=vfp)      echo --float_support=vfpv2        ;;
1717 1729
                -mfpu=vfpv3)    echo --float_support=vfpv3        ;;
1718 1730
                -msoft-float)   echo --float_support=vfplib       ;;
1719
                -Os)            echo -O3 -mf=2                    ;;
1720
                -O[0-3])        echo $flag -mf=5                  ;;
1731
                -O[0-3]|-mf=*)  echo $flag                        ;;
1721 1732
                -g)             echo -g -mn                       ;;
1722 1733
                -pds=*)         echo $flag                        ;;
1723 1734
            esac
......
1728 1739
    cc_version=__VERSION__
1729 1740
    CC_DEPFLAGS='-MMD'
1730 1741
    AS_DEPFLAGS='-MMD'
1742
    speed_cflags='-O3'
1743
    size_cflags='-Os'
1731 1744
elif $cc -V 2>&1 | grep -q Sun; then
1732 1745
    cc_type=suncc
1733 1746
    cc_version="AV_STRINGIFY(__SUNPRO_C)"
1734 1747
    DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
1735 1748
    DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
1749
    speed_cflags='-O5'
1750
    size_cflags='-O5 -xspace'
1736 1751
    filter_cflags=suncc_flags
1737 1752
    suncc_flags(){
1738 1753
        for flag; do
......
1761 1776
                -std=c99)             echo -xc99              ;;
1762 1777
                -fomit-frame-pointer) echo -xregs=frameptr    ;;
1763 1778
                -fPIC)                echo -KPIC -xcode=pic32 ;;
1764
                -Os)                  echo -O5 -xspace        ;;
1765 1779
                -W*,*)                echo $flag              ;;
1766 1780
                -f*-*|-W*)                                    ;;
1767 1781
                *)                    echo $flag              ;;
......
2632 2646
    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
2633 2647

  
2634 2648
if enabled small; then
2635
    check_cflags -Os            # not all compilers support -Os
2649
    add_cflags $size_cflags
2636 2650
    optimizations="small"
2637 2651
elif enabled optimizations; then
2638
    if enabled xlc; then
2639
        add_cflags  -O5
2640
        add_ldflags -O5
2641
    elif enabled suncc; then
2642
        add_cflags -O5
2643
    elif enabled ccc; then
2644
        add_cflags -fast
2645
    else
2646
        add_cflags -O3
2647
    fi
2652
    add_cflags $speed_cflags
2648 2653
fi
2649 2654
check_cflags -fno-math-errno
2650 2655
check_cflags -fno-signed-zeros

Also available in: Unified diff