add ARM linker patch
[platform/upstream/gcc48.git] / packaging / libgcj47.spec
1 %define building_libjava 1
2 %define fast_build 1
3
4 # Ada currently fails to build on a few platforms, enable it only
5 # on those that work
6 # Note that AdaCore only supports %ix86, x86_64 and ia64
7 %ifarch %ix86 x86_64
8 %define build_ada !0%{?building_libjava:1}%{?building_libffi:1}
9 %else
10 %define build_ada 0
11 %endif
12
13 %define quadmath_arch %ix86 x86_64 ia64
14
15 # We don't want to build java
16 %ifarch mips
17 %define build_java 0
18 %define build_libjava 0
19 %else
20 %define build_java 1
21 %define build_libjava 0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
22 %endif
23
24 %define build_cp 1
25 %define build_fortran 1
26 %define build_objc 1
27 %define build_objcp !0%{?building_libjava:1}%{?building_libffi:1}
28 %define build_with_mudflap 0
29
30 %if %{build_objcp}
31 %define build_cp 1
32 %define build_objc 1
33 %endif
34
35 %if %{build_libjava}
36 %define build_cp 1
37 %endif
38
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}
42 %define build_ada 0
43 %define build_java 0
44 %define build_libjava 0
45 %define build_objc 1
46 %define build_objcp 1
47 %endif
48
49
50 Name: libgcj47
51 BuildRequires: bison
52 BuildRequires: flex
53 BuildRequires: gettext-tools
54 BuildRequires: makeinfo
55 BuildRequires: glibc-devel-32bit
56 BuildRequires: mpc-devel
57 BuildRequires: mpfr-devel
58 BuildRequires: perl
59 BuildRequires: texinfo
60 BuildRequires: zlib-devel
61 %ifarch %ix86 x86_64 %arm
62 BuildRequires: cloog-devel
63 BuildRequires: ppl-devel
64 %endif
65 %if %{build_ada}
66 %define hostsuffix -4.7
67 BuildRequires: gcc47-ada
68 %endif
69 %if 0%{?building_libjava:1}%{?building_testsuite:1}
70 BuildRequires: fastjar
71 BuildRequires: unzip
72 %endif
73 %if 0%{?building_libffi:1}
74 BuildRequires: pkg-config
75 %endif
76 %ifarch ia64
77 BuildRequires: libunwind-devel
78 %endif
79 %if 0%{?run_tests:1}
80 BuildRequires: dejagnu
81 BuildRequires: expect
82 BuildRequires: gdb
83 %endif
84
85 # Define version number of libgcc_s
86 %ifarch hppa
87 %define libgcc_s 4
88 %else
89 %define libgcc_s 1
90 %endif
91 %ifarch ppc
92 # We support building the nof libraries, but don't want this in the
93 # regular rpms
94 %define build_nof 0
95 %else
96 %define build_nof 0
97 %endif
98
99 %define separate_bi32 0
100 %define separate_bi64 0
101 %ifarch x86_64 
102 %define separate_bi32 1
103 %endif
104
105 # Define two macros to trigger -32bit or -64bit package variants
106 %define separate_biarch 0
107 %if %{separate_bi32}
108 %define separate_biarch 1
109 %define separate_biarch_suffix -32bit
110 %endif
111 %if %{separate_bi64}
112 %define separate_biarch 1
113 %define separate_biarch_suffix -64bit
114 %endif
115
116 %ifarch x86_64
117 # 64-bit is primary build target
118 %define build_primary_64bit 1
119 %else
120 %define build_primary_64bit 0
121 %endif
122
123 %define biarch_libjava 0
124
125 # COMMON-BEGIN
126 %define biarch_targets x86_64 
127
128 URL:          http://gcc.gnu.org/
129 Version: 4.7.2
130 Release:      1
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
135 # COMMON-END
136
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}
146 %endif
147 %else
148 Requires: libgcc47 = %{version}-%{release}
149 Requires: libgomp47 = %{version}-%{release}
150 %endif
151 %endif
152
153 # COMMON-BEGIN
154 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
155 #Source:                gcc-%{gcc_version}%{snapshot_date}.tar.bz2
156 Source:     gcc-%{version}.tar.bz2
157
158 Source1:        change_spec
159 Source2:        libgcj47-rpmlintrc
160 Source3:        gcc47-rpmlintrc
161 Source4:        ecj.jar
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
168
169 # GCC-TESTSUITE-DELETE-BEGIN
170 # LIBFFI-DELETE-BEGIN
171 Summary:      Java Runtime Library for gcc
172 License:      GPL-2.0-with-classpath-exception
173 Group:        System/Libraries
174 %define gcj_sover 13
175 Provides: libgcj%{gcj_sover} = %{version}-%{release}
176 Conflicts: libgcj%{gcj_sover} < %{version}-%{release}
177 Provides: libgij%{gcj_sover} = %{version}-%{release}
178 Conflicts: libgij%{gcj_sover} < %{version}-%{release}
179 Provides: libgcj-tools%{gcj_sover} = %{version}-%{release}
180 Conflicts: libgcj-tools%{gcj_sover} < %{version}-%{release}
181
182 %description 
183 This library is needed if you want to use the GNU Java compiler, gcj.
184 Source code for this package is in gcc.
185
186 %post 
187 /sbin/ldconfig
188
189 %postun 
190 /sbin/ldconfig
191
192
193 %package -n gcc47-java
194 Summary:      The GNU Java Compiler
195 License:        GPL-3.0+
196 Group:        Development/Languages/Java
197 Requires: gcc47 = %{version}
198 Requires: libgcj47-devel = %{version}-%{release}
199
200 %description -n gcc47-java
201 The Java compiler from the GCC-tools-suite.
202
203
204 %package -n libgcj_bc47
205 Summary:      Fake library for BC-ABI compatibility.
206 License:        GPL-2.0-with-classpath-exception
207 Group:        Development/Libraries/Java
208 Provides: libgcj_bc1 = %{version}-%{release}
209 Conflicts: libgcj_bc1 < %{version}-%{release}
210 # libgcj_bc is special in that it just contains a symlink to
211 # a proper libgcj version.  So require that library and add
212 # provides for the shlib version as created at link time
213 Requires: libgcj%{gcj_sover}
214 %ifarch x86_64 
215 Provides: libgcj_bc.so.1()(64bit)
216 %else
217 Provides: libgcj_bc.so.1
218 %endif
219
220
221 %description -n libgcj_bc47
222 A fake library that is used at link time only. It ensures that
223 binaries built with the BC-ABI link against a constant SONAME.
224 This way, BC-ABI binaries continue to work if the SONAME underlying
225 libgcj.so changes.
226
227
228 %package -n libgcj47-jar
229 Summary:      Java runtime library (jar files).
230 License:        GPL-2.0-with-classpath-exception
231 Group:        Development/Libraries/Java
232
233 %description -n libgcj47-jar
234 These are the jar files that go along with the gcj front end to gcc.
235
236
237 %package -n libgcj47-devel
238 Summary:      Include Files and Libraries mandatory for Development.
239 License:        GPL-2.0-with-classpath-exception
240 Group:        Development/Libraries/Java
241 Requires: libstdc++47-devel = %{version}
242 Requires: libgcj%{gcj_sover} >= %{version}-%{release}
243 Requires: libgcj_bc1 >= %{version}-%{release}
244 Requires: libgcj47-jar = %{version}-%{release}
245 Requires: gtk2-devel
246 Requires: libart_lgpl-devel
247 Requires: glibc-devel
248 Requires: zlib-devel
249 %ifarch ia64
250 Requires: libunwind-devel
251 %endif
252
253 %description -n libgcj47-devel
254 This package contains all necessary include files and libraries needed
255 to develop applications that require these.
256
257
258 %package -n gcc47-gij
259 Summary:      Java Bytecode Interpreter for gcc
260 License:      GPL-2.0-with-classpath-exception
261 Group:        Development/Libraries/Java
262 Requires: libgcj%{gcj_sover} >= %{version}-%{release}
263
264 %description -n gcc47-gij
265 This package contains the java bytecode interpreter gij and related tools.
266
267 # LIBFFI-DELETE-END
268 # PACKAGE-BEGIN
269 # PACKAGE-BEGIN
270 %package -n libffi47
271 Summary:      Foreign Function Interface library
272 License:        BSD-3-Clause
273 Group:        Development/Languages/C and C++
274 Provides: g-wrap:/usr/lib/libffi.so.4
275 Provides: libffi4 = %{version}-%{release}
276 Conflicts: libffi4 < %{version}-%{release}
277
278 %description -n libffi47
279 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.
280
281 %post -n libffi47
282 /sbin/ldconfig
283
284 %postun -n libffi47
285 /sbin/ldconfig
286 # PACKAGE-END
287 # PACKAGE-BEGIN
288 # PACKAGE-BEGIN
289 %package -n libffi47-32bit
290 Summary:      Foreign Function Interface library
291 License:        BSD-3-Clause
292 Group:        Development/Languages/C and C++
293 Provides: g-wrap:/usr/lib/libffi.so.4
294 Provides: libffi4-32bit = %{version}-%{release}
295 Conflicts: libffi4-32bit < %{version}-%{release}
296
297 %description -n libffi47-32bit
298 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.
299
300 %post -n libffi47-32bit
301 /sbin/ldconfig
302
303 %postun -n libffi47-32bit
304 /sbin/ldconfig
305 # PACKAGE-END
306 # PACKAGE-BEGIN
307 # PACKAGE-BEGIN
308 %package -n libffi47-64bit
309 Summary:      Foreign Function Interface library
310 License:        BSD-3-Clause
311 Group:        Development/Languages/C and C++
312 Provides: g-wrap:/usr/lib/libffi.so.4
313 Provides: libffi4-64bit = %{version}-%{release}
314 Conflicts: libffi4-64bit < %{version}-%{release}
315
316 %description -n libffi47-64bit
317 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.
318
319 %post -n libffi47-64bit
320 /sbin/ldconfig
321
322 %postun -n libffi47-64bit
323 /sbin/ldconfig
324 # PACKAGE-END
325
326 # PACKAGE-BEGIN
327 # PACKAGE-BEGIN
328 %package -n libffi47-devel
329 Summary:      Foreign Function Interface library development files
330 License:        BSD 3-Clause
331 Group:        Development/Languages/C and C++
332 Requires: libffi4 >= %{version}-%{release}
333 Provides: libffi-devel = %{version}-%{release}
334 Conflicts: libffi-devel < %{version}-%{release}
335
336 %description -n libffi47-devel
337 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.
338 # PACKAGE-END
339 # PACKAGE-BEGIN
340 # PACKAGE-BEGIN
341 %package -n libffi47-devel-32bit
342 Summary:      Foreign Function Interface library development files
343 License:        BSD 3-Clause
344 Group:        Development/Languages/C and C++
345 Requires: libffi4-32bit >= %{version}-%{release}
346 Provides: libffi-devel-32bit = %{version}-%{release}
347 Conflicts: libffi-devel-32bit < %{version}-%{release}
348
349 %description -n libffi47-devel-32bit
350 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.
351 # PACKAGE-END
352 # PACKAGE-BEGIN
353 # PACKAGE-BEGIN
354 %package -n libffi47-devel-64bit
355 Summary:      Foreign Function Interface library development files
356 License:        BSD 3-Clause
357 Group:        Development/Languages/C and C++
358 Requires: libffi4-64bit >= %{version}-%{release}
359 Provides: libffi-devel-64bit = %{version}-%{release}
360 Conflicts: libffi-devel-64bit < %{version}-%{release}
361
362 %description -n libffi47-devel-64bit
363 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.
364 # PACKAGE-END
365
366 %package -n gcc47-testresults
367 # GCC-TESTSUITE-DELETE-END
368 Summary:      Testsuite results
369 License:        SUSE-Public-Domain
370 Group:        Development/Languages/C and C++
371
372 %description -n gcc47-testresults
373 Results from running the gcc and target library testsuites.
374
375
376 # COMMON-BEGIN
377
378 # Define the canonical target and host architecture
379 #   %gcc_target_arch  is supposed to be the full target triple
380 #   %TARGET_ARCH      is the canonicalized CPU part
381 #   %CONFIGURE_TARGET is the target triple used for --target=
382 %if 0%{?gcc_target_arch:1}
383 %define CONFIGURE_TARGET %{gcc_target_arch}
384 %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/;")
385 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
386 %define CONFIGURE_TARGET i586-tizen-linux
387 %endif
388 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
389 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
390 %endif
391 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
392 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
393 %endif
394 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7el"
395 %define CONFIGURE_TARGET armv7el-tizen-linux-gnueabi
396 %endif
397 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5el"
398 %define CONFIGURE_TARGET armv5el-tizen-linux-gnueabi
399 %endif
400 %else
401 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
402 %endif
403 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
404
405 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
406
407 %ifarch %arm
408 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
409 %else
410 %define GCCDIST %{HOST_ARCH}-tizen-linux
411 %endif
412
413 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
414 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
415
416 # COMMON-END
417
418 # Versionspecific directories
419 %define versmainlibdir %{libsubdir}
420 %define versmainlibdirbi32 %{libsubdir}/32
421 %define versmainlibdirbi64 %{libsubdir}/64
422 %if %{build_primary_64bit}
423 %define versmainlibdirbi %{versmainlibdirbi32}
424 %else
425 %define versmainlibdirbi %{versmainlibdirbi64}
426 %endif
427
428 %if 0%{?build_optional_compiler:1}
429 %define mainlibdir %{versmainlibdir}
430 %define mainlibdirbi32 %{versmainlibdirbi32}
431 %define mainlibdirbi64 %{versmainlibdirbi64}
432 %define noflibdir %{versnoflibdir}
433 %define mainlibdirbi %{versmainlibdirbi}
434 %else
435 %define mainlibdir %{_libdir}
436 %define mainlibdirbi32 %{_prefix}/lib
437 %define mainlibdirbi64 %{_prefix}/lib64
438 %define noflibdir %{_prefix}/lib/nof
439 %if %{build_primary_64bit}
440 %define mainlibdirbi %{mainlibdirbi32}
441 %else
442 %define mainlibdirbi %{mainlibdirbi64}
443 %endif
444 %endif
445
446
447 # Now define a few macros that make it easy to package libs and
448 # related files just to the right package, without caring for the
449 # exact path the files are in.
450 #   %mainlib  package X from all dirs that belong to the main package
451 #   %biarchlib   package X from all dirs that belong to the -32/64bit package
452 # by default, nof libs go where the 32bit libs go.
453 %if %{build_nof}
454 %define mainlib() %{mainlibdir}/%1\
455 %{noflibdir}/%1\
456 %{nil}
457 %else
458 %define mainlib() %{mainlibdir}/%1\
459 %{nil}
460 %endif
461 %define biarchlib() %{nil}
462 %if %{biarch}
463 %if !%{separate_biarch}
464 %if %{build_nof}
465 %define mainlib() %{mainlibdir}/%1\
466 %{mainlibdirbi}/%1\
467 %{noflibdir}/%1\
468 %{nil}
469 %else
470 %define mainlib() %{mainlibdir}/%1\
471 %{mainlibdirbi}/%1\
472 %{nil}
473 %endif
474 %else
475 %if %{build_nof}
476 %define biarchlib() %{mainlibdirbi}/%1\
477 %{noflibdir}/%1\
478 %{nil}
479 %define mainlib() %{mainlibdir}/%1\
480 %{nil}
481 %else
482 %define biarchlib() %{mainlibdirbi}/%1\
483 %{nil}
484 %endif
485 %endif
486 %endif
487
488 %if %{build_nof}
489 %define versmainlib() %{versmainlibdir}/%1\
490 %{versnoflibdir}/%1\
491 %{nil}
492 %else
493 %define versmainlib() %{versmainlibdir}/%1\
494 %{nil}
495 %endif
496 %define versbiarchlib() %{nil}
497 %if %{biarch}
498 %if !%{separate_biarch}
499 %if %{build_nof}
500 %define versmainlib() %{versmainlibdir}/%1\
501 %{versmainlibdirbi}/%1\
502 %{versnoflibdir}/%1\
503 %{nil}
504 %else
505 %define versmainlib() %{versmainlibdir}/%1\
506 %{versmainlibdirbi}/%1\
507 %{nil}
508 %endif
509 %else
510 %if %{build_nof}
511 %define versbiarchlib() %{versmainlibdirbi}/%1\
512 %{versnoflibdir}/%1\
513 %{nil}
514 %define versmainlib() %{versmainlibdir}/%1\
515 %{nil}
516 %else
517 %define versbiarchlib() %{versmainlibdirbi}/%1\
518 %{nil}
519 %endif
520 %endif
521 %endif
522
523
524 # COMMON-BEGIN
525
526 %prep
527 #%setup -q -n gcc-%{gcc_version}%{snapshot_date}
528 %setup -q -n gcc-%{version}
529 # 0001-dir-version.patch
530 %patch0 -p1
531 %patch1 -p1
532 %patch2 -p1
533 %patch3 -p1
534
535 %build
536 # Avoid rebuilding of generated files
537 contrib/gcc_update --touch
538 # Avoid fucking up testsuite results with Java and indirect dispatch
539 export LD_AS_NEEDED=0
540 # Split version file into version used for directories (X.Y) and
541 # version to report with --version (X.Y.Z).
542 # See also gcc-dir-version.patch.
543 # Also decrement the patchlevel version by one
544 if test `cat gcc/DEV-PHASE` == "prerelease"; then
545   ( 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
546 else
547   mv gcc/BASE-VER gcc/FULL-VER
548 fi
549 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
550
551 rm -rf obj-%{GCCDIST}
552 mkdir obj-%{GCCDIST}
553 cd obj-%{GCCDIST}
554 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE"
555 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'`
556 %ifarch %ix86
557 # -mcpu is superceded by -mtune but -mtune is not supported by
558 # our bootstrap compiler.  -mcpu gives a warning that stops
559 # the build process, so remove it for now.  Also remove all other
560 # -march and -mtune flags.  They are superseeded by proper
561 # default compiler settings now.
562 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'`
563 %endif
564 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
565 # Kill all -march/tune/cpu because that screws building the target libs
566 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
567 %endif
568 # Replace 2 spaces by one finally
569 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  / /g'`
570
571 languages=c
572 %if %{build_cp}
573 languages=$languages,c++
574 %endif
575 %if %{build_objc}
576 languages=$languages,objc
577 %endif
578 %if %{build_fortran}
579 languages=$languages,fortran
580 %endif
581 %if %{build_objcp}
582 languages=$languages,obj-c++
583 %endif
584 %if %{build_java}
585 languages=$languages,java
586 %endif
587 %if %{build_ada}
588 languages=$languages,ada
589 %endif
590
591 J=%{?jobs:%jobs}
592 if test -z "$J"; then
593   J=$(getconf _NPROCESSORS_CONF)
594   JL=$(($J * 2))
595 else
596   test 1 -gt "$J" && J=1
597   JL=$(($(getconf _NPROCESSORS_CONF)*2))
598 fi
599 if test "$J" == "0"; then
600   J=1
601 fi
602 if test "$JL" == "0"; then
603   JL=1
604 fi
605 PARALLEL="-j$J -l$JL"
606
607 # we don't want some miscompiles in the testsuite, or some fault in
608 # the compiler to kill the machine.  Hence we limit the amount of memory
609 # by the physical RAM plus half of swap
610 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
611 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
612 #ulimit -v $(((MEM + SWAP/2)*1024))
613
614 # In general we want to ship release checking enabled compilers
615 # and run BETA with checking enabled.
616 #ENABLE_CHECKING="--enable-checking=yes"
617 ENABLE_CHECKING="--enable-checking=release"
618
619 # Work around tail/head -1 changes
620 export _POSIX2_VERSION=199209
621
622 # configure tries to parse include/features.h to detect
623 # if glibc supports SSP.  When cross compiling we would need
624 # to install a cross glibc, which we don't, or make the whole
625 # thing point to the native glibc, which is in /, hence the
626 # --with-sysroot=/
627
628 %if %{build_ada}
629 # Using the host gnatmake like
630 #   CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
631 #   GNATMAKE="gnatmake%{hostsuffix}"
632 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
633 # available
634 mkdir -p host-tools/bin
635 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
636 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
637 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
638 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
639 ln -sf /usr/%{_lib} host-tools/%{_lib}
640 export PATH="`pwd`/host-tools/bin:$PATH"
641 %endif
642 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
643 #%else
644 #       --enable-threads=posix \
645 #%endif
646 #       --enable-shared \
647 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
648 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
649 ../configure \
650         --prefix=%{_prefix} \
651         --infodir=%{_infodir} \
652         --mandir=%{_mandir} \
653         --libdir=%{_libdir} \
654         --libexecdir=%{_libdir} \
655         --enable-languages=$languages \
656         $ENABLE_CHECKING \
657         --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
658         --enable-ssp \
659         --disable-libssp \
660         --disable-libitm \
661 %if 0%{?fast_build}
662         --disable-bootstrap \
663 %endif
664         --disable-plugin \
665         --with-bugurl="http://bugs.tizen.org/" \
666         --with-pkgversion="Tizen Linux" \
667 %if !%{build_libjava}
668         --disable-libgcj \
669 %else
670         --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
671         --with-ecj-jar=%{libsubdir}/ecj.jar \
672         --disable-java-awt \
673 %if !%{biarch_libjava}
674         --disable-libjava-multilib \
675 %endif
676 %endif
677 %if !%{build_with_mudflap}
678         --disable-libmudflap \
679 %endif
680         --with-slibdir=/%{_lib} \
681         --with-system-zlib \
682         --enable-__cxa_atexit \
683         --enable-libstdcxx-allocator=new \
684         --disable-libstdcxx-pch \
685         --enable-version-specific-runtime-libs \
686         --enable-linker-build-id \
687 %if 0%{?gcc_target_arch:1}
688 %if 0%{?gcc_icecream:1}
689         --with-build-sysroot=/ \
690         --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
691         --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
692         --enable-linux-futex \
693 %endif
694 %if 0%{?canonical_target:1}
695         --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
696 %endif
697 %if 0%{?build_static:1}
698         --disable-shared \
699 %endif
700 %if "%{TARGET_ARCH}" == "spu"
701         --with-sysroot=/usr/spu \
702         --with-gxx-include-dir=%{_prefix}/spu/include/c++/%{gcc_dir_version} \
703         --with-newlib \
704 %endif
705         --disable-nls \
706         --target=%{CONFIGURE_TARGET} \
707 %else
708         --program-suffix=%{binsuffix} \
709         --enable-linux-futex \
710 %ifarch ia64
711         --with-system-libunwind \
712 %else
713         --without-system-libunwind \
714 %endif
715 %endif
716 %if "%{TARGET_ARCH}" == "armv5tel"
717         --with-arch=armv5te \
718         --with-float=soft \
719         --with-mode=arm \
720         --with-abi=aapcs-linux \
721         --disable-sjlj-exceptions \
722 %endif
723 %if "%{TARGET_ARCH}" == "armv7el" 
724         --with-arch=armv7-a \
725         --with-tune=cortex-a9 \
726         --with-float=soft \
727         --with-abi=softfp \
728         --with-fpu=vfpv3 \
729         --disable-sjlj-exceptions \
730 %endif
731 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
732         --with-arch=armv7-a \
733         --with-tune=cortex-a9 \
734         --with-float=hard \
735         --with-abi=aapcs-linux \
736         --with-fpu=vfpv3-d16 \
737         --disable-sjlj-exceptions \
738 %endif
739 %if "%{TARGET_ARCH}" == "i586"
740         --with-arch-32=i586 \
741         --with-tune=generic \
742 %endif
743 %if "%{TARGET_ARCH}" == "x86_64"
744         --with-arch-32=i586 \
745         --with-tune=generic \
746 %endif
747         --build=%{GCCDIST}
748
749 # COMMON-END
750
751 %if 0%{?building_libffi:1}
752 make stage1-bubble $PARALLEL
753 make all-target-libffi $PARALLEL
754 %else
755 # Only run profiled bootstrap on archs where it works
756 #%ifarch %ix86 x86_64 ppc ppc64 ia64
757 #make profiledbootstrap-lean STAGE1_CFLAGS="-O -g" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
758 #%else
759 %ifarch %arm
760 STAGE1_FLAGS="-O0"
761 %else
762 STAGE1_FLAGS="-O -g"
763 %endif
764 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
765 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
766 #%endif
767 #make -C gcc proto
768 make info
769 %if 0%{?run_tests:1}
770 echo "Run testsuite"
771 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
772 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
773 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
774 make -k check $PARALLEL || true
775 mkdir ../testresults
776 ../contrib/test_summary | tee ../testresults/test_summary.txt
777 %endif
778 %endif
779
780 %install
781 export NO_BRP_CHECK_BYTECODE_VERSION=true
782 cd obj-%{GCCDIST}
783 # GCC-TESTSUITE-DELETE-BEGIN
784 # Work around tail/head -1 changes
785 export _POSIX2_VERSION=199209
786 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
787 %if 0%{?building_libffi:1}
788 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
789 %else
790 %if 0%{?building_libjava:1}
791 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
792 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
793 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
794 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
795 # install-common also installs collect2, gcov and the g++ and gfortran driver
796 %if %{build_cp}
797 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
798 %endif
799 %if %{build_fortran}
800 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
801 %endif
802 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
803 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
804 %else
805 make install DESTDIR=$RPM_BUILD_ROOT
806 %if %{build_java}
807 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
808 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
809 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
810 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
811 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
812 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
813 %endif
814 %endif
815 %endif
816
817 # Remove libffi installed files if we did not want to build it
818 %if !0%{?building_libffi:1}
819 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
820 %if %{biarch}
821   rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
822 %endif
823 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
824 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
825 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
826 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
827 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
828 %endif
829
830 # Remove some useless .la files
831 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
832     libmudflap libmudflapth libgomp libstdc++ libsupc++ libgcj-tools libgij; do
833   rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
834 %if %{biarch}
835   rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
836 %endif
837 done
838
839 mkdir -p $RPM_BUILD_ROOT%{_libdir}
840 %if %{biarch}
841 %if %{build_primary_64bit}
842 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
843 %else
844 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
845 %endif
846 %endif
847
848 # LIBFFI-DELETE-BEGIN
849
850 %if 0%{!?build_optional_compiler:1}
851 # move shared libs from versionspecific dir to main libdir
852 for libname in \
853 %if 0%{?building_libjava:1}
854   libgcj libgij libgcj-tools \
855 %else
856 %if %{build_fortran}
857   libgfortran \
858 %ifarch %quadmath_arch
859   libquadmath \
860 %endif
861 %endif
862 %if %{build_objc}
863   libobjc \
864 %endif
865 %if %{build_cp}
866   libstdc++ \
867 %endif
868   libgomp \
869 %if %{build_with_mudflap}
870   libmudflap libmudflapth \
871 %endif
872 %endif
873     ; do
874   for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name $libname.so.*`; do
875     mv $lib $RPM_BUILD_ROOT%{mainlibdir}/
876   done
877   ln -sf %{mainlibdir}/`readlink $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
878          $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so
879 %if %{biarch}
880   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
881     for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name "$libname.so.*"`; do
882       mv $lib $RPM_BUILD_ROOT%{mainlibdirbi}/
883     done
884     ln -sf %{mainlibdirbi}/`readlink $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
885          $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so
886   fi
887 %endif
888 done
889 %if %{build_cp}
890 %if !0%{?building_libjava:1}
891 # And we want to move the shlib gdb pretty printers to a more sane
892 # place so ldconfig does not complain
893 mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}
894 mv $RPM_BUILD_ROOT%{mainlibdir}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/
895 sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/libstdc++.so.*-gdb.py
896 %if %{biarch}
897   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
898     mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}
899     mv $RPM_BUILD_ROOT%{mainlibdirbi}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/
900     sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/libstdc++.so.*-gdb.py
901   fi
902 %endif
903 %endif
904 %endif
905 %if 0%{?building_libjava:1}
906 # libgcj_bc is special as the .so file is actually a different
907 # library as the library refered to by the SONAME which should
908 # be a simple link to our libgcj.
909 for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name libgcj_bc.so.*`; do
910   rm $lib
911 done
912 ln -s libgcj.so.%{gcj_sover} $RPM_BUILD_ROOT%{mainlibdir}/libgcj_bc.so.1
913 %if %{biarch_libjava}
914 for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name libgcj_bc.so.*`; do
915   rm $lib
916 done
917 ln -s libgcj.so.%{gcj_sover} $RPM_BUILD_ROOT%{mainlibdirbi}/libgcj_bc.so.1
918 %endif
919 %endif
920 %endif
921
922 # LIBFFI-DELETE-END
923
924 %if %{build_ada}
925 mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
926 ln -sf %{_libdir}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
927 ln -sf %{_libdir}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnat.so
928 chmod a+x $RPM_BUILD_ROOT%{_libdir}/libgna*-*.so
929 %if %{biarch}
930 mv $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/lib*-*.so $RPM_BUILD_ROOT%{mainlibdirbi}/
931 ln -sf %{mainlibdirbi}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
932 ln -sf %{mainlibdirbi}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
933 chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
934 %endif
935 %endif
936
937 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
938
939 # Remove some crap from the .la files:
940 for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
941   echo "changing $l"
942 # -e '/^dependency_libs/s|%{libsubdir}/\([^.]*\)\.la |%{_libdir}/\1\.la |g'
943   sed -e '/^dependency_libs/s| -L%{_builddir}/[^ ]*||g' \
944       -e '/^dependency_libs/s| -L/usr/%{GCCDIST}/bin||g' \
945       -e '/^dependency_libs/s|-lm \(-lm \)*|-lm |' \
946       -e '/^dependency_libs/s|-L[^ ]* ||g' \
947 %if %{biarch}
948 %if %{build_primary_64bit}
949       -e '/^libdir/s|%{_libdir}/32|%{_prefix}/lib|' \
950       -e '/^libdir/s|lib64/\.\./||' \
951 %else
952       -e '/^libdir/s|%{_libdir}/64|%{_prefix}/lib64|' \
953 %endif
954 %endif
955       < $l  > $l.new
956   mv $l.new $l
957 done
958
959 # GCC-TESTSUITE-DELETE-END
960 %if 0%{?run_tests:1} 
961 cp `find . -name "*.sum"` ../testresults/
962 cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
963 chmod 644 ../testresults/*
964 %endif
965 # GCC-TESTSUITE-DELETE-BEGIN
966 # LIBFFI-DELETE-BEGIN
967 %if %{build_cp}
968 # Find C++ and Java headers
969 find $RPM_BUILD_ROOT%{_prefix}/include/c++ \
970   -regex ".*/\(org\|gcj\|gnu\|java\|javax\)" -prune \
971   -o \( -type d -printf "%%%%dir " , \
972         -printf "%{_prefix}/include/c++/%%P\n" \) > ../c++-headers
973 %endif
974 # LIBFFI-DELETE-END
975 # Remove files that we do not need to clean up filelist
976 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
977 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
978 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
979 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/root
980 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/curses.h
981 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-*
982 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux
983 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sound
984 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/features.h
985 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/ncurses.h
986 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/stdio.h
987 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
988 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/X11
989 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
990 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/obstack.h
991 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/spe.h
992 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/tgmath.h
993 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
994 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sys
995 # no plugins
996 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
997 rm -f  $RPM_BUILD_ROOT%{_infodir}/dir
998 rm -f  $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
999
1000 %if !0%{?building_libjava:1}%{?building_libffi:1}
1001 # delete compile flag tracking from crt files
1002 crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
1003 %if %{biarch}
1004 %if %{build_primary_64bit}
1005 crt32_list=$RPM_BUILD_ROOT%{versmainlibdirbi32}/crt*.o
1006 %else
1007 crt64_list=$RPM_BUILD_ROOT%{versmainlibdirbi64}/crt*.o
1008 %endif
1009 %endif
1010 for o in $crt_list $crt32_list $crt64_list; do
1011   objcopy -R ".comment.SUSE.OPTs" $o
1012 done
1013 %endif
1014
1015 %if 0%{?building_libjava:1}
1016 # gcj -static doesn't work properly anyway, unless using --whole-archive
1017 # let's save the space instead.
1018 find $RPM_BUILD_ROOT -name libgcj.a \
1019         -o -name libgcj-tools.a \
1020         -o -name libgij.a \
1021         -o -name libjvm.a \
1022         -o -name libgcj_bc.a \
1023   | xargs rm -f
1024
1025 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
1026   sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
1027
1028 # security files have broken install locations, also they cause conflicts
1029 # between libgcj versions.  Simply delete them here, libgcj will use its
1030 # defaults in this case (which is what these files contain anyway).
1031 rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
1032 rm -r $RPM_BUILD_ROOT%{_libdir}/security
1033 %endif
1034
1035 %if 0%{?building_libffi:1}
1036 # Move libffi headers, remove empty libffi libtool file
1037 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
1038 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
1039 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
1040 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
1041 %if %{biarch}
1042 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
1043 %endif
1044 # Generate a simple pkg-config file
1045 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
1046 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
1047 %endif
1048
1049 %if %{build_java}
1050 %if !%{build_libjava}
1051 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
1052 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
1053 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
1054 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
1055 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
1056 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
1057 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
1058 %endif
1059 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
1060 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
1061 %endif
1062 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
1063 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
1064 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
1065 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
1066 %if %{build_nof}
1067 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/nof/libiberty.a
1068 %endif
1069 %if %{biarch}
1070 %if %{build_primary_64bit}
1071 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
1072 %else
1073 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
1074 %endif
1075 %endif
1076 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
1077 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
1078
1079 # LIBFFI-DELETE-BEGIN
1080 %if 0%{?building_libjava:1}
1081 # For building libjava only we need to delete other info docs
1082 rm $RPM_BUILD_ROOT%{_infodir}/cp-tools.info*
1083 # Remove stale manpages for binaries we do not build
1084 rm $RPM_BUILD_ROOT%{_mandir}/man1/gjdoc%{binsuffix}.1
1085 # For building the java frontend we need to copy the ecj jar
1086 mkdir -p $RPM_BUILD_ROOT%{libsubdir}
1087 cp $RPM_SOURCE_DIR/ecj.jar $RPM_BUILD_ROOT%{libsubdir}
1088 %else
1089 # For regular build, some info files do not get renamed properly.
1090 # Do so here.
1091 mv $RPM_BUILD_ROOT%{_infodir}/libgomp.info $RPM_BUILD_ROOT%{_infodir}/libgomp%{binsuffix}.info
1092 %if %{build_fortran} 
1093 %ifarch %quadmath_arch
1094 mv $RPM_BUILD_ROOT%{_infodir}/libquadmath.info $RPM_BUILD_ROOT%{_infodir}/libquadmath%{binsuffix}.info
1095 %endif
1096 %endif
1097 %if %{build_ada}
1098 mv $RPM_BUILD_ROOT%{_infodir}/gnat-style.info $RPM_BUILD_ROOT%{_infodir}/gnat-style%{binsuffix}.info
1099 mv $RPM_BUILD_ROOT%{_infodir}/gnat_rm.info $RPM_BUILD_ROOT%{_infodir}/gnat_rm%{binsuffix}.info
1100 mv $RPM_BUILD_ROOT%{_infodir}/gnat_ugn.info $RPM_BUILD_ROOT%{_infodir}/gnat_ugn%{binsuffix}.info
1101 %endif
1102 %endif
1103
1104
1105
1106 %if %{build_java}
1107 %if 0%{?building_libjava:1}
1108 %files -n gcc47-java
1109 %defattr(-,root,root)
1110 %{_prefix}/bin/gcj%{binsuffix}
1111 %{_prefix}/bin/gcjh%{binsuffix}
1112 %{_prefix}/bin/gcj-dbtool%{binsuffix}
1113 %{_prefix}/bin/jcf-dump%{binsuffix}
1114 %{_prefix}/bin/jv-convert%{binsuffix}
1115 %{_prefix}/bin/gc-analyze%{binsuffix}
1116 %{_prefix}/bin/aot-compile%{binsuffix}
1117 %{_prefix}/bin/rebuild-gcj-db%{binsuffix}
1118 %{libsubdir}/jc1
1119 %{libsubdir}/jvgenmain
1120 %{libsubdir}/ecj.jar
1121 %{libsubdir}/ecj1
1122 %doc %{_mandir}/man1/gcj%{binsuffix}.1.gz
1123 %doc %{_mandir}/man1/gcjh%{binsuffix}.1.gz
1124 %doc %{_mandir}/man1/gcj-dbtool%{binsuffix}.1.gz
1125 %doc %{_mandir}/man1/jcf-dump%{binsuffix}.1.gz
1126 %doc %{_mandir}/man1/jv-convert%{binsuffix}.1.gz
1127 %doc %{_mandir}/man1/gc-analyze%{binsuffix}.1.gz
1128 %doc %{_mandir}/man1/aot-compile%{binsuffix}.1.gz
1129 %doc %{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1.gz
1130 %endif
1131 %endif
1132
1133 %if %{build_java}
1134 %if %{build_libjava}
1135 %files 
1136 %defattr(-,root,root)
1137 %dir %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}
1138 %dir %{_libdir}/gcc
1139 %dir %{_libdir}/gcc/%{GCCDIST}
1140 %dir %{libsubdir}
1141 %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}/classmap.db
1142 # We usually do not multilib libjava
1143 %if %{biarch_libjava}
1144 %versbiarchlib libgcj.la
1145 %biarchlib libgcj.so.*
1146 %biarchlib libgij.so.*
1147 %biarchlib libgcj-tools.so.*
1148 %else
1149 %versmainlib libgcj.la
1150 %mainlib libgcj.so.*
1151 %mainlib libgij.so.*
1152 %mainlib libgcj-tools.so.*
1153 %endif
1154 %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}/libjvm.la
1155 %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}/libjvm.so
1156 %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}/libjavamath.la
1157 %{_libdir}/gcj-%{gcc_dir_version}-%{gcj_sover}/libjavamath.so
1158
1159 %files -n libgcj_bc47
1160 %defattr(-,root,root)
1161 %if %{biarch_libjava}
1162 %biarchlib libgcj_bc.so.*
1163 %else
1164 %mainlib libgcj_bc.so.*
1165 %endif
1166
1167 %files -n libgcj47-jar
1168 %defattr(-,root,root)
1169 %{_prefix}/share/java/libgcj-%{gcc_dir_version}.jar
1170 %{_prefix}/share/java/libgcj-tools-%{gcc_dir_version}.jar
1171
1172 %files -n libgcj47-devel
1173 %defattr(-,root,root)
1174 %dir %{_prefix}/include/c++
1175 %dir %{libsubdir}
1176 %dir %{libsubdir}/include
1177 %dir %{gxxinclude}
1178 %{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
1179 %{libsubdir}/include/jawt.h
1180 %{libsubdir}/include/jawt_md.h
1181 %{libsubdir}/include/jni.h
1182 %{libsubdir}/include/jni_md.h
1183 %{libsubdir}/include/jvmpi.h
1184 %{gxxinclude}/gnu
1185 %{gxxinclude}/gcj
1186 %{gxxinclude}/java
1187 %{gxxinclude}/javax
1188 %{gxxinclude}/org
1189 %{gxxinclude}/sun
1190 %{libsubdir}/include/gcj
1191 %if %{biarch_libjava}
1192 %versbiarchlib libgcj.so
1193 %versbiarchlib libgcj.spec
1194 %versbiarchlib libgcj-tools.so
1195 %versbiarchlib libgij.so
1196 %versbiarchlib libgcj_bc.so
1197 %else
1198 %versmainlib libgcj.so
1199 %versmainlib libgcj.spec
1200 %versmainlib libgcj-tools.so
1201 %versmainlib libgij.so
1202 %versmainlib libgcj_bc.so
1203 %endif
1204
1205 %files -n gcc47-gij
1206 %defattr(-,root,root)
1207 %{_prefix}/bin/gij%{binsuffix}
1208 %{_prefix}/bin/gappletviewer%{binsuffix}
1209 %{_prefix}/bin/gjar%{binsuffix}
1210 %{_prefix}/bin/gjarsigner%{binsuffix}
1211 %{_prefix}/bin/gjavah%{binsuffix}
1212 %{_prefix}/bin/gkeytool%{binsuffix}
1213 %{_prefix}/bin/gnative2ascii%{binsuffix}
1214 %{_prefix}/bin/gorbd%{binsuffix}
1215 %{_prefix}/bin/grmic%{binsuffix}
1216 %{_prefix}/bin/grmid%{binsuffix}
1217 %{_prefix}/bin/grmiregistry%{binsuffix}
1218 %{_prefix}/bin/gserialver%{binsuffix}
1219 %{_prefix}/bin/gtnameserv%{binsuffix}
1220 %doc %{_mandir}/man1/gij%{binsuffix}.1.gz
1221 %doc %{_mandir}/man1/gappletviewer%{binsuffix}.1.gz
1222 %doc %{_mandir}/man1/grmic%{binsuffix}.1.gz
1223 %doc %{_mandir}/man1/grmid%{binsuffix}.1.gz
1224 %doc %{_mandir}/man1/grmiregistry%{binsuffix}.1.gz
1225 %doc %{_mandir}/man1/gkeytool%{binsuffix}.1.gz
1226 %doc %{_mandir}/man1/gjar%{binsuffix}.1.gz
1227 %doc %{_mandir}/man1/gjarsigner%{binsuffix}.1.gz
1228 %doc %{_mandir}/man1/gjavah%{binsuffix}.1.gz
1229 %doc %{_mandir}/man1/gnative2ascii%{binsuffix}.1.gz
1230 %doc %{_mandir}/man1/gorbd%{binsuffix}.1.gz
1231 %doc %{_mandir}/man1/gserialver%{binsuffix}.1.gz
1232 %doc %{_mandir}/man1/gtnameserv%{binsuffix}.1.gz
1233 %endif
1234 %endif
1235 # LIBFFI-DELETE-END
1236
1237 %if %{build_java}
1238 %if 0%{?building_libffi:1}
1239 %files -n libffi47
1240 %defattr(-,root,root)
1241 %mainlib libffi.so.*
1242
1243 %if %{separate_biarch}
1244 %files -n libffi47%{separate_biarch_suffix}
1245 %defattr(-,root,root)
1246 %biarchlib libffi.so.*
1247 %endif
1248
1249 %files -n libffi47-devel
1250 %defattr(-,root,root)
1251 %{_prefix}/include/ffi.h
1252 %{_prefix}/include/ffitarget.h
1253 %mainlib libffi.so
1254 %mainlib libffi.a
1255 %{_libdir}/pkgconfig/libffi.pc
1256 %doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
1257 %doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
1258 %doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
1259
1260 %if %{separate_biarch}
1261 %files -n libffi47-devel%{separate_biarch_suffix}
1262 %defattr(-,root,root)
1263 %biarchlib libffi.so
1264 %biarchlib libffi.a
1265 %endif
1266 %endif
1267 %endif
1268 # GCC-TESTSUITE-DELETE-END
1269
1270 %if 0%{?run_tests:1}
1271 %files -n gcc47-testresults
1272 %defattr(-,root,root)
1273 %doc testresults/test_summary.txt
1274 %doc testresults/*.sum
1275 %doc testresults/*.log
1276 %endif
1277
1278
1279 %changelog