Browse code

Add cflags filter for suncc

Patch by Michael Kostylev <gmail>.

Originally committed as revision 20532 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Kostylev authored on 2009/11/14 05:24:42
Showing 1 changed files
... ...
@@ -1621,6 +1621,41 @@ elif $cc -V 2>&1 | grep -q Sun; then
1621 1621
     cc_version="AV_STRINGIFY(__SUNPRO_C)"
1622 1622
     DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
1623 1623
     DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
1624
+    filter_cflags=suncc_flags
1625
+    suncc_flags(){
1626
+        for flag; do
1627
+            case $flag in
1628
+                -march=*|-mcpu=*)
1629
+                    case "${flag#*=}" in
1630
+                        native)                   echo -xtarget=native       ;;
1631
+                        v9)                       echo -xarch=sparc          ;;
1632
+                        ultrasparc)               echo -xarch=sparcvis       ;;
1633
+                        ultrasparc3|niagara*)     echo -xarch=sparcvis2      ;;
1634
+                        i586|pentium)             echo -xchip=pentium        ;;
1635
+                        i686|pentiumpro|pentium2) echo -xtarget=pentium_pro  ;;
1636
+                        pentium3*|c3-2)           echo -xtarget=pentium3     ;;
1637
+                        pentium-m)          echo -xarch=sse2 -xchip=pentium3 ;;
1638
+                        pentium4*)          echo -xtarget=pentium4           ;;
1639
+                        prescott|nocona)    echo -xarch=sse3 -xchip=pentium4 ;;
1640
+                        *-sse3)             echo -xarch=sse3                 ;;
1641
+                        core2)              echo -xarch=ssse3 -xchip=core2   ;;
1642
+                        amdfam10|barcelona)       echo -xarch=sse4_1         ;;
1643
+                        athlon-4|athlon-[mx]p)    echo -xarch=ssea           ;;
1644
+                        k8|opteron|athlon64|athlon-fx)
1645
+                                                  echo -xarch=sse2a          ;;
1646
+                        athlon*)                  echo -xarch=pentium_proa   ;;
1647
+                    esac
1648
+                    ;;
1649
+                -std=c99)             echo -xc99              ;;
1650
+                -fomit-frame-pointer) echo -xregs=frameptr    ;;
1651
+                -fPIC)                echo -KPIC -xcode=pic32 ;;
1652
+                -Os)                  echo -O5 -xspace        ;;
1653
+                -W*,*)                echo $flag              ;;
1654
+                -f*-*|-W*)                                    ;;
1655
+                *)                    echo $flag              ;;
1656
+            esac
1657
+        done
1658
+    }
1624 1659
 fi
1625 1660
 
1626 1661
 test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
... ...
@@ -2473,6 +2508,8 @@ elif enabled optimizations; then
2473 2473
     if enabled xlc; then
2474 2474
         add_cflags  -O5
2475 2475
         add_ldflags -O5
2476
+    elif enabled suncc; then
2477
+        add_cflags -O5
2476 2478
     elif enabled ccc; then
2477 2479
         add_cflags -fast
2478 2480
     else