# HG changeset patch # User Michael Schloh von Bennewitz # Date 1301506516 -7200 # Node ID 6eb79a12ee370f4a4cfaf894adbd693ae8d92680 # Parent 4a34d7a82eabc4d1fc44593a8d02c4cbefce3f48 Finally correct packaging logic enough to allow for successful building: Force Java dependency to C++ and POSIX threads to satisfy buildtime requirements of GCJ, add conditional java dependency to infozip as required by libjava/configure, remove outdated fortran conditions, correct buildconf causing jcf-dump target to fail, add and improve warnings regarding profile feedback, build duration, and parallel make, correct make environment when building C++ dependent languages, and introduce new helpful comments. diff -r 4a34d7a82eab -r 6eb79a12ee37 gcc/gcc.spec --- a/gcc/gcc.spec Tue Mar 29 20:04:34 2011 +0200 +++ b/gcc/gcc.spec Wed Mar 30 19:35:16 2011 +0200 @@ -36,7 +36,7 @@ Group: Compiler License: GPL Version: %{V_full} -Release: 20110320 +Release: 20110330 # package options %option with_binutils yes @@ -49,6 +49,12 @@ %option with_threads yes %option with_multilib no +# fix intermodule dependencies implicitly +%if "%{with_java}" == "yes" +%define with_cxx yes +%define with_threads yes +%endif + # list of sources Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-core-%{V_full}.tar.bz2 Source1: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-g++-%{V_full}.tar.bz2 @@ -73,7 +79,7 @@ PreReq: libiconv %endif %if "%{with_java}" == "yes" -BuildPreReq: zlib +BuildPreReq: zlib, infozip PreReq: zlib %endif AutoReq: no @@ -115,6 +121,7 @@ -e 's;\(gmplibs="-lmpc\) \(-lmpfr -lgmp\);\1 -lm \2;' \ configure %{l_shtool} subst -v -s \ + -e 's;\(LDEXP_LIB=\)"$LIBS";\1"$LDFLAGS";' \ -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \ gcc/configure %{l_shtool} subst \ @@ -204,7 +211,7 @@ AS="$AS" \ CC="%{l_cc}" \ CFLAGS="%{l_cflags}" \ -%if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" +%if "%{with_cxx}" == "yes" CPPFLAGS="%{l_cppflags}" \ LDFLAGS="%{l_ldflags}" \ %endif @@ -307,25 +314,34 @@ l_libcxxflags="$l_libcxxflags -O0" %endif %if "%{with_profile}" == "yes" + # generate profile feedback maketarget="profiledbootstrap" loc_makeflags="%{l_mflags}" + + # warn about exceptional build duration for profile feedback + ( echo "Building profile feedback on some hosts can take many days to complete!" + echo "Now continuing to build a profiled bootstrap with parallel make logic" + echo "disabled according to profiling requirements..." + ) | %{l_rpmtool} msg -b -t warn + + # warn about profiled bootstrap requirement of 64-bit arithmetic if [ ".$l_ccisgcc" != .yes ]; then - ( echo "A preinstalled GCC is recommended when bootstrapping a profiled GCC. If the" - echo "compiler used to bootstrap GCC doesn't support 64-bit arithmetic, then" - echo "either runtime or buildtime errors could occur. Regardless of this," - echo "parallel make logic is disabled according to profiling requirements." + ( echo "A preinstalled GCC was not detected although one is recommended for" + echo "building a profiled bootstrap. Buildtime or runtime errors can occur if" + echo "the compiler used to build profile feedback doesn't support 64-bit math." echo "" echo "If in doubt, stop now and start the build again with profiling disabled." ) | %{l_rpmtool} msg -b -t warn fi %else + # build in three stages maketarget="bootstrap" loc_makeflags="%{l_mflags -O}" %endif case "%{l_platform -t}" in *64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;; esac -%if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" +%if "%{with_cxx}" == "yes" l_cflags="$l_cflags %{l_cppflags}" l_cxxflags="$l_cxxflags %{l_cppflags}" l_libcflags="$l_libcflags %{l_cppflags}" @@ -340,6 +356,11 @@ BOOT_CFLAGS="${l_boot_cflags}" \ CFLAGS="${l_cflags}" \ CXXFLAGS="${l_cxxflags}" \ +%if "%{with_cxx}" == "yes" + CPPFLAGS="%{l_cppflags}" \ + LDFLAGS="%{l_ldflags}" \ + BOOT_LDFLAGS="%{l_ldflags}" \ +%endif LIBCFLAGS="${l_libcflags}" \ LIBCXXFLAGS="${l_libcxxflags}" \ $maketarget