gcc/gcc.spec

Fri, 03 Aug 2012 17:18:55 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 03 Aug 2012 17:18:55 +0200
changeset 468
695288b7c41a
parent 407
633675dc493c
child 473
323623610492
permissions
-rw-r--r--

Blind commit, looks like I discovered ugly conditional binary names.

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

mercurial