gcc/gcc.spec

Wed, 30 Mar 2011 19:35:16 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 30 Mar 2011 19:35:16 +0200
changeset 335
6eb79a12ee37
parent 334
4a34d7a82eab
child 337
f71e028eb3e2
permissions
-rw-r--r--

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.

michael@320 1 ##
michael@320 2 ## gcc.spec -- OpenPKG RPM Package Specification
michael@320 3 ## Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@320 4 ##
michael@320 5 ## Permission to use, copy, modify, and distribute this software for
michael@320 6 ## any purpose with or without fee is hereby granted, provided that
michael@320 7 ## the above copyright notice and this permission notice appear in all
michael@320 8 ## copies.
michael@320 9 ##
michael@320 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@320 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@320 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@320 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@320 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@320 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@320 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@320 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@320 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@320 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@320 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@320 21 ## SUCH DAMAGE.
michael@320 22 ##
michael@320 23
michael@320 24 # package version
michael@332 25 %define V_full 4.6.0
michael@320 26 %define V_comp %nil
michael@320 27
michael@320 28 # package information
michael@320 29 Name: gcc
michael@320 30 Summary: GNU Compiler Collection
michael@320 31 URL: http://gcc.gnu.org/
michael@320 32 Vendor: Free Software Foundation
michael@320 33 Packager: OpenPKG Foundation e.V.
michael@320 34 Distribution: OpenPKG Community
michael@320 35 Class: CORE
michael@320 36 Group: Compiler
michael@320 37 License: GPL
michael@320 38 Version: %{V_full}
michael@335 39 Release: 20110330
michael@320 40
michael@320 41 # package options
michael@320 42 %option with_binutils yes
michael@320 43 %option with_cxx yes
michael@320 44 %option with_objc no
michael@320 45 %option with_java no
michael@320 46 %option with_fortran no
michael@320 47 %option with_optimize yes
michael@320 48 %option with_profile no
michael@320 49 %option with_threads yes
michael@320 50 %option with_multilib no
michael@320 51
michael@335 52 # fix intermodule dependencies implicitly
michael@335 53 %if "%{with_java}" == "yes"
michael@335 54 %define with_cxx yes
michael@335 55 %define with_threads yes
michael@335 56 %endif
michael@335 57
michael@320 58 # list of sources
michael@320 59 Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-core-%{V_full}.tar.bz2
michael@320 60 Source1: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-g++-%{V_full}.tar.bz2
michael@320 61 Source2: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-objc-%{V_full}.tar.bz2
michael@320 62 Source3: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-java-%{V_full}.tar.bz2
michael@320 63 Source4: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{V_full}/gcc-fortran-%{V_full}.tar.bz2
michael@320 64 Patch0: gcc.patch
michael@320 65
michael@320 66 # build information
michael@321 67 Prefix: %{l_prefix}
michael@321 68 BuildRoot: %{l_buildroot}
michael@332 69 BuildPreReq: OpenPKG, openpkg >= 20060823, make
michael@322 70 PreReq: OpenPKG, openpkg >= 20060823
michael@332 71 BuildPreReq: mpc, mpfr, gmp
michael@332 72 PreReq: mpc, mpfr, gmp
michael@320 73 %if "%{with_binutils}" == "yes"
michael@320 74 BuildPreReq: binutils >= 2.14
michael@320 75 PreReq: binutils >= 2.14
michael@320 76 %endif
michael@320 77 %if "%{with_cxx}" == "yes"
michael@320 78 BuildPreReq: libiconv
michael@320 79 PreReq: libiconv
michael@320 80 %endif
michael@320 81 %if "%{with_java}" == "yes"
michael@335 82 BuildPreReq: zlib, infozip
michael@320 83 PreReq: zlib
michael@320 84 %endif
michael@321 85 AutoReq: no
michael@321 86 AutoReqProv: no
michael@320 87
michael@320 88 %description
michael@320 89 The GNU Compiler Collection (GCC) provides standard conforming and
michael@320 90 highly portable compilers for the ISO C, ISO C++, Objective-C,
michael@320 91 Fortran and Java languages.
michael@320 92
michael@320 93 %track
michael@320 94 prog gcc = {
michael@320 95 version = %{V_full}
michael@320 96 url = ftp://gcc.gnu.org/pub/gcc/releases/
michael@320 97 regex = gcc-(4\.\d+\.\d+)
michael@320 98 url = ftp://gcc.gnu.org/pub/gcc/releases/gcc-__NEWVER__/
michael@320 99 regex = gcc-core-(\d+\.\d+\.\d+)\.tar\.bz2
michael@320 100 }
michael@320 101
michael@320 102 %prep
michael@320 103 %setup -q
michael@320 104 %if "%{with_cxx}" == "yes"
michael@320 105 %setup -q -T -D -b 1
michael@320 106 %endif
michael@320 107 %if "%{with_objc}" == "yes"
michael@320 108 %setup -q -T -D -b 2
michael@320 109 %endif
michael@320 110 %if "%{with_java}" == "yes"
michael@320 111 %setup -q -T -D -b 3
michael@320 112 %endif
michael@320 113 %if "%{with_fortran}" == "yes"
michael@320 114 %setup -q -T -D -b 4
michael@320 115 %endif
michael@320 116 %patch -p0
michael@332 117 %{l_shtool} subst \
michael@332 118 -e 's;\(instname="\$dir/\$name"\)i;\1;' \
michael@332 119 ltmain.sh
michael@320 120 %{l_shtool} subst -v -s \
michael@328 121 -e 's;\(gmplibs="-lmpc\) \(-lmpfr -lgmp\);\1 -lm \2;' \
michael@328 122 configure
michael@328 123 %{l_shtool} subst -v -s \
michael@335 124 -e 's;\(LDEXP_LIB=\)"$LIBS";\1"$LDFLAGS";' \
michael@320 125 -e 's;PREFIX_INCLUDE_DIR;PREFIX_INCLUDE_DIR_DISABLED;g' \
michael@320 126 gcc/configure
michael@332 127 %{l_shtool} subst \
michael@332 128 -e 's;[ \t]*-W[a-zA-Z0-9_\-][a-zA-Z0-9_\-]*,*;;g' \
michael@332 129 lto-plugin/Makefile.in
michael@332 130 %{l_shtool} subst \
michael@332 131 -e 's;-rpath *[^ \t][^ \t]*;;g' \
michael@332 132 -e 's;--tag=disable-static;--tag=disable-shared;g' \
michael@332 133 -e 's;\.\./libiberty/libiberty\.a;-L../libiberty -liberty;g' \
michael@332 134 -e 's;\.\./libiberty/pic/libiberty\.a;-L../libiberty/pic -liberty;g' \
michael@332 135 lto-plugin/Makefile.in
michael@320 136 if [ ".%{V_comp}" != . ]; then
michael@320 137 %{l_shtool} subst -v -s \
michael@320 138 -e 's;(libdir)/gcc/;(libdir)/gcc%{V_comp}/;' \
michael@320 139 `find . -name Makefile.in -type f -print`
michael@320 140 fi
michael@334 141 %{l_shtool} subst \
michael@334 142 -e 's;^\(do-compare\) *\(=.*\);#\1-shouldnt-be-defined-here \2;' \
michael@334 143 config/*.mk
michael@320 144 case "%{l_platform -t}" in
michael@334 145 amd64-linux* )
michael@320 146 %{l_shtool} subst \
michael@320 147 -e 's/GLIBCXX_IS_NATIVE=false/GLIBCXX_IS_NATIVE=true/g' \
michael@320 148 -e 's/test x.gcc_no_link = xyes/false/g' \
michael@320 149 libstdc++-v3/configure
michael@320 150 ;;
michael@320 151 esac
michael@320 152 %{l_shtool} subst \
michael@320 153 -e 's;<iconv\.h>;"%{l_prefix}/include/iconv.h";' \
michael@320 154 libstdc++-v3/include/ext/codecvt_specializations.h
michael@320 155
michael@320 156 %build
michael@334 157 # create build subdirectory
michael@320 158 %{l_shtool} mkdir -p obj
michael@320 159 cd obj
michael@320 160
michael@334 161 # locate ld(1) and as(1) accordingly
michael@328 162 %if "%{with_binutils}" == "yes"
michael@334 163 # allow OpenPKG binutils
michael@328 164 LD=%{l_tool_locate ld ld}
michael@328 165 AS=%{l_tool_locate as as}
michael@322 166 %else
michael@334 167 # ignore OpenPKG binutils
michael@334 168 LD=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin:/usr/local/bin:/usr/local/sbin which ld`
michael@334 169 AS=`PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/bin:/opt/sbin:/usr/local/bin:/usr/local/sbin which as`
michael@322 170 %endif
michael@320 171 l_with_gnu_ld_as=""
michael@322 172 echo $LD | grep '^/' >/dev/null && l_with_gnu_ld_as="--with-ld=$LD"
michael@320 173 echo $AS | grep '^/' >/dev/null && l_with_gnu_ld_as="${l_with_gnu_ld_as} --with-as=$AS"
michael@322 174 $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"
michael@322 175 $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"
michael@320 176
michael@334 177 # determine threads use
michael@320 178 %if "%{with_threads}" == "yes"
michael@320 179 l_enable_threads="posix"
michael@320 180 %else
michael@320 181 l_enable_threads="single"
michael@320 182 %endif
michael@320 183
michael@334 184 # determine language use
michael@320 185 l_enable_languages="c"
michael@320 186 %if "%{with_cxx}" == "yes"
michael@320 187 l_enable_languages="${l_enable_languages},c++"
michael@320 188 %endif
michael@320 189 %if "%{with_objc}" == "yes"
michael@320 190 l_enable_languages="${l_enable_languages},objc"
michael@320 191 %endif
michael@320 192 %if "%{with_java}" == "yes"
michael@320 193 l_enable_languages="${l_enable_languages},java"
michael@320 194 %endif
michael@320 195 %if "%{with_fortran}" == "yes"
michael@320 196 l_enable_languages="${l_enable_languages},f95"
michael@320 197 %endif
michael@320 198
michael@334 199 # disable GNU iconv use
michael@320 200 ( echo "am_cv_func_iconv=no"
michael@320 201 echo "am_cv_lib_iconv=no"
michael@320 202 ) >config.cache
michael@334 203 # platforms failing 'compare' make target (see prep as well)
michael@332 204 case "%{l_platform -t}" in
michael@334 205 *i?86-sunos* ) echo "gcc_cv_prog_cmp_skip=true" >>config.cache ;;
michael@334 206 *amd64-linux* ) echo "gcc_cv_prog_cmp_skip=true" >>config.cache ;;
michael@332 207 esac
michael@332 208
michael@320 209 # configure the package
michael@322 210 LD="$LD" \
michael@322 211 AS="$AS" \
michael@320 212 CC="%{l_cc}" \
michael@320 213 CFLAGS="%{l_cflags}" \
michael@335 214 %if "%{with_cxx}" == "yes"
michael@320 215 CPPFLAGS="%{l_cppflags}" \
michael@320 216 LDFLAGS="%{l_ldflags}" \
michael@320 217 %endif
michael@320 218 CONFIG_SHELL="%{l_bash}" \
michael@332 219 GREP="%{l_bash}" \
michael@320 220 ../configure \
michael@320 221 --with-bugurl="http://openpkg.org/" \
michael@320 222 --with-pkgversion="%{l_openpkg_release -F "OpenPKG-%%t"}" \
michael@320 223 --cache-file=./config.cache \
michael@320 224 --srcdir=`pwd`/.. \
michael@320 225 --prefix=%{l_prefix} \
michael@320 226 --exec-prefix=%{l_prefix} \
michael@320 227 --mandir=%{l_prefix}/man \
michael@320 228 --infodir=%{l_prefix}/info \
michael@320 229 --includedir=%{l_prefix}/include/gcc%{V_comp} \
michael@320 230 --libexecdir=%{l_prefix}/libexec/gcc%{V_comp} \
michael@320 231 --with-gxx-include-dir=%{l_prefix}/include/g++%{V_comp} \
michael@320 232 --with-local-prefix=%{l_prefix}/lib/gcc%{V_comp} \
michael@320 233 --enable-languages="${l_enable_languages}" \
michael@320 234 --enable-threads="${l_enable_threads}" \
michael@320 235 --disable-maintainer-mode \
michael@320 236 --disable-shared \
michael@320 237 --disable-nls \
michael@320 238 %if "%{with_java}" == "yes"
michael@320 239 --with-system-zlib \
michael@320 240 %endif
michael@320 241 %if "%{with_multilib}" == "yes"
michael@320 242 --enable-multilib \
michael@320 243 %else
michael@320 244 --disable-multilib \
michael@320 245 %endif
michael@320 246 %if "%{with_cxx}" == "yes"
michael@320 247 --with-libiconv-prefix=%{l_prefix} \
michael@320 248 %endif
michael@320 249 --with-gmp=%{l_prefix} \
michael@320 250 --with-mpfr=%{l_prefix} \
michael@320 251 --with-mpc=%{l_prefix} \
michael@320 252 ${l_with_gnu_ld_as}
michael@320 253
michael@320 254 # determine build flags
michael@320 255 l_ccisgcc=no
michael@320 256 if [ ".`(%{l_cc} -v; %{l_cc} --version) </dev/null 2>&1 | grep -i 'gcc'`" != . ]; then
michael@320 257 l_ccisgcc=yes
michael@320 258 fi
michael@320 259 l_cflags=""
michael@320 260 l_cxxflags=""
michael@320 261 l_boot_cflags=""
michael@320 262 l_libcflags="-g"
michael@320 263 l_libcxxflags="-g"
michael@320 264 # at least GNU as from GNU binutils supports -pipe always
michael@332 265 "$AS" --version </dev/null 2>/dev/null | grep "^GNU assembler" >/dev/null && {
michael@320 266 l_boot_cflags="$l_boot_cflags -pipe"
michael@320 267 l_libcxxflags="$l_libcxxflags -pipe"
michael@320 268 }
michael@320 269 %if "%{with_optimize}" == "yes"
michael@334 270 # GCC authors are not keeping up with optimized portability expectations
michael@334 271 ( echo "As GCC advances its optimization logic becomes increasingly complex (and"
michael@334 272 echo "buggy?) Since at least GCC 4.5, problems have been reported using arguments"
michael@334 273 echo "-O, -mtune, or -march implicitly or explicitly during different bootstrap"
michael@334 274 echo "stages as well as stage comparison and even the final installation."
michael@334 275 echo ""
michael@334 276 echo "Pay attention when building on one computer and installing on another as"
michael@334 277 echo "problems may be platform specific. If in doubt, disable optimization."
michael@334 278 ) | %{l_rpmtool} msg -b -t warn
michael@332 279 if [ ".$l_ccisgcc" = .yes ]; then
michael@334 280 l_archia32=native; l_archia64=native; l_archamd64=native
michael@332 281 else
michael@334 282 # CPU native detection only works with GCC (see driver-i386.c)
michael@334 283 ( echo "Platform specific optimization is enabled, but detection of appropriate"
michael@334 284 echo "native architecture is only possible when bootstrapping GCC using a pre-"
michael@334 285 echo "installed GCC. The current build is using a different compiler, so to"
michael@334 286 echo "provide any optimization at all a wild guess is made and a CPU type"
michael@334 287 echo "hardcoded instead of using accurate native detection."
michael@334 288 echo ""
michael@334 289 echo "To achieve accurate optimization of GCC please install GCC first. Then"
michael@334 290 echo "build this package a second time which will use GCC to bootstrap itself."
michael@334 291 ) | %{l_rpmtool} msg -b -t notice
michael@334 292
michael@334 293 # guess lowest common denominator CPU types
michael@334 294 # http://en.wikipedia.org/wiki/(X86|X64-64)
michael@334 295 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
michael@334 296 l_archia32=pentium3; l_archia64=nocona; l_archamd64=k8
michael@332 297 fi
michael@334 298 # this optimization logic is unportable and could cause problems
michael@334 299 # if installing the resulting binary package on a different host!
michael@332 300 case "%{l_platform -t}" in
michael@332 301 *sun4[uv]-* ) l_boot_cflags="$l_boot_cflags -mtune=v9" ;;
michael@334 302 *sun-* ) l_boot_cflags="$l_boot_cflags -mtune=v8" ;;
michael@334 303 *i?86-* ) l_boot_cflags="$l_boot_cflags -march=$l_archia32" ;;
michael@334 304 *ia64-* ) l_boot_cflags="$l_boot_cflags -march=$l_archia64" ;;
michael@334 305 *amd64-* ) l_boot_cflags="$l_boot_cflags -march=$l_archamd64" ;;
michael@334 306 * ) l_boot_cflags="$l_boot_cflags -mtune=generic" ;;
michael@332 307 esac
michael@332 308 l_cflags="$l_cflags -O"
michael@332 309 l_boot_cflags="$l_boot_cflags -O3 -fomit-frame-pointer"
michael@332 310 l_libcxxflags="$l_libcxxflags -O3 -fno-implicit-templates"
michael@332 311 %else
michael@334 312 # don't optimize at all to avoid problems
michael@320 313 l_boot_cflags="$l_boot_cflags -O0"
michael@320 314 l_libcxxflags="$l_libcxxflags -O0"
michael@320 315 %endif
michael@334 316 %if "%{with_profile}" == "yes"
michael@335 317 # generate profile feedback
michael@334 318 maketarget="profiledbootstrap"
michael@334 319 loc_makeflags="%{l_mflags}"
michael@335 320
michael@335 321 # warn about exceptional build duration for profile feedback
michael@335 322 ( echo "Building profile feedback on some hosts can take many days to complete!"
michael@335 323 echo "Now continuing to build a profiled bootstrap with parallel make logic"
michael@335 324 echo "disabled according to profiling requirements..."
michael@335 325 ) | %{l_rpmtool} msg -b -t warn
michael@335 326
michael@335 327 # warn about profiled bootstrap requirement of 64-bit arithmetic
michael@334 328 if [ ".$l_ccisgcc" != .yes ]; then
michael@335 329 ( echo "A preinstalled GCC was not detected although one is recommended for"
michael@335 330 echo "building a profiled bootstrap. Buildtime or runtime errors can occur if"
michael@335 331 echo "the compiler used to build profile feedback doesn't support 64-bit math."
michael@334 332 echo ""
michael@334 333 echo "If in doubt, stop now and start the build again with profiling disabled."
michael@334 334 ) | %{l_rpmtool} msg -b -t warn
michael@334 335 fi
michael@334 336 %else
michael@335 337 # build in three stages
michael@332 338 maketarget="bootstrap"
michael@334 339 loc_makeflags="%{l_mflags -O}"
michael@320 340 %endif
michael@320 341 case "%{l_platform -t}" in
michael@332 342 *64-* ) l_cflags="$l_cflags -fPIC"; l_cxxflags="$l_cxxflags -fPIC" ;;
michael@320 343 esac
michael@335 344 %if "%{with_cxx}" == "yes"
michael@320 345 l_cflags="$l_cflags %{l_cppflags}"
michael@320 346 l_cxxflags="$l_cxxflags %{l_cppflags}"
michael@320 347 l_libcflags="$l_libcflags %{l_cppflags}"
michael@320 348 l_libcxxflags="$l_libcxxflags %{l_cppflags}"
michael@320 349 %endif
michael@320 350
michael@320 351 # build the package
michael@334 352 MAKE="%{l_make} ${loc_makeflags}" \
michael@334 353 %{l_make} ${loc_makeflags} \
michael@332 354 GREP="grep" \
michael@334 355 MAKE="%{l_make} ${loc_makeflags}" \
michael@320 356 BOOT_CFLAGS="${l_boot_cflags}" \
michael@320 357 CFLAGS="${l_cflags}" \
michael@320 358 CXXFLAGS="${l_cxxflags}" \
michael@335 359 %if "%{with_cxx}" == "yes"
michael@335 360 CPPFLAGS="%{l_cppflags}" \
michael@335 361 LDFLAGS="%{l_ldflags}" \
michael@335 362 BOOT_LDFLAGS="%{l_ldflags}" \
michael@335 363 %endif
michael@320 364 LIBCFLAGS="${l_libcflags}" \
michael@320 365 LIBCXXFLAGS="${l_libcxxflags}" \
michael@320 366 $maketarget
michael@320 367
michael@320 368 %install
michael@321 369 rm -rf $RPM_BUILD_ROOT
michael@320 370
michael@320 371 # fetch GNU platform triple
michael@320 372 triple=`./config.guess`
michael@320 373
michael@320 374 # perform the standard installation procedure
michael@320 375 ( cd obj
michael@320 376 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@320 377 ) || exit $?
michael@320 378
michael@320 379 # cleanup installation tree
michael@320 380 mv $RPM_BUILD_ROOT%{l_prefix}/lib/{lib*.a,*.spec} \
michael@320 381 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/ \
michael@320 382 >/dev/null 2>&1 || true
michael@320 383 mv $RPM_BUILD_ROOT%{l_prefix}/lib64/{lib*.a,*.spec} \
michael@320 384 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/ \
michael@320 385 >/dev/null 2>&1 || true
michael@320 386 dirs=""
michael@320 387 for multilib in `$RPM_BUILD_ROOT%{l_prefix}/bin/gcc --print-multi-lib`; do
michael@320 388 subdir=`echo "$multilib" | sed -e 's/;.*$//'`
michael@320 389 [ ".$subdir" = .. ] && continue
michael@320 390 mv $RPM_BUILD_ROOT%{l_prefix}/lib/$subdir/lib*.a \
michael@320 391 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/$subdir/ \
michael@320 392 >/dev/null 2>&1 || true
michael@320 393 mv $RPM_BUILD_ROOT%{l_prefix}/lib64/$subdir/lib*.a \
michael@320 394 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/$subdir/ \
michael@320 395 >/dev/null 2>&1 || true
michael@320 396 dirs="$dirs $subdir"
michael@320 397 done
michael@320 398 for subdir in $dirs; do
michael@320 399 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/$subdir >/dev/null 2>&1 || true
michael@320 400 done
michael@320 401 mv $RPM_BUILD_ROOT%{l_prefix}/${triple}/include/* \
michael@320 402 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/include/ \
michael@320 403 >/dev/null 2>&1 || true
michael@320 404
michael@332 405 # correct hardcoded paths
michael@332 406 %{l_shtool} subst \
michael@332 407 -e "s;\(dependency_libs='[ \t]*-L\).*;\1%{l_prefix}/lib -L%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]* -liberty';" \
michael@332 408 $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/liblto_plugin.la
michael@332 409
michael@320 410 # strip installation tree
michael@320 411 rm -rf $RPM_BUILD_ROOT%{l_prefix}/${triple}
michael@320 412 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
michael@320 413 rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man7 >/dev/null 2>&1 || true
michael@320 414 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la >/dev/null 2>&1 || true
michael@320 415 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib64 >/dev/null 2>&1 || true
michael@320 416 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-gcc* >/dev/null 2>&1 || true
michael@320 417 %if "%{with_cxx}" == "yes"
michael@320 418 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-c++ >/dev/null 2>&1 || true
michael@320 419 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*-g++ >/dev/null 2>&1 || true
michael@320 420 %endif
michael@320 421 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@320 422 for prog in cc1 cc1plus collect2 cpp; do
michael@320 423 strip $RPM_BUILD_ROOT%{l_prefix}/lib/gcc%{V_comp}/${triple}/[0-9]*/${prog} \
michael@320 424 >/dev/null 2>&1 || true
michael@320 425 done
michael@320 426
michael@320 427 # bump up installation tree
michael@320 428 ln $RPM_BUILD_ROOT%{l_prefix}/bin/gcc \
michael@320 429 $RPM_BUILD_ROOT%{l_prefix}/bin/cc
michael@320 430 ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/gcc.1 \
michael@320 431 $RPM_BUILD_ROOT%{l_prefix}/man/man1/cc.1
michael@320 432 %if "%{with_cxx}" == "yes"
michael@320 433 ln $RPM_BUILD_ROOT%{l_prefix}/man/man1/g++.1 \
michael@320 434 $RPM_BUILD_ROOT%{l_prefix}/man/man1/c++.1
michael@320 435 %endif
michael@320 436
michael@320 437 # determine installation file list
michael@320 438 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@320 439
michael@320 440 %files -f files
michael@320 441
michael@320 442 %clean
michael@321 443 rm -rf $RPM_BUILD_ROOT
michael@320 444

mercurial