소스 검색

make flag determination more flexible and especially add more optional optimization

Ralf S. Engelschall 23 년 전
부모
커밋
f33ede2650
1개의 변경된 파일26개의 추가작업 그리고 10개의 파일을 삭제
  1. 26 10
      gcc/gcc.spec

+ 26 - 10
gcc/gcc.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [CORE]
 Group:        Language
 License:      GPL
 Version:      3.2.2
-Release:      20030227
+Release:      20030309
 
 #   package options
 %option       with_cxx       yes
@@ -115,17 +115,33 @@ AutoReqProv:  no
         --disable-nls \
         ${l_with_gnu_ld_as}
 
-    #   determine build parameters
+    #   determine build flags
+    l_cflags=""
+    l_boot_cflags=""
+    l_libcflags="-g"
+    l_libcxxflags="-g"
+%if "%{with_binutils}" == "yes"
+    #   at least GNU as from GNU binutils supports -pipe always
+    l_boot_cflags="$l_boot_cflags -pipe"
+    l_libcflags="$l_libcflags -pipe"
+    l_libcxxflags="$l_libcxxflags -pipe"
+%endif
 %if "%{with_optimize}" == "yes"
-    l_boot_cflags="-O2"
-    l_cflags="-O"
-    l_libcflags="-g -O2"
-    l_libcxxflags="-g -O2 -fno-implicit-templates"
+    #   conservatively optimize the generated program code
+    #   (also _tune_ for particular CPUs, but _without_ requiring these CPUs!)
+    l_cflags="$l_cflags -O"
+    l_boot_cflags="$l_boot_cflags -O2 -fomit-frame-pointer -funroll-loops"
+    case "%{l_target}" in
+        *x86-*    ) l_boot_cflags="$l_boot_cflags -mcpu=pentium3" ;;
+        *sparc64* ) l_boot_cflags="$l_boot_cflags -mtune=v9"      ;;
+    esac
+    l_libcflags="$l_libcflags -O2"
+    l_libcxxflags="$l_libcxxflags -O2 -fno-implicit-templates"
 %else
-    l_boot_cflags="-O0"
-    l_cflags=""
-    l_libcflags="-g -O0"
-    l_libcxxflags="-g -O0"
+    #   else do no optimizations at all to reduce problems to minimum in advance
+    l_boot_cflags="$l_boot_cflags -O0"
+    l_libcflags="$l_libcflags -O0"
+    l_libcxxflags="$l_libcxxflags -O0"
 %endif
 
     #   build the package