1.1 --- a/gcc/gcc.spec Sat Mar 26 17:31:59 2011 +0100 1.2 +++ b/gcc/gcc.spec Mon Mar 28 19:41:02 2011 +0200 1.3 @@ -22,7 +22,7 @@ 1.4 ## 1.5 1.6 # package version 1.7 -%define V_full 4.5.2 1.8 +%define V_full 4.6.0 1.9 %define V_comp %nil 1.10 1.11 # package information 1.12 @@ -60,14 +60,14 @@ 1.13 # build information 1.14 Prefix: %{l_prefix} 1.15 BuildRoot: %{l_buildroot} 1.16 -BuildPreReq: OpenPKG, openpkg >= 20060823, make, libtool 1.17 +BuildPreReq: OpenPKG, openpkg >= 20060823, make 1.18 PreReq: OpenPKG, openpkg >= 20060823 1.19 +BuildPreReq: mpc, mpfr, gmp 1.20 +PreReq: mpc, mpfr, gmp 1.21 %if "%{with_binutils}" == "yes" 1.22 BuildPreReq: binutils >= 2.14 1.23 PreReq: binutils >= 2.14 1.24 %endif 1.25 -BuildPreReq: mpc, mpfr, gmp 1.26 -PreReq: mpc, mpfr, gmp 1.27 %if "%{with_cxx}" == "yes" 1.28 BuildPreReq: libiconv 1.29 PreReq: libiconv 1.30 @@ -108,12 +108,24 @@ 1.31 %setup -q -T -D -b 4 1.32 %endif 1.33 %patch -p0 1.34 + %{l_shtool} subst \ 1.35 + -e 's;\(instname="\$dir/\$name"\)i;\1;' \ 1.36 + ltmain.sh 1.37 %{l_shtool} subst -v -s \ 1.38 -e 's;\(gmplibs="-lmpc\) \(-lmpfr -lgmp\);\1 -lm \2;' \ 1.39 configure 1.40 %{l_shtool} subst -v -s \ 1.41 -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \ 1.42 gcc/configure 1.43 + %{l_shtool} subst \ 1.44 + -e 's;[ \t]*-W[a-zA-Z0-9_\-][a-zA-Z0-9_\-]*,*;;g' \ 1.45 + lto-plugin/Makefile.in 1.46 + %{l_shtool} subst \ 1.47 + -e 's;-rpath *[^ \t][^ \t]*;;g' \ 1.48 + -e 's;--tag=disable-static;--tag=disable-shared;g' \ 1.49 + -e 's;\.\./libiberty/libiberty\.a;-L../libiberty -liberty;g' \ 1.50 + -e 's;\.\./libiberty/pic/libiberty\.a;-L../libiberty/pic -liberty;g' \ 1.51 + lto-plugin/Makefile.in 1.52 if [ ".%{V_comp}" != . ]; then 1.53 %{l_shtool} subst -v -s \ 1.54 -e 's;(libdir)/gcc/;(libdir)/gcc%{V_comp}/;' \ 1.55 @@ -181,6 +193,11 @@ 1.56 echo "am_cv_lib_iconv=no" 1.57 ) >config.cache 1.58 1.59 + # platform specific config logic 1.60 + case "%{l_platform -t}" in 1.61 + *i?86-sunos* ) echo "gcc_cv_prog_cmp_skip=true" >>config.cache;; 1.62 + esac 1.63 + 1.64 # configure the package 1.65 LD="$LD" \ 1.66 AS="$AS" \ 1.67 @@ -191,6 +208,7 @@ 1.68 LDFLAGS="%{l_ldflags}" \ 1.69 %endif 1.70 CONFIG_SHELL="%{l_bash}" \ 1.71 + GREP="%{l_bash}" \ 1.72 ../configure \ 1.73 --with-bugurl="http://openpkg.org/" \ 1.74 --with-pkgversion="%{l_openpkg_release -F "OpenPKG-%%t"}" \ 1.75 @@ -236,26 +254,41 @@ 1.76 l_libcflags="-g" 1.77 l_libcxxflags="-g" 1.78 # at least GNU as from GNU binutils supports -pipe always 1.79 - "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && { 1.80 + "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler" >/dev/null && { 1.81 l_boot_cflags="$l_boot_cflags -pipe" 1.82 l_libcxxflags="$l_libcxxflags -pipe" 1.83 } 1.84 %if "%{with_optimize}" == "yes" 1.85 - # conservatively optimize the generated program code 1.86 - # (also _tune_ for particular CPUs, but _without_ requiring these CPUs!) 1.87 + if [ ".$l_ccisgcc" = .yes ]; then 1.88 + l_ia32=native 1.89 + else 1.90 + l_ia32=pentium3 1.91 + fi 1.92 + case "%{l_platform -t}" in 1.93 + *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=$l_ia32" ;; 1.94 + *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v9" ;; 1.95 + esac 1.96 + l_cflags="$l_cflags -O" 1.97 + l_boot_cflags="$l_boot_cflags -O3 -fomit-frame-pointer" 1.98 + l_libcxxflags="$l_libcxxflags -O3 -fno-implicit-templates" 1.99 +%else 1.100 +%if "%{with_optimize}" == "port" 1.101 + # conservatively optimize the generated program code for portable use, 1.102 + # also _tune_ for particular CPUs, but _without_ requiring these CPUs! 1.103 + case "%{l_platform -t}" in 1.104 + *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=generic" ;; 1.105 + *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v8" ;; 1.106 + esac 1.107 l_cflags="$l_cflags -O" 1.108 l_boot_cflags="$l_boot_cflags -O2 -fomit-frame-pointer" 1.109 - case "%{l_platform -t}" in 1.110 - *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=pentium3" ;; 1.111 - *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v9" ;; 1.112 - esac 1.113 l_libcxxflags="$l_libcxxflags -O2 -fno-implicit-templates" 1.114 %else 1.115 - # else do no optimizations at all to reduce problems to minimum in advance 1.116 + # do not optimize at all to avoid problems 1.117 l_boot_cflags="$l_boot_cflags -O0" 1.118 l_libcxxflags="$l_libcxxflags -O0" 1.119 %endif 1.120 - maketarget="bootstrap2-lean" 1.121 +%endif 1.122 + maketarget="bootstrap" 1.123 %if "%{with_profile}" == "yes" 1.124 # GCC >= 3.4 supports a "profiledbootstrap" target to build an 1.125 # optimized version of itself through profiling. Because this 1.126 @@ -264,12 +297,15 @@ 1.127 # building with GCC as the bootstrapping C compiler. 1.128 if [ ".$l_ccisgcc" = .yes ]; then 1.129 maketarget="profiledbootstrap" 1.130 + else 1.131 + ( echo "Building a profiled GCC requires GCC. Please install GCC" 1.132 + echo "first and then build again with the profile option enabled." 1.133 + ) | %{l_rpmtool} msg -b -t error 1.134 + exit 1 1.135 fi 1.136 %endif 1.137 case "%{l_platform -t}" in 1.138 - amd64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; 1.139 - ia64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; 1.140 - sparc64-freebsd* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; 1.141 + *64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; 1.142 esac 1.143 %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" 1.144 l_cflags="$l_cflags %{l_cppflags}" 1.145 @@ -279,9 +315,10 @@ 1.146 %endif 1.147 1.148 # build the package 1.149 - MAKE="%{l_make} %{l_mflags}" \ 1.150 - %{l_make} %{l_mflags} \ 1.151 - MAKE="%{l_make} %{l_mflags}" \ 1.152 + MAKE="%{l_make} %{l_mflags -O}" \ 1.153 + %{l_make} %{l_mflags -O} \ 1.154 + GREP="grep" \ 1.155 + MAKE="%{l_make} %{l_mflags -O}" \ 1.156 BOOT_CFLAGS="${l_boot_cflags}" \ 1.157 CFLAGS="${l_cflags}" \ 1.158 CXXFLAGS="${l_cxxflags}" \ 1.159 @@ -326,6 +363,11 @@ 1.160 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/include/ \ 1.161 >/dev/null 2>&1 || true 1.162 1.163 + # correct hardcoded paths 1.164 + %{l_shtool} subst \ 1.165 + -e "s;\(dependency_libs='[ \t]*-L\).*;\1%{l_prefix}/lib -L%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]* -liberty';" \ 1.166 + $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/liblto_plugin.la 1.167 + 1.168 # strip installation tree 1.169 rm -rf $RPM_BUILD_ROOT%{l_prefix}/${triple} 1.170 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir