gcc/gcc.spec

changeset 322
30c214982bd2
parent 321
bbed90117468
child 328
aee811db821a
     1.1 --- a/gcc/gcc.spec	Thu Mar 24 19:02:24 2011 +0100
     1.2 +++ b/gcc/gcc.spec	Thu Mar 24 19:04:49 2011 +0100
     1.3 @@ -60,8 +60,8 @@
     1.4  #   build information
     1.5  Prefix:       %{l_prefix}
     1.6  BuildRoot:    %{l_buildroot}
     1.7 -BuildPreReq:  OpenPKG, openpkg >= 20100101, make
     1.8 -PreReq:       OpenPKG, openpkg >= 20100101
     1.9 +BuildPreReq:  OpenPKG, openpkg >= 20060823, make
    1.10 +PreReq:       OpenPKG, openpkg >= 20060823
    1.11  %if "%{with_binutils}" == "yes"
    1.12  BuildPreReq:  binutils >= 2.14
    1.13  PreReq:       binutils >= 2.14
    1.14 @@ -133,16 +133,41 @@
    1.15      %{l_shtool} mkdir -p obj
    1.16      cd obj
    1.17  
    1.18 -    #   determine ld(1) and as(1) usage
    1.19 +    #   solve strange compatability problems
    1.20 +    case "%{l_platform -t}" in
    1.21 +        *-sunos* )
    1.22 +%if "%{with_binutils}" == "no"
    1.23 +            ( echo "Building GCC on Solaris OS requires GNU as, however"
    1.24 +              echo "the OS native linker will be used in place of GNU ld."
    1.25 +              echo ""
    1.26 +              echo "To solve this problem, install the binutils package"
    1.27 +              echo "and build GCC again using the option 'with_binutils'."
    1.28 +              echo "OpenPKG will ignore GNU ld but use GNU as to build GCC."
    1.29 +              echo ""
    1.30 +              echo "Please note that this condition applies to OpenPKG"
    1.31 +              echo "building of the GCC package on Solaris only!"
    1.32 +            ) | %{l_rpmtool} msg -b -t warn
    1.33 +            exit 1;
    1.34 +            ;;
    1.35 +%else
    1.36 +            #   locate ld(1) and as(1), using the GNU assembler
    1.37 +            #   but ignoring the presence of any OpenPKG linker
    1.38 +            LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin \
    1.39 +                which ld`
    1.40 +            ;;
    1.41 +%endif
    1.42 +        *-* )
    1.43 +            #   determine ld(1) and as(1) usage, allowing either
    1.44 +            #   one to be from the GNU distribution of binutils
    1.45 +            LD=%{l_tool_locate ld ld}
    1.46 +            ;;
    1.47 +    esac
    1.48      l_with_gnu_ld_as=""
    1.49 -    LD=%{l_tool_locate ld ld}
    1.50      AS=%{l_tool_locate as as}
    1.51 -    echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-ld=$LD"
    1.52 +    echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD"
    1.53      echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS"
    1.54 -    $LD --version </dev/null 2>/dev/null | grep "^GNU ld "        >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-ld"
    1.55 -    $AS --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-gnu-as"
    1.56 -    unset LD
    1.57 -    unset AS
    1.58 +    $LD --version </dev/null 2>/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"
    1.59 +    $AS --version </dev/null 2>/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"
    1.60  
    1.61      #   determine threads usage
    1.62  %if "%{with_threads}" == "yes"
    1.63 @@ -172,6 +197,8 @@
    1.64      ) >config.cache
    1.65  
    1.66      #   configure the package
    1.67 +    LD="$LD" \
    1.68 +    AS="$AS" \
    1.69      CC="%{l_cc}" \
    1.70      CFLAGS="%{l_cflags}" \
    1.71  %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes"
    1.72 @@ -224,7 +251,6 @@
    1.73      l_libcflags="-g"
    1.74      l_libcxxflags="-g"
    1.75      #   at least GNU as from GNU binutils supports -pipe always
    1.76 -    AS="%{l_tool_locate as as}"
    1.77      "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && {
    1.78          l_boot_cflags="$l_boot_cflags -pipe"
    1.79          l_libcxxflags="$l_libcxxflags -pipe"

mercurial