gcc/gcc.spec

changeset 322
30c214982bd2
parent 321
bbed90117468
child 328
aee811db821a
equal deleted inserted replaced
1:2638521e6252 2:f889d216ddc2
58 Patch0: gcc.patch 58 Patch0: gcc.patch
59 59
60 # build information 60 # build information
61 Prefix: %{l_prefix} 61 Prefix: %{l_prefix}
62 BuildRoot: %{l_buildroot} 62 BuildRoot: %{l_buildroot}
63 BuildPreReq: OpenPKG, openpkg >= 20100101, make 63 BuildPreReq: OpenPKG, openpkg >= 20060823, make
64 PreReq: OpenPKG, openpkg >= 20100101 64 PreReq: OpenPKG, openpkg >= 20060823
65 %if "%{with_binutils}" == "yes" 65 %if "%{with_binutils}" == "yes"
66 BuildPreReq: binutils >= 2.14 66 BuildPreReq: binutils >= 2.14
67 PreReq: binutils >= 2.14 67 PreReq: binutils >= 2.14
68 %endif 68 %endif
69 BuildPreReq: mpc, mpfr, gmp 69 BuildPreReq: mpc, mpfr, gmp
131 %build 131 %build
132 # create build sub-directory 132 # create build sub-directory
133 %{l_shtool} mkdir -p obj 133 %{l_shtool} mkdir -p obj
134 cd obj 134 cd obj
135 135
136 # determine ld(1) and as(1) usage 136 # solve strange compatability problems
137 case "%{l_platform -t}" in
138 *-sunos* )
139 %if "%{with_binutils}" == "no"
140 ( echo "Building GCC on Solaris OS requires GNU as, however"
141 echo "the OS native linker will be used in place of GNU ld."
142 echo ""
143 echo "To solve this problem, install the binutils package"
144 echo "and build GCC again using the option 'with_binutils'."
145 echo "OpenPKG will ignore GNU ld but use GNU as to build GCC."
146 echo ""
147 echo "Please note that this condition applies to OpenPKG"
148 echo "building of the GCC package on Solaris only!"
149 ) | %{l_rpmtool} msg -b -t warn
150 exit 1;
151 ;;
152 %else
153 # locate ld(1) and as(1), using the GNU assembler
154 # but ignoring the presence of any OpenPKG linker
155 LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin \
156 which ld`
157 ;;
158 %endif
159 *-* )
160 # determine ld(1) and as(1) usage, allowing either
161 # one to be from the GNU distribution of binutils
162 LD=%{l_tool_locate ld ld}
163 ;;
164 esac
137 l_with_gnu_ld_as="" 165 l_with_gnu_ld_as=""
138 LD=%{l_tool_locate ld ld}
139 AS=%{l_tool_locate as as} 166 AS=%{l_tool_locate as as}
140 echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-ld=$LD" 167 echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD"
141 echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS" 168 echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS"
142 $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" 169 $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"
143 $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" 170 $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"
144 unset LD
145 unset AS
146 171
147 # determine threads usage 172 # determine threads usage
148 %if "%{with_threads}" == "yes" 173 %if "%{with_threads}" == "yes"
149 l_enable_threads="posix" 174 l_enable_threads="posix"
150 %else 175 %else
170 ( echo "am_cv_func_iconv=no" 195 ( echo "am_cv_func_iconv=no"
171 echo "am_cv_lib_iconv=no" 196 echo "am_cv_lib_iconv=no"
172 ) >config.cache 197 ) >config.cache
173 198
174 # configure the package 199 # configure the package
200 LD="$LD" \
201 AS="$AS" \
175 CC="%{l_cc}" \ 202 CC="%{l_cc}" \
176 CFLAGS="%{l_cflags}" \ 203 CFLAGS="%{l_cflags}" \
177 %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes" 204 %if "%{with_java}" == "yes" || "%{with_fortran}" == "yes" || "%{with_cxx}" == "yes"
178 CPPFLAGS="%{l_cppflags}" \ 205 CPPFLAGS="%{l_cppflags}" \
179 LDFLAGS="%{l_ldflags}" \ 206 LDFLAGS="%{l_ldflags}" \
222 l_cxxflags="" 249 l_cxxflags=""
223 l_boot_cflags="" 250 l_boot_cflags=""
224 l_libcflags="-g" 251 l_libcflags="-g"
225 l_libcxxflags="-g" 252 l_libcxxflags="-g"
226 # at least GNU as from GNU binutils supports -pipe always 253 # at least GNU as from GNU binutils supports -pipe always
227 AS="%{l_tool_locate as as}"
228 "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && { 254 "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler " >/dev/null && {
229 l_boot_cflags="$l_boot_cflags -pipe" 255 l_boot_cflags="$l_boot_cflags -pipe"
230 l_libcxxflags="$l_libcxxflags -pipe" 256 l_libcxxflags="$l_libcxxflags -pipe"
231 } 257 }
232 %if "%{with_optimize}" == "yes" 258 %if "%{with_optimize}" == "yes"

mercurial