1 %define building_libffi 1
4 # Ada currently fails to build on a few platforms, enable it only
6 # Note that AdaCore only supports %ix86, x86_64 and ia64
8 %define build_ada !0%{?building_libjava:1}%{?building_libffi:1}
13 %define quadmath_arch %ix86 x86_64
15 # We don't want to build java
17 %define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
20 %define build_fortran 1
22 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
23 %define build_with_mudflap 0
34 # For optional compilers only build C, C++ and Fortran
35 ##%if 0%{?build_optional_compiler:1}%{?build_optional_compiler_languages:1}
36 %if 0%{!?building_libffi:1}
39 %define build_libjava 0
48 BuildRequires: gettext-tools
49 BuildRequires: makeinfo
50 BuildRequires: glibc-devel-32bit
51 BuildRequires: mpc-devel
52 BuildRequires: mpfr-devel
54 BuildRequires: texinfo
55 BuildRequires: zlib-devel
56 %ifarch %ix86 x86_64 %arm
57 BuildRequires: cloog-devel
58 BuildRequires: ppl-devel
61 %define hostsuffix -4.8
62 BuildRequires: gcc48-ada
64 %if 0%{?building_libjava:1}%{?building_testsuite:1}
65 BuildRequires: fastjar
68 %if 0%{?building_libffi:1}
69 BuildRequires: pkg-config
72 BuildRequires: dejagnu
77 # Define version number of libgcc_s
81 %define separate_bi32 0
82 %define separate_bi64 0
84 %define separate_bi32 1
87 # Define two macros to trigger -32bit or -64bit package variants
88 %define separate_biarch 0
90 %define separate_biarch 1
91 %define separate_biarch_suffix -32bit
94 %define separate_biarch 1
95 %define separate_biarch_suffix -64bit
99 # 64-bit is primary build target
100 %define build_primary_64bit 1
102 %define build_primary_64bit 0
105 %define biarch_libjava 0
108 %define biarch_targets x86_64
110 URL: http://gcc.gnu.org/
113 %define gcc_version %(echo %version | sed 's/_.*//')
114 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
115 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
116 %define binsuffix -4.8
119 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
120 Requires: binutils glibc-devel
121 Requires: cpp48 = %{version}-%{release}
122 %if 0%{!?build_optional_compiler:1}
123 Requires: libgcc%{libgcc_s} >= %{version}-%{release}
124 Requires: libgomp1 >= %{version}-%{release}
125 %if %{build_with_mudflap}
126 Requires: libmudflap0 >= %{version}-%{release}
127 Requires: libmudflapth0 >= %{version}-%{release}
130 Requires: libgcc48 = %{version}-%{release}
131 Requires: libgomp48 = %{version}-%{release}
136 BuildRoot: %{_tmppath}/%{name}-%{version}-build
137 #Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
138 Source: gcc-%{version}.tar.bz2
141 Source2: libgcj48-rpmlintrc
142 Source3: gcc48-rpmlintrc
144 Source6: baselibs.conf
145 # Patches auto-generated by git-buildpackage:
146 Patch0: 0001-dir-version.patch
147 Patch1: 0002-textdomain.patch
148 Patch2: 0003-rename-info-files.patch
149 Patch3: 0004-ARM-linker.patch
151 # GCC-TESTSUITE-DELETE-BEGIN
154 Summary: Foreign Function Interface library
155 License: BSD-3-Clause
156 Group: Base/Libraries
157 Provides: g-wrap:/usr/lib/libffi.so.4
158 Provides: libffi4 = %{version}-%{release}
159 Conflicts: libffi4 < %{version}-%{release}
162 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
172 %package -n libffi48-32bit
173 Summary: Foreign Function Interface library
174 License: BSD-3-Clause
175 Group: Base/Libraries
176 Provides: g-wrap:/usr/lib/libffi.so.4
177 Provides: libffi4-32bit = %{version}-%{release}
178 Conflicts: libffi4-32bit < %{version}-%{release}
180 %description -n libffi48-32bit
181 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
183 %post -n libffi48-32bit
186 %postun -n libffi48-32bit
191 %package -n libffi48-64bit
192 Summary: Foreign Function Interface library
193 License: BSD-3-Clause
194 Group: Base/Libraries
195 Provides: g-wrap:/usr/lib/libffi.so.4
196 Provides: libffi4-64bit = %{version}-%{release}
197 Conflicts: libffi4-64bit < %{version}-%{release}
199 %description -n libffi48-64bit
200 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
202 %post -n libffi48-64bit
205 %postun -n libffi48-64bit
211 %package -n libffi48-devel
212 Summary: Foreign Function Interface library development files
213 License: BSD 3-Clause
214 Group: Development/Toolchain
215 Requires: libffi4 >= %{version}-%{release}
216 Provides: libffi-devel = %{version}-%{release}
217 Conflicts: libffi-devel < %{version}-%{release}
219 %description -n libffi48-devel
220 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
224 %package -n libffi48-devel-32bit
225 Summary: Foreign Function Interface library development files
226 License: BSD 3-Clause
227 Group: Development/Toolchain
228 Requires: libffi4-32bit >= %{version}-%{release}
229 Provides: libffi-devel-32bit = %{version}-%{release}
230 Conflicts: libffi-devel-32bit < %{version}-%{release}
232 %description -n libffi48-devel-32bit
233 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
237 %package -n libffi48-devel-64bit
238 Summary: Foreign Function Interface library development files
239 License: BSD 3-Clause
240 Group: Development/Toolchain
241 Requires: libffi4-64bit >= %{version}-%{release}
242 Provides: libffi-devel-64bit = %{version}-%{release}
243 Conflicts: libffi-devel-64bit < %{version}-%{release}
245 %description -n libffi48-devel-64bit
246 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
249 %package -n gcc48-testresults
250 # GCC-TESTSUITE-DELETE-END
251 Summary: Testsuite results
252 License: Public-Domain
253 Group: Development/Toolchain
255 %description -n gcc48-testresults
256 Results from running the gcc and target library testsuites.
261 # Define the canonical target and host architecture
262 # %gcc_target_arch is supposed to be the full target triple
263 # %TARGET_ARCH is the canonicalized CPU part
264 # %CONFIGURE_TARGET is the target triple used for --target=
265 %if 0%{?gcc_target_arch:1}
266 %define CONFIGURE_TARGET %{gcc_target_arch}
267 %define TARGET_ARCH %(echo %{gcc_target_arch} | cut -d - -f 1 | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
268 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
269 %define CONFIGURE_TARGET i586-tizen-linux
271 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
272 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
274 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
275 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
277 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7el"
278 %define CONFIGURE_TARGET armv7el-tizen-linux-gnueabi
280 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5el"
281 %define CONFIGURE_TARGET armv5el-tizen-linux-gnueabi
284 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
286 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
288 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
291 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
293 %define GCCDIST %{HOST_ARCH}-tizen-linux
296 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
297 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
301 # Versionspecific directories
302 %define versmainlibdir %{libsubdir}
303 %define versmainlibdirbi32 %{libsubdir}/32
304 %define versmainlibdirbi64 %{libsubdir}/64
305 %if %{build_primary_64bit}
306 %define versmainlibdirbi %{versmainlibdirbi32}
308 %define versmainlibdirbi %{versmainlibdirbi64}
311 %if 0%{?build_optional_compiler:1}
312 %define mainlibdir %{versmainlibdir}
313 %define mainlibdirbi32 %{versmainlibdirbi32}
314 %define mainlibdirbi64 %{versmainlibdirbi64}
315 %define noflibdir %{versnoflibdir}
316 %define mainlibdirbi %{versmainlibdirbi}
318 %define mainlibdir %{_libdir}
319 %define mainlibdirbi32 %{_prefix}/lib
320 %define mainlibdirbi64 %{_prefix}/lib64
321 %define noflibdir %{_prefix}/lib/nof
322 %if %{build_primary_64bit}
323 %define mainlibdirbi %{mainlibdirbi32}
325 %define mainlibdirbi %{mainlibdirbi64}
330 # Now define a few macros that make it easy to package libs and
331 # related files just to the right package, without caring for the
332 # exact path the files are in.
333 # %mainlib package X from all dirs that belong to the main package
334 # %biarchlib package X from all dirs that belong to the -32/64bit package
335 # by default, nof libs go where the 32bit libs go.
337 %define mainlib() %{mainlibdir}/%1\
341 %define mainlib() %{mainlibdir}/%1\
344 %define biarchlib() %{nil}
346 %if !%{separate_biarch}
348 %define mainlib() %{mainlibdir}/%1\
353 %define mainlib() %{mainlibdir}/%1\
359 %define biarchlib() %{mainlibdirbi}/%1\
362 %define mainlib() %{mainlibdir}/%1\
365 %define biarchlib() %{mainlibdirbi}/%1\
372 %define versmainlib() %{versmainlibdir}/%1\
376 %define versmainlib() %{versmainlibdir}/%1\
379 %define versbiarchlib() %{nil}
381 %if !%{separate_biarch}
383 %define versmainlib() %{versmainlibdir}/%1\
384 %{versmainlibdirbi}/%1\
388 %define versmainlib() %{versmainlibdir}/%1\
389 %{versmainlibdirbi}/%1\
394 %define versbiarchlib() %{versmainlibdirbi}/%1\
397 %define versmainlib() %{versmainlibdir}/%1\
400 %define versbiarchlib() %{versmainlibdirbi}/%1\
410 #%setup -q -n gcc-%{gcc_version}%{snapshot_date}
411 %setup -q -n gcc-%{version}
412 # 0001-dir-version.patch
419 # Avoid rebuilding of generated files
420 contrib/gcc_update --touch
421 # Avoid fucking up testsuite results with Java and indirect dispatch
422 export LD_AS_NEEDED=0
423 # Split version file into version used for directories (X.Y) and
424 # version to report with --version (X.Y.Z).
425 # See also gcc-dir-version.patch.
426 # Also decrement the patchlevel version by one
427 if test `cat gcc/DEV-PHASE` == "prerelease"; then
428 ( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
430 mv gcc/BASE-VER gcc/FULL-VER
432 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
434 rm -rf obj-%{GCCDIST}
437 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
438 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'`
440 # -mcpu is superceded by -mtune but -mtune is not supported by
441 # our bootstrap compiler. -mcpu gives a warning that stops
442 # the build process, so remove it for now. Also remove all other
443 # -march and -mtune flags. They are superseeded by proper
444 # default compiler settings now.
445 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'`
447 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
448 # Kill all -march/tune/cpu because that screws building the target libs
449 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
451 # Replace 2 spaces by one finally
452 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
456 languages=$languages,c++
459 languages=$languages,objc
462 languages=$languages,fortran
465 languages=$languages,obj-c++
468 languages=$languages,java
471 languages=$languages,ada
475 if test -z "$J"; then
476 J=$(getconf _NPROCESSORS_CONF)
479 test 1 -gt "$J" && J=1
480 JL=$(($(getconf _NPROCESSORS_CONF)*2))
482 if test "$J" == "0"; then
485 if test "$JL" == "0"; then
488 PARALLEL="-j$J -l$JL"
490 # we don't want some miscompiles in the testsuite, or some fault in
491 # the compiler to kill the machine. Hence we limit the amount of memory
492 # by the physical RAM plus half of swap
493 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
494 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
495 #ulimit -v $(((MEM + SWAP/2)*1024))
497 # In general we want to ship release checking enabled compilers
498 # and run BETA with checking enabled.
499 #ENABLE_CHECKING="--enable-checking=yes"
500 ENABLE_CHECKING="--enable-checking=release"
502 # Work around tail/head -1 changes
503 export _POSIX2_VERSION=199209
505 # configure tries to parse include/features.h to detect
506 # if glibc supports SSP. When cross compiling we would need
507 # to install a cross glibc, which we don't, or make the whole
508 # thing point to the native glibc, which is in /, hence the
512 # Using the host gnatmake like
513 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
514 # GNATMAKE="gnatmake%{hostsuffix}"
515 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
517 mkdir -p host-tools/bin
518 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
519 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
520 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
521 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
522 ln -sf /usr/%{_lib} host-tools/%{_lib}
523 export PATH="`pwd`/host-tools/bin:$PATH"
525 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
527 # --enable-threads=posix \
530 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
531 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
533 --prefix=%{_prefix} \
534 --infodir=%{_infodir} \
535 --mandir=%{_mandir} \
536 --libdir=%{_libdir} \
537 --libexecdir=%{_libdir} \
538 --enable-languages=$languages \
540 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
545 --disable-bootstrap \
548 --with-bugurl="http://bugs.tizen.org/" \
549 --with-pkgversion="Tizen Linux" \
550 %if !%{build_libjava}
553 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
554 --with-ecj-jar=%{libsubdir}/ecj.jar \
556 %if !%{biarch_libjava}
557 --disable-libjava-multilib \
560 %if !%{build_with_mudflap}
561 --disable-libmudflap \
563 --with-slibdir=/%{_lib} \
565 --enable-__cxa_atexit \
566 --enable-libstdcxx-allocator=new \
567 --disable-libstdcxx-pch \
568 --enable-version-specific-runtime-libs \
569 --enable-linker-build-id \
570 %if 0%{?gcc_target_arch:1}
571 %if 0%{?gcc_icecream:1}
572 --with-build-sysroot=/ \
573 --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
574 --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
575 --enable-linux-futex \
577 %if 0%{?canonical_target:1}
578 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
580 %if 0%{?build_static:1}
583 %if "%{TARGET_ARCH}" == "spu"
584 --with-sysroot=/usr/spu \
585 --with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
589 --target=%{CONFIGURE_TARGET} \
591 --program-suffix=%{binsuffix} \
592 --enable-linux-futex \
593 --without-system-libunwind \
595 %if "%{TARGET_ARCH}" == "armv5tel"
596 --with-arch=armv5te \
599 --with-abi=aapcs-linux \
600 --disable-sjlj-exceptions \
602 %if "%{TARGET_ARCH}" == "armv7el"
603 --with-arch=armv7-a \
604 --with-tune=cortex-a9 \
608 --disable-sjlj-exceptions \
610 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
611 --with-arch=armv7-a \
612 --with-tune=cortex-a9 \
614 --with-abi=aapcs-linux \
615 --with-fpu=vfpv3-d16 \
616 --disable-sjlj-exceptions \
618 %if "%{TARGET_ARCH}" == "i586"
619 --with-arch-32=i586 \
620 --with-tune=generic \
622 %if "%{TARGET_ARCH}" == "x86_64"
623 --with-arch-32=i586 \
624 --with-tune=generic \
630 %if 0%{?building_libffi:1}
631 make stage1-bubble $PARALLEL
632 make all-target-libffi $PARALLEL
634 # Only run profiled bootstrap on archs where it works
635 #%ifarch %ix86 x86_64
636 #make profiledbootstrap-lean STAGE1_CFLAGS="-O -g" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
643 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
644 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
650 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
651 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
652 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
653 make -k check $PARALLEL || true
655 ../contrib/test_summary | tee ../testresults/test_summary.txt
660 export NO_BRP_CHECK_BYTECODE_VERSION=true
662 # GCC-TESTSUITE-DELETE-BEGIN
663 # Work around tail/head -1 changes
664 export _POSIX2_VERSION=199209
665 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
666 %if 0%{?building_libffi:1}
667 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
669 %if 0%{?building_libjava:1}
670 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
671 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
672 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
673 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
674 # install-common also installs collect2, gcov and the g++ and gfortran driver
676 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
679 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
681 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
682 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
684 make install DESTDIR=$RPM_BUILD_ROOT
686 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
687 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
688 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
689 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
690 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
691 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
696 # Remove libffi installed files if we did not want to build it
697 %if !0%{?building_libffi:1}
698 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
700 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
702 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
703 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
704 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
705 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
706 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
709 # Remove some useless .la files
710 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
711 libmudflap libmudflapth libgomp libstdc++ libsupc++ libgcj-tools libgij; do
712 rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
714 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
718 mkdir -p $RPM_BUILD_ROOT%{_libdir}
720 %if %{build_primary_64bit}
721 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
723 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
729 mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
730 ln -sf %{_libdir}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
731 ln -sf %{_libdir}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnat.so
732 chmod a+x $RPM_BUILD_ROOT%{_libdir}/libgna*-*.so
734 mv $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/lib*-*.so $RPM_BUILD_ROOT%{mainlibdirbi}/
735 ln -sf %{mainlibdirbi}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
736 ln -sf %{mainlibdirbi}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
737 chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
741 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
743 # Remove some crap from the .la files:
744 for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
746 # -e '/^dependency_libs/s|%{libsubdir}/\([^.]*\)\.la |%{_libdir}/\1\.la |g'
747 sed -e '/^dependency_libs/s| -L%{_builddir}/[^ ]*||g' \
748 -e '/^dependency_libs/s| -L/usr/%{GCCDIST}/bin||g' \
749 -e '/^dependency_libs/s|-lm \(-lm \)*|-lm |' \
750 -e '/^dependency_libs/s|-L[^ ]* ||g' \
752 %if %{build_primary_64bit}
753 -e '/^libdir/s|%{_libdir}/32|%{_prefix}/lib|' \
754 -e '/^libdir/s|lib64/\.\./||' \
756 -e '/^libdir/s|%{_libdir}/64|%{_prefix}/lib64|' \
763 # GCC-TESTSUITE-DELETE-END
765 cp `find . -name "*.sum"` ../testresults/
766 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
767 chmod 644 ../testresults/*
769 # GCC-TESTSUITE-DELETE-BEGIN
770 # Remove files that we do not need to clean up filelist
771 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
772 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
773 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
774 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/root
775 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/curses.h
776 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-*
777 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux
778 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sound
779 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/features.h
780 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/ncurses.h
781 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/stdio.h
782 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
783 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/X11
784 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
785 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/obstack.h
786 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/spe.h
787 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/tgmath.h
788 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
789 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sys
791 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
792 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
793 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
795 %if !0%{?building_libjava:1}%{?building_libffi:1}
796 # delete compile flag tracking from crt files
797 crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
799 %if %{build_primary_64bit}
800 crt32_list=$RPM_BUILD_ROOT%{versmainlibdirbi32}/crt*.o
802 crt64_list=$RPM_BUILD_ROOT%{versmainlibdirbi64}/crt*.o
807 %if 0%{?building_libjava:1}
808 # gcj -static doesn't work properly anyway, unless using --whole-archive
809 # let's save the space instead.
810 find $RPM_BUILD_ROOT -name libgcj.a \
811 -o -name libgcj-tools.a \
814 -o -name libgcj_bc.a \
817 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
818 sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
820 # security files have broken install locations, also they cause conflicts
821 # between libgcj versions. Simply delete them here, libgcj will use its
822 # defaults in this case (which is what these files contain anyway).
823 rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
824 rm -r $RPM_BUILD_ROOT%{_libdir}/security
827 %if 0%{?building_libffi:1}
828 # Move libffi headers, remove empty libffi libtool file
829 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
830 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
831 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
832 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
834 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
836 # Generate a simple pkg-config file
837 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
838 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
842 %if !%{build_libjava}
843 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
844 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
845 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
846 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
847 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
848 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
849 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
851 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
852 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
854 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
855 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
856 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
857 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
859 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/nof/libiberty.a
862 %if %{build_primary_64bit}
863 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
865 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
868 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
869 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
873 %if 0%{?building_libffi:1}
875 %defattr(-,root,root)
878 %if %{separate_biarch}
879 %files -n libffi48%{separate_biarch_suffix}
880 %defattr(-,root,root)
881 %biarchlib libffi.so.*
884 %files -n libffi48-devel
885 %defattr(-,root,root)
886 %{_prefix}/include/ffi.h
887 %{_prefix}/include/ffitarget.h
890 %{_libdir}/pkgconfig/libffi.pc
891 %doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
892 %doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
893 %doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
895 %if %{separate_biarch}
896 %files -n libffi48-devel%{separate_biarch_suffix}
897 %defattr(-,root,root)
903 # GCC-TESTSUITE-DELETE-END
906 %files -n gcc48-testresults
907 %defattr(-,root,root)
908 %doc testresults/test_summary.txt
909 %doc testresults/*.sum
910 %doc testresults/*.log