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 ia64
15 # We don't want to build java
18 %define build_libjava 0
21 %define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
25 %define build_fortran 1
27 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
28 %define build_with_mudflap 0
39 # For optional compilers only build C, C++ and Fortran
40 ##%if 0%{?build_optional_compiler:1}%{?build_optional_compiler_languages:1}
41 %if 0%{!?building_libffi:1}
44 %define build_libjava 0
53 BuildRequires: gettext-tools
54 BuildRequires: makeinfo
55 BuildRequires: glibc-devel-32bit
56 BuildRequires: mpc-devel
57 BuildRequires: mpfr-devel
59 BuildRequires: texinfo
60 BuildRequires: zlib-devel
61 %ifarch %ix86 x86_64 %arm
62 BuildRequires: cloog-devel
63 BuildRequires: ppl-devel
66 %define hostsuffix -4.7
67 BuildRequires: gcc47-ada
69 %if 0%{?building_libjava:1}%{?building_testsuite:1}
70 BuildRequires: fastjar
73 %if 0%{?building_libffi:1}
74 BuildRequires: pkg-config
77 BuildRequires: libunwind-devel
80 BuildRequires: dejagnu
85 # Define version number of libgcc_s
92 # We support building the nof libraries, but don't want this in the
99 %define separate_bi32 0
100 %define separate_bi64 0
102 %define separate_bi32 1
105 # Define two macros to trigger -32bit or -64bit package variants
106 %define separate_biarch 0
108 %define separate_biarch 1
109 %define separate_biarch_suffix -32bit
112 %define separate_biarch 1
113 %define separate_biarch_suffix -64bit
117 # 64-bit is primary build target
118 %define build_primary_64bit 1
120 %define build_primary_64bit 0
123 %define biarch_libjava 0
126 %define biarch_targets x86_64
128 URL: http://gcc.gnu.org/
131 %define gcc_version %(echo %version | sed 's/_.*//')
132 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
133 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
134 %define binsuffix -4.7
137 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
138 Requires: binutils glibc-devel
139 Requires: cpp47 = %{version}-%{release}
140 %if 0%{!?build_optional_compiler:1}
141 Requires: libgcc%{libgcc_s} >= %{version}-%{release}
142 Requires: libgomp1 >= %{version}-%{release}
143 %if %{build_with_mudflap}
144 Requires: libmudflap0 >= %{version}-%{release}
145 Requires: libmudflapth0 >= %{version}-%{release}
148 Requires: libgcc47 = %{version}-%{release}
149 Requires: libgomp47 = %{version}-%{release}
154 BuildRoot: %{_tmppath}/%{name}-%{version}-build
155 #Source: gcc-%{gcc_version}%{snapshot_date}.tar.bz2
156 Source: gcc-%{version}.tar.bz2
159 Source2: libgcj47-rpmlintrc
160 Source3: gcc47-rpmlintrc
162 Source6: baselibs.conf
163 # Patches auto-generated by git-buildpackage:
164 Patch0: 0001-dir-version.patch
165 Patch1: 0002-textdomain.patch
166 Patch2: 0003-rename-info-files.patch
167 Patch3: 0004-ARM-linker.patch
169 # GCC-TESTSUITE-DELETE-BEGIN
172 Summary: Foreign Function Interface library
173 License: BSD-3-Clause
174 Group: Development/Languages/C and C++
175 Provides: g-wrap:/usr/lib/libffi.so.4
176 Provides: libffi4 = %{version}-%{release}
177 Conflicts: libffi4 < %{version}-%{release}
180 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.
190 %package -n libffi47-32bit
191 Summary: Foreign Function Interface library
192 License: BSD-3-Clause
193 Group: Development/Languages/C and C++
194 Provides: g-wrap:/usr/lib/libffi.so.4
195 Provides: libffi4-32bit = %{version}-%{release}
196 Conflicts: libffi4-32bit < %{version}-%{release}
198 %description -n libffi47-32bit
199 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.
201 %post -n libffi47-32bit
204 %postun -n libffi47-32bit
209 %package -n libffi47-64bit
210 Summary: Foreign Function Interface library
211 License: BSD-3-Clause
212 Group: Development/Languages/C and C++
213 Provides: g-wrap:/usr/lib/libffi.so.4
214 Provides: libffi4-64bit = %{version}-%{release}
215 Conflicts: libffi4-64bit < %{version}-%{release}
217 %description -n libffi47-64bit
218 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.
220 %post -n libffi47-64bit
223 %postun -n libffi47-64bit
229 %package -n libffi47-devel
230 Summary: Foreign Function Interface library development files
231 License: BSD 3-Clause
232 Group: Development/Languages/C and C++
233 Requires: libffi4 >= %{version}-%{release}
234 Provides: libffi-devel = %{version}-%{release}
235 Conflicts: libffi-devel < %{version}-%{release}
237 %description -n libffi47-devel
238 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.
242 %package -n libffi47-devel-32bit
243 Summary: Foreign Function Interface library development files
244 License: BSD 3-Clause
245 Group: Development/Languages/C and C++
246 Requires: libffi4-32bit >= %{version}-%{release}
247 Provides: libffi-devel-32bit = %{version}-%{release}
248 Conflicts: libffi-devel-32bit < %{version}-%{release}
250 %description -n libffi47-devel-32bit
251 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.
255 %package -n libffi47-devel-64bit
256 Summary: Foreign Function Interface library development files
257 License: BSD 3-Clause
258 Group: Development/Languages/C and C++
259 Requires: libffi4-64bit >= %{version}-%{release}
260 Provides: libffi-devel-64bit = %{version}-%{release}
261 Conflicts: libffi-devel-64bit < %{version}-%{release}
263 %description -n libffi47-devel-64bit
264 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.
267 %package -n gcc47-testresults
268 # GCC-TESTSUITE-DELETE-END
269 Summary: Testsuite results
270 License: SUSE-Public-Domain
271 Group: Development/Languages/C and C++
273 %description -n gcc47-testresults
274 Results from running the gcc and target library testsuites.
279 # Define the canonical target and host architecture
280 # %gcc_target_arch is supposed to be the full target triple
281 # %TARGET_ARCH is the canonicalized CPU part
282 # %CONFIGURE_TARGET is the target triple used for --target=
283 %if 0%{?gcc_target_arch:1}
284 %define CONFIGURE_TARGET %{gcc_target_arch}
285 %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/;")
286 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
287 %define CONFIGURE_TARGET i586-tizen-linux
289 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
290 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
292 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
293 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
295 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7el"
296 %define CONFIGURE_TARGET armv7el-tizen-linux-gnueabi
298 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5el"
299 %define CONFIGURE_TARGET armv5el-tizen-linux-gnueabi
302 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
304 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
306 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
309 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
311 %define GCCDIST %{HOST_ARCH}-tizen-linux
314 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
315 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
319 # Versionspecific directories
320 %define versmainlibdir %{libsubdir}
321 %define versmainlibdirbi32 %{libsubdir}/32
322 %define versmainlibdirbi64 %{libsubdir}/64
323 %if %{build_primary_64bit}
324 %define versmainlibdirbi %{versmainlibdirbi32}
326 %define versmainlibdirbi %{versmainlibdirbi64}
329 %if 0%{?build_optional_compiler:1}
330 %define mainlibdir %{versmainlibdir}
331 %define mainlibdirbi32 %{versmainlibdirbi32}
332 %define mainlibdirbi64 %{versmainlibdirbi64}
333 %define noflibdir %{versnoflibdir}
334 %define mainlibdirbi %{versmainlibdirbi}
336 %define mainlibdir %{_libdir}
337 %define mainlibdirbi32 %{_prefix}/lib
338 %define mainlibdirbi64 %{_prefix}/lib64
339 %define noflibdir %{_prefix}/lib/nof
340 %if %{build_primary_64bit}
341 %define mainlibdirbi %{mainlibdirbi32}
343 %define mainlibdirbi %{mainlibdirbi64}
348 # Now define a few macros that make it easy to package libs and
349 # related files just to the right package, without caring for the
350 # exact path the files are in.
351 # %mainlib package X from all dirs that belong to the main package
352 # %biarchlib package X from all dirs that belong to the -32/64bit package
353 # by default, nof libs go where the 32bit libs go.
355 %define mainlib() %{mainlibdir}/%1\
359 %define mainlib() %{mainlibdir}/%1\
362 %define biarchlib() %{nil}
364 %if !%{separate_biarch}
366 %define mainlib() %{mainlibdir}/%1\
371 %define mainlib() %{mainlibdir}/%1\
377 %define biarchlib() %{mainlibdirbi}/%1\
380 %define mainlib() %{mainlibdir}/%1\
383 %define biarchlib() %{mainlibdirbi}/%1\
390 %define versmainlib() %{versmainlibdir}/%1\
394 %define versmainlib() %{versmainlibdir}/%1\
397 %define versbiarchlib() %{nil}
399 %if !%{separate_biarch}
401 %define versmainlib() %{versmainlibdir}/%1\
402 %{versmainlibdirbi}/%1\
406 %define versmainlib() %{versmainlibdir}/%1\
407 %{versmainlibdirbi}/%1\
412 %define versbiarchlib() %{versmainlibdirbi}/%1\
415 %define versmainlib() %{versmainlibdir}/%1\
418 %define versbiarchlib() %{versmainlibdirbi}/%1\
428 #%setup -q -n gcc-%{gcc_version}%{snapshot_date}
429 %setup -q -n gcc-%{version}
430 # 0001-dir-version.patch
437 # Avoid rebuilding of generated files
438 contrib/gcc_update --touch
439 # Avoid fucking up testsuite results with Java and indirect dispatch
440 export LD_AS_NEEDED=0
441 # Split version file into version used for directories (X.Y) and
442 # version to report with --version (X.Y.Z).
443 # See also gcc-dir-version.patch.
444 # Also decrement the patchlevel version by one
445 if test `cat gcc/DEV-PHASE` == "prerelease"; then
446 ( 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
448 mv gcc/BASE-VER gcc/FULL-VER
450 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
452 rm -rf obj-%{GCCDIST}
455 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
456 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'`
458 # -mcpu is superceded by -mtune but -mtune is not supported by
459 # our bootstrap compiler. -mcpu gives a warning that stops
460 # the build process, so remove it for now. Also remove all other
461 # -march and -mtune flags. They are superseeded by proper
462 # default compiler settings now.
463 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'`
465 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
466 # Kill all -march/tune/cpu because that screws building the target libs
467 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
469 # Replace 2 spaces by one finally
470 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'`
474 languages=$languages,c++
477 languages=$languages,objc
480 languages=$languages,fortran
483 languages=$languages,obj-c++
486 languages=$languages,java
489 languages=$languages,ada
493 if test -z "$J"; then
494 J=$(getconf _NPROCESSORS_CONF)
497 test 1 -gt "$J" && J=1
498 JL=$(($(getconf _NPROCESSORS_CONF)*2))
500 if test "$J" == "0"; then
503 if test "$JL" == "0"; then
506 PARALLEL="-j$J -l$JL"
508 # we don't want some miscompiles in the testsuite, or some fault in
509 # the compiler to kill the machine. Hence we limit the amount of memory
510 # by the physical RAM plus half of swap
511 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
512 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
513 #ulimit -v $(((MEM + SWAP/2)*1024))
515 # In general we want to ship release checking enabled compilers
516 # and run BETA with checking enabled.
517 #ENABLE_CHECKING="--enable-checking=yes"
518 ENABLE_CHECKING="--enable-checking=release"
520 # Work around tail/head -1 changes
521 export _POSIX2_VERSION=199209
523 # configure tries to parse include/features.h to detect
524 # if glibc supports SSP. When cross compiling we would need
525 # to install a cross glibc, which we don't, or make the whole
526 # thing point to the native glibc, which is in /, hence the
530 # Using the host gnatmake like
531 # CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
532 # GNATMAKE="gnatmake%{hostsuffix}"
533 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
535 mkdir -p host-tools/bin
536 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
537 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
538 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
539 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
540 ln -sf /usr/%{_lib} host-tools/%{_lib}
541 export PATH="`pwd`/host-tools/bin:$PATH"
543 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
545 # --enable-threads=posix \
548 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
549 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
551 --prefix=%{_prefix} \
552 --infodir=%{_infodir} \
553 --mandir=%{_mandir} \
554 --libdir=%{_libdir} \
555 --libexecdir=%{_libdir} \
556 --enable-languages=$languages \
558 --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
563 --disable-bootstrap \
566 --with-bugurl="http://bugs.tizen.org/" \
567 --with-pkgversion="Tizen Linux" \
568 %if !%{build_libjava}
571 --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
572 --with-ecj-jar=%{libsubdir}/ecj.jar \
574 %if !%{biarch_libjava}
575 --disable-libjava-multilib \
578 %if !%{build_with_mudflap}
579 --disable-libmudflap \
581 --with-slibdir=/%{_lib} \
583 --enable-__cxa_atexit \
584 --enable-libstdcxx-allocator=new \
585 --disable-libstdcxx-pch \
586 --enable-version-specific-runtime-libs \
587 --enable-linker-build-id \
588 %if 0%{?gcc_target_arch:1}
589 %if 0%{?gcc_icecream:1}
590 --with-build-sysroot=/ \
591 --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
592 --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
593 --enable-linux-futex \
595 %if 0%{?canonical_target:1}
596 --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
598 %if 0%{?build_static:1}
601 %if "%{TARGET_ARCH}" == "spu"
602 --with-sysroot=/usr/spu \
603 --with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
607 --target=%{CONFIGURE_TARGET} \
609 --program-suffix=%{binsuffix} \
610 --enable-linux-futex \
612 --with-system-libunwind \
614 --without-system-libunwind \
617 %if "%{TARGET_ARCH}" == "armv5tel"
618 --with-arch=armv5te \
621 --with-abi=aapcs-linux \
622 --disable-sjlj-exceptions \
624 %if "%{TARGET_ARCH}" == "armv7el"
625 --with-arch=armv7-a \
626 --with-tune=cortex-a9 \
630 --disable-sjlj-exceptions \
632 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
633 --with-arch=armv7-a \
634 --with-tune=cortex-a9 \
636 --with-abi=aapcs-linux \
637 --with-fpu=vfpv3-d16 \
638 --disable-sjlj-exceptions \
640 %if "%{TARGET_ARCH}" == "i586"
641 --with-arch-32=i586 \
642 --with-tune=generic \
644 %if "%{TARGET_ARCH}" == "x86_64"
645 --with-arch-32=i586 \
646 --with-tune=generic \
652 %if 0%{?building_libffi:1}
653 make stage1-bubble $PARALLEL
654 make all-target-libffi $PARALLEL
656 # Only run profiled bootstrap on archs where it works
657 #%ifarch %ix86 x86_64 ppc ppc64 ia64
658 #make profiledbootstrap-lean STAGE1_CFLAGS="-O -g" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
665 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
666 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
672 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
673 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
674 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
675 make -k check $PARALLEL || true
677 ../contrib/test_summary | tee ../testresults/test_summary.txt
682 export NO_BRP_CHECK_BYTECODE_VERSION=true
684 # GCC-TESTSUITE-DELETE-BEGIN
685 # Work around tail/head -1 changes
686 export _POSIX2_VERSION=199209
687 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
688 %if 0%{?building_libffi:1}
689 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
691 %if 0%{?building_libjava:1}
692 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
693 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
694 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
695 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
696 # install-common also installs collect2, gcov and the g++ and gfortran driver
698 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
701 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
703 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
704 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
706 make install DESTDIR=$RPM_BUILD_ROOT
708 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
709 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
710 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
711 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
712 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
713 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
718 # Remove libffi installed files if we did not want to build it
719 %if !0%{?building_libffi:1}
720 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
722 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
724 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
725 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
726 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
727 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
728 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
731 # Remove some useless .la files
732 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
733 libmudflap libmudflapth libgomp libstdc++ libsupc++ libgcj-tools libgij; do
734 rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
736 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
740 mkdir -p $RPM_BUILD_ROOT%{_libdir}
742 %if %{build_primary_64bit}
743 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
745 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
751 mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
752 ln -sf %{_libdir}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
753 ln -sf %{_libdir}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnat.so
754 chmod a+x $RPM_BUILD_ROOT%{_libdir}/libgna*-*.so
756 mv $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/lib*-*.so $RPM_BUILD_ROOT%{mainlibdirbi}/
757 ln -sf %{mainlibdirbi}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
758 ln -sf %{mainlibdirbi}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
759 chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
763 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
765 # Remove some crap from the .la files:
766 for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
768 # -e '/^dependency_libs/s|%{libsubdir}/\([^.]*\)\.la |%{_libdir}/\1\.la |g'
769 sed -e '/^dependency_libs/s| -L%{_builddir}/[^ ]*||g' \
770 -e '/^dependency_libs/s| -L/usr/%{GCCDIST}/bin||g' \
771 -e '/^dependency_libs/s|-lm \(-lm \)*|-lm |' \
772 -e '/^dependency_libs/s|-L[^ ]* ||g' \
774 %if %{build_primary_64bit}
775 -e '/^libdir/s|%{_libdir}/32|%{_prefix}/lib|' \
776 -e '/^libdir/s|lib64/\.\./||' \
778 -e '/^libdir/s|%{_libdir}/64|%{_prefix}/lib64|' \
785 # GCC-TESTSUITE-DELETE-END
787 cp `find . -name "*.sum"` ../testresults/
788 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
789 chmod 644 ../testresults/*
791 # GCC-TESTSUITE-DELETE-BEGIN
792 # Remove files that we do not need to clean up filelist
793 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
794 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
795 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
796 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/root
797 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/curses.h
798 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-*
799 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux
800 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sound
801 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/features.h
802 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/ncurses.h
803 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/stdio.h
804 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
805 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/X11
806 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
807 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/obstack.h
808 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/spe.h
809 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/tgmath.h
810 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
811 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sys
813 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
814 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
815 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
817 %if !0%{?building_libjava:1}%{?building_libffi:1}
818 # delete compile flag tracking from crt files
819 crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
821 %if %{build_primary_64bit}
822 crt32_list=$RPM_BUILD_ROOT%{versmainlibdirbi32}/crt*.o
824 crt64_list=$RPM_BUILD_ROOT%{versmainlibdirbi64}/crt*.o
827 for o in $crt_list $crt32_list $crt64_list; do
828 objcopy -R ".comment.SUSE.OPTs" $o
832 %if 0%{?building_libjava:1}
833 # gcj -static doesn't work properly anyway, unless using --whole-archive
834 # let's save the space instead.
835 find $RPM_BUILD_ROOT -name libgcj.a \
836 -o -name libgcj-tools.a \
839 -o -name libgcj_bc.a \
842 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
843 sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
845 # security files have broken install locations, also they cause conflicts
846 # between libgcj versions. Simply delete them here, libgcj will use its
847 # defaults in this case (which is what these files contain anyway).
848 rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
849 rm -r $RPM_BUILD_ROOT%{_libdir}/security
852 %if 0%{?building_libffi:1}
853 # Move libffi headers, remove empty libffi libtool file
854 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
855 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
856 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
857 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
859 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
861 # Generate a simple pkg-config file
862 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
863 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
867 %if !%{build_libjava}
868 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
869 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
870 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
871 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
872 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
873 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
874 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
876 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
877 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
879 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
880 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
881 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
882 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
884 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/nof/libiberty.a
887 %if %{build_primary_64bit}
888 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
890 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
893 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
894 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
898 %if 0%{?building_libffi:1}
900 %defattr(-,root,root)
903 %if %{separate_biarch}
904 %files -n libffi47%{separate_biarch_suffix}
905 %defattr(-,root,root)
906 %biarchlib libffi.so.*
909 %files -n libffi47-devel
910 %defattr(-,root,root)
911 %{_prefix}/include/ffi.h
912 %{_prefix}/include/ffitarget.h
915 %{_libdir}/pkgconfig/libffi.pc
916 %doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
917 %doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
918 %doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
920 %if %{separate_biarch}
921 %files -n libffi47-devel%{separate_biarch_suffix}
922 %defattr(-,root,root)
928 # GCC-TESTSUITE-DELETE-END
931 %files -n gcc47-testresults
932 %defattr(-,root,root)
933 %doc testresults/test_summary.txt
934 %doc testresults/*.sum
935 %doc testresults/*.log