diff -r 44acfa481149 -r 2289d64c2123 gcc/gcc.spec --- a/gcc/gcc.spec Sat Mar 26 17:31:59 2011 +0100 +++ b/gcc/gcc.spec Mon Mar 28 19:41:02 2011 +0200 @@ -22,7 +22,7 @@ ## # package version -%define V_full 4.5.2 +%define V_full 4.6.0 %define V_comp %nil # package information @@ -60,14 +60,14 @@ # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20060823, make, libtool +BuildPreReq: OpenPKG, openpkg >= 20060823, make PreReq: OpenPKG, openpkg >= 20060823 +BuildPreReq: mpc, mpfr, gmp +PreReq: mpc, mpfr, gmp %if "%{with_binutils}" == "yes" BuildPreReq: binutils >= 2.14 PreReq: binutils >= 2.14 %endif -BuildPreReq: mpc, mpfr, gmp -PreReq: mpc, mpfr, gmp %if "%{with_cxx}" == "yes" BuildPreReq: libiconv PreReq: libiconv @@ -108,12 +108,24 @@ %setup -q -T -D -b 4 %endif %patch -p0 + %{l_shtool} subst \ + -e 's;\(instname="\$dir/\$name"\)i;\1;' \ + ltmain.sh %{l_shtool} subst -v -s \ -e 's;\(gmplibs="-lmpc\) \(-lmpfr -lgmp\);\1 -lm \2;' \ configure %{l_shtool} subst -v -s \ -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \ gcc/configure + %{l_shtool} subst \ + -e 's;[ \t]*-W[a-zA-Z0-9_\-][a-zA-Z0-9_\-]*,*;;g' \ + lto-plugin/Makefile.in + %{l_shtool} subst \ + -e 's;-rpath *[^ \t][^ \t]*;;g' \ + -e 's;--tag=disable-static;--tag=disable-shared;g' \ + -e 's;\.\./libiberty/libiberty\.a;-L../libiberty -liberty;g' \ + -e 's;\.\./libiberty/pic/libiberty\.a;-L../libiberty/pic -liberty;g' \ + lto-plugin/Makefile.in if [ ".%{V_comp}" != . ]; then %{l_shtool} subst -v -s \ -e 's;(libdir)/gcc/;(libdir)/gcc%{V_comp}/;' \ @@ -181,6 +193,11 @@ echo "am_cv_lib_iconv=no" ) >config.cache + # platform specific config logic + case "%{l_platform -t}" in + *i?86-sunos* ) echo "gcc_cv_prog_cmp_skip=true" >>config.cache;; + esac + # configure the package LD="$LD" \ AS="$AS" \ @@ -191,6 +208,7 @@ LDFLAGS="%{l_ldflags}" \ %endif CONFIG_SHELL="%{l_bash}" \ + GREP="%{l_bash}" \ ../configure \ --with-bugurl="http://openpkg.org/" \ --with-pkgversion="%{l_openpkg_release -F "OpenPKG-%%t"}" \ @@ -236,26 +254,41 @@ l_libcflags="-g" l_libcxxflags="-g" # at least GNU as from GNU binutils supports -pipe always - "$AS" --version /dev/null | grep "^GNU assembler " >/dev/null && { + "$AS" --version /dev/null | grep "^GNU assembler" >/dev/null && { l_boot_cflags="$l_boot_cflags -pipe" l_libcxxflags="$l_libcxxflags -pipe" } %if "%{with_optimize}" == "yes" - # conservatively optimize the generated program code - # (also _tune_ for particular CPUs, but _without_ requiring these CPUs!) + if [ ".$l_ccisgcc" = .yes ]; then + l_ia32=native + else + l_ia32=pentium3 + fi + case "%{l_platform -t}" in + *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=$l_ia32" ;; + *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v9" ;; + esac + l_cflags="$l_cflags -O" + l_boot_cflags="$l_boot_cflags -O3 -fomit-frame-pointer" + l_libcxxflags="$l_libcxxflags -O3 -fno-implicit-templates" +%else +%if "%{with_optimize}" == "port" + # conservatively optimize the generated program code for portable use, + # also _tune_ for particular CPUs, but _without_ requiring these CPUs! + case "%{l_platform -t}" in + *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=generic" ;; + *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v8" ;; + esac l_cflags="$l_cflags -O" l_boot_cflags="$l_boot_cflags -O2 -fomit-frame-pointer" - case "%{l_platform -t}" in - *i?86-* ) l_boot_cflags="$l_boot_cflags -mtune=pentium3" ;; - *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v9" ;; - esac l_libcxxflags="$l_libcxxflags -O2 -fno-implicit-templates" %else - # else do no optimizations at all to reduce problems to minimum in advance + # do not optimize at all to avoid problems l_boot_cflags="$l_boot_cflags -O0" l_libcxxflags="$l_libcxxflags -O0" %endif - maketarget="bootstrap2-lean" +%endif + maketarget="bootstrap" %if "%{with_profile}" == "yes" # GCC >= 3.4 supports a "profiledbootstrap" target to build an # optimized version of itself through profiling. Because this @@ -264,12 +297,15 @@ # building with GCC as the bootstrapping C compiler. if [ ".$l_ccisgcc" = .yes ]; then maketarget="profiledbootstrap" + else + ( echo "Building a profiled GCC requires GCC. Please install GCC" + echo "first and then build again with the profile option enabled." + ) | %{l_rpmtool} msg -b -t error + exit 1 fi %endif case "%{l_platform -t}" in - amd64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; - ia64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; - sparc64-freebsd* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; + *64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; esac %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" l_cflags="$l_cflags %{l_cppflags}" @@ -279,9 +315,10 @@ %endif # build the package - MAKE="%{l_make} %{l_mflags}" \ - %{l_make} %{l_mflags} \ - MAKE="%{l_make} %{l_mflags}" \ + MAKE="%{l_make} %{l_mflags -O}" \ + %{l_make} %{l_mflags -O} \ + GREP="grep" \ + MAKE="%{l_make} %{l_mflags -O}" \ BOOT_CFLAGS="${l_boot_cflags}" \ CFLAGS="${l_cflags}" \ CXXFLAGS="${l_cxxflags}" \ @@ -326,6 +363,11 @@ $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/include/ \ >/dev/null 2>&1 || true + # correct hardcoded paths + %{l_shtool} subst \ + -e "s;\(dependency_libs='[ \t]*-L\).*;\1%{l_prefix}/lib -L%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]* -liberty';" \ + $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/liblto_plugin.la + # strip installation tree rm -rf $RPM_BUILD_ROOT%{l_prefix}/${triple} rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir