# HG changeset patch # User Michael Schloh von Bennewitz # Date 1300989889 -3600 # Node ID 30c214982bd235c1ac9e186495635eba1a2019ef # Parent bbed90117468f8c18302c2749fb31d57f42deba1 Try to correct dependency compatability logic leading to build problems. diff -r bbed90117468 -r 30c214982bd2 gcc/gcc.spec --- a/gcc/gcc.spec Thu Mar 24 19:02:24 2011 +0100 +++ b/gcc/gcc.spec Thu Mar 24 19:04:49 2011 +0100 @@ -60,8 +60,8 @@ # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} -BuildPreReq: OpenPKG, openpkg >= 20100101, make -PreReq: OpenPKG, openpkg >= 20100101 +BuildPreReq: OpenPKG, openpkg >= 20060823, make +PreReq: OpenPKG, openpkg >= 20060823 %if "%{with_binutils}" == "yes" BuildPreReq: binutils >= 2.14 PreReq: binutils >= 2.14 @@ -133,16 +133,41 @@ %{l_shtool} mkdir -p obj cd obj - # determine ld(1) and as(1) usage + # solve strange compatability problems + case "%{l_platform -t}" in + *-sunos* ) +%if "%{with_binutils}" == "no" + ( echo "Building GCC on Solaris OS requires GNU as, however" + echo "the OS native linker will be used in place of GNU ld." + echo "" + echo "To solve this problem, install the binutils package" + echo "and build GCC again using the option 'with_binutils'." + echo "OpenPKG will ignore GNU ld but use GNU as to build GCC." + echo "" + echo "Please note that this condition applies to OpenPKG" + echo "building of the GCC package on Solaris only!" + ) | %{l_rpmtool} msg -b -t warn + exit 1; + ;; +%else + # locate ld(1) and as(1), using the GNU assembler + # but ignoring the presence of any OpenPKG linker + LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin \ + which ld` + ;; +%endif + *-* ) + # determine ld(1) and as(1) usage, allowing either + # one to be from the GNU distribution of binutils + LD=%{l_tool_locate ld ld} + ;; + esac l_with_gnu_ld_as="" - LD=%{l_tool_locate ld ld} AS=%{l_tool_locate as as} - echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-ld=$LD" + echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD" echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS" - $LD --version /dev/null | grep "^GNU ld " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld" - $AS --version /dev/null | grep "^GNU assembler " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as" - unset LD - unset AS + $LD --version /dev/null | grep "^GNU ld " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-ld" + $AS --version /dev/null | grep "^GNU assembler " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as" || l_with_gnu_ld_as="${l_with_gnu_ld_as} --without-gnu-as" # determine threads usage %if "%{with_threads}" == "yes" @@ -172,6 +197,8 @@ ) >config.cache # configure the package + LD="$LD" \ + AS="$AS" \ CC="%{l_cc}" \ CFLAGS="%{l_cflags}" \ %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" @@ -224,7 +251,6 @@ l_libcflags="-g" l_libcxxflags="-g" # at least GNU as from GNU binutils supports -pipe always - AS="%{l_tool_locate as as}" "$AS" --version /dev/null | grep "^GNU assembler " >/dev/null && { l_boot_cflags="$l_boot_cflags -pipe" l_libcxxflags="$l_libcxxflags -pipe"