Updating spec files with new scripts
[platform/upstream/gcc49.git] / packaging / libgcj49.spec
1 %define building_libjava 1
2 #
3 # spec file for package gcc49
4 #
5 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
6 #
7 # All modifications and additions to the file contributed by third parties
8 # remain the property of their copyright owners, unless otherwise agreed
9 # upon. The license for this file, and modifications and additions to the
10 # file, is the same license as for the pristine package itself (unless the
11 # license for the pristine package is not an Open Source License, in which
12 # case the license is the MIT License). An "Open Source License" is a
13 # license that conforms to the Open Source Definition (Version 1.9)
14 # published by the Open Source Initiative.
15
16 # Please submit bugfixes or comments via http://bugs.opensuse.org/
17 #
18
19 # norootforbuild
20 # icecream 0
21
22
23 %define build_ada 0
24
25 %define quadmath_arch %ix86 x86_64 ia64
26 %define tsan_arch x86_64
27 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm
28 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc
29 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
30 %define lsan_arch x86_64
31 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm
32 %if 0%{?build_libvtv:1}
33 %define vtv_arch x86_64 %ix86
34 %endif
35 %define cilkrts_arch x86_64 %ix86
36
37 # We don't want to build java
38 %define build_java 0
39 %define build_libjava 0
40
41 # Also go and objc aren't needed right now
42 %define build_objc 0
43 %define build_objcp 0
44 %define build_go 0
45
46 %define build_cp 1
47 %define build_fortran !0%{?building_libjava:1}%{?building_libffi:1}
48
49 %if %{build_objcp}
50 %define build_cp 1
51 %define build_objc 1
52 %endif
53
54 %if %{build_libjava}
55 %define build_cp 1
56 %endif
57
58 # For optional compilers only build C, C++ and Fortran
59 %if 0%{?build_optional_compiler_languages:1}
60 %define build_ada 0
61 %define build_java 0
62 %define build_libjava 0
63 %define build_objc 0
64 %define build_objcp 0
65 %define build_go 0
66 %endif
67
68 # Shared library SONAME versions
69 %ifarch hppa
70 %define libgcc_s 4
71 %else
72 %ifarch m68k
73 %define libgcc_s 2
74 %else
75 %define libgcc_s 1
76 %endif
77 %endif
78 %define libgcj_sover %{nil}
79 %define libgcj_bc_sover %{nil}
80 %define libffi_sover %{nil}
81 %define libgomp_sover %{nil}
82 %define libstdcxx_sover %{nil}
83 %define libobjc_sover %{nil}
84 %define libgfortran_sover %{nil}
85 %define libquadmath_sover %{nil}
86 %define libasan_sover %{nil}
87 %define libtsan_sover %{nil}
88 %define libatomic_sover %{nil}
89 %define libitm_sover %{nil}
90 %define libubsan_sover %{nil}
91 %define liblsan_sover %{nil}
92 %define libvtv_sover %{nil}
93 %define libcilkrts_sover %{nil}
94 %define libgo_sover %{nil}
95
96 # Shared library package suffix
97 # This is used for the "non-standard" set of libraries, the standard
98 # being defined by %product_libs_gcc_ver, the GCC version that should
99 # provide un-suffixed shared library packages following the shared-library
100 # policy.  Even suffixed variants should provide the shared-library policy
101 # mandated names and ensure they conflict with each other.
102 # Note that on SONAME changes of any library the %product_libs_gcc_ver
103 # define needs to be either split or the newest GCC version still providing
104 # the old SONAME needs to unconditionally produce an un-suffixed library
105 # if %product_libs_gcc_ver is newer than it.  Similar the _oldest_ GCC
106 # version first providing a new SONAME needs to unconditionally produce
107 # an un-suffixed library if %product_libs_gcc_ver is lower that it.
108 %if %{!?product_libs_gcc_ver:49}%{?product_libs_gcc_ver} != 49
109 %define pne 1
110 %endif
111 %define libgcc_s_suffix %{?pne:-gcc49}
112 # libgcj SONAME changes with every GCC version
113 %define libgcj_suffix %nil
114 %define libgcj_bc_suffix %{?pne:-gcc49}
115 %define libffi_suffix %{?pne:-gcc49}
116 %define libgomp_suffix %{?pne:-gcc49}
117 %define libstdcxx_suffix %{?pne:-gcc49}
118 %define libobjc_suffix %{?pne:-gcc49}
119 %define libgfortran_suffix %{?pne:-gcc49}
120 %define libquadmath_suffix %{?pne:-gcc49}
121 %define libasan_suffix %{?pne:-gcc49}
122 %define libtsan_suffix %{?pne:-gcc49}
123 %define libatomic_suffix %{?pne:-gcc49}
124 %define libitm_suffix %{?pne:-gcc49}
125
126
127 %define libubsan_suffix %{?pne:-gcc49}
128 %define liblsan_suffix %{?pne:-gcc49}
129 %define libvtv_suffix %{?pne:-gcc49}
130 %define libcilkrts_suffix %{?pne:-gcc49}
131 %define libgo_suffix %{?pne:-gcc49}
132
133 %define selfconflict() %1
134
135 Name: libgcj49
136 # With generated files in src we could drop the following
137 BuildRequires: bison
138 BuildRequires: flex
139 BuildRequires: gettext-devel
140 BuildRequires: makeinfo
141 # until here, but at least renaming and patching info files breaks this
142 BuildRequires: gcc-c++
143 BuildRequires: glibc-devel-32bit
144 BuildRequires: mpc-devel
145 BuildRequires: mpfr-devel
146 BuildRequires: perl
147 BuildRequires: zlib-devel
148 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm aarch64
149 BuildRequires: cloog-isl-devel
150 BuildRequires: isl-devel
151 %endif
152 %if %{build_ada}
153 %define hostsuffix -4.9
154 BuildRequires: gcc49-ada
155 %endif
156 %if 0%{?building_libjava:1}%{?building_testsuite:1}
157 BuildRequires: fastjar
158 %endif
159 %if 0%{?building_libffi:1}
160 BuildRequires: pkg-config
161 %endif
162 %ifarch ia64
163 BuildRequires: libunwind-devel
164 %endif
165 %if 0%{?run_tests:1}
166 BuildRequires: dejagnu
167 BuildRequires: expect
168 BuildRequires: gdb
169 %endif
170
171 %define separate_bi32 0
172 %define separate_bi64 0
173 %ifarch ppc sparcv9
174 # Beware, this does _not_ separate libgcj, as for that one multilibing
175 # is inactive for the time being
176 %define separate_bi64 1
177 %endif
178 %ifarch x86_64 s390x ppc64 sparc64
179 %define separate_bi32 1
180 %endif
181
182 # Define two macros to trigger -32bit or -64bit package variants
183 %define separate_biarch 0
184 %if %{separate_bi32}
185 %define separate_biarch 1
186 %define separate_biarch_suffix -32bit
187 %endif
188 %if %{separate_bi64}
189 %define separate_biarch 1
190 %define separate_biarch_suffix -64bit
191 %endif
192
193 %ifarch x86_64 ia64 s390x alpha ppc64 sparc64 aarch64
194 # 64-bit is primary build target
195 %define build_primary_64bit 1
196 %else
197 %define build_primary_64bit 0
198 %endif
199
200 %define biarch_libjava 0
201
202 %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64
203
204 URL:          http://gcc.gnu.org/
205 Version: 4.9.1
206 Release:      1
207 %define gcc_dir_version 4.9
208 %define binsuffix -4.9
209
210 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
211 Requires: binutils glibc-devel
212 Requires: cpp49 = %{version}-%{release}
213 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
214 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
215 %ifarch %asan_arch
216 Requires: libasan%{libasan_sover} >= %{version}-%{release}
217 %endif
218 %ifarch %tsan_arch
219 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
220 %endif
221 %ifarch %atomic_arch
222 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
223 %endif
224 %ifarch %itm_arch
225 Requires: libitm%{libitm_sover} >= %{version}-%{release}
226 %endif
227 %ifarch %cilkrts_arch
228 Requires: libcilkrts%{libcilkrts_sover} >= %{version}-%{release}
229 %endif
230 %ifarch %lsan_arch
231 Requires: liblsan%{liblsan_sover} >= %{version}-%{release}
232 %endif
233 %ifarch %ubsan_arch
234 Requires: libubsan%{libubsan_sover} >= %{version}-%{release}
235 %endif
236 %ifarch %vtv_arch
237 Requires: libvtv%{libvtv_sover} >= %{version}-%{release}
238 %endif
239 Requires: gcc49-info gcc49-locale
240 %endif
241
242 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
243 Source:         gcc-%{version}.tar.bz2
244 Source1:        change_spec
245 Source2:        libffi49-rpmlintrc
246 Source3:        gcc49-rpmlintrc
247 Source4:        ecj.jar
248 Source5:        baselibs.conf
249 Source6:        libgcj49-rpmlintrc
250
251 Summary:      Java Runtime Library for gcc
252 License:      GPL-2.0-with-classpath-exception
253 Group:        Development/Building
254 Requires:   libgcj49-jar = %{version}-%{release}
255 Provides: libgcj%{libgcj_sover} = %{version}-%{release}
256 Provides: libgij%{libgcj_sover} = %{version}-%{release}
257 Provides: libgcj-tools%{libgcj_sover} = %{version}-%{release}
258
259 %description
260 This library is needed if you want to use the GNU Java compiler, gcj.
261 Source code for this package is in gcc.
262
263 %post -n libgcj49 -p /sbin/ldconfig
264
265 %postun -n libgcj49 -p /sbin/ldconfig
266
267
268 %package -n gcc49-java
269 Summary:      The GNU Java Compiler
270 License:        GPL-3.0+
271 Group:        Development/Languages
272 Requires: gcc49 = %{version}
273 Requires: libgcj49-devel = %{version}-%{release}
274
275 %description -n gcc49-java
276 The Java compiler from the GCC-tools-suite.
277
278
279 %package -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
280 Summary:      Fake library for BC-ABI compatibility.
281 License:        GPL-2.0-with-classpath-exception
282 Group:        Development/Languages
283 # libgcj_bc is special in that it just contains a symlink to
284 # a proper libgcj version.  So require that library and add
285 # provides for the shlib version as created at link time
286 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
287 %ifarch x86_64 ia64 ppc64 s390x sparc64 aarch64
288 Provides: libgcj_bc.so.%{libgcj_bc_sover}()(64bit)
289 %else
290 Provides: libgcj_bc.so.%{libgcj_bc_sover}
291 %endif
292 Provides:       libgcj_bc%{libgcj_bc_sover} = %{version}-%{release}
293
294 %description -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
295 A fake library that is used at link time only. It ensures that
296 binaries built with the BC-ABI link against a constant SONAME.
297 This way, BC-ABI binaries continue to work if the SONAME underlying
298 libgcj.so changes.
299
300
301 %package -n libgcj49-jar
302 Summary:      Java runtime library (jar files).
303 License:        GPL-2.0-with-classpath-exception
304 Group:        Development/Languages
305
306 %description -n libgcj49-jar
307 These are the jar files that go along with the gcj front end to gcc.
308
309
310 %package -n libgcj49-devel
311 Summary:      Include Files and Libraries mandatory for Development.
312 License:        GPL-2.0-with-classpath-exception
313 Group:        Development/Languages
314 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
315 Requires: libgcj_bc%{libgcj_bc_sover} >= %{version}-%{release}
316 Requires: libgcj49-jar = %{version}-%{release}
317
318 %description -n libgcj49-devel
319 This package contains all necessary include files and libraries needed
320 to develop applications that require these.
321
322
323 %package -n gcc49-gij
324 Summary:      Java Bytecode Interpreter for gcc
325 License:      GPL-2.0-with-classpath-exception
326 Group:        Development/Languages
327 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
328
329 %description -n gcc49-gij
330 This package contains the java bytecode interpreter gij and related tools.
331
332
333 %package -n libstdc++49-doc
334 Summary:      Documentation for the GNU C++ standard library
335 License:        GPL-3.0+
336 Group:        Development/Building
337 BuildArch:    noarch
338
339 %description -n libstdc++49-doc
340 Extensive HTML documentation for the GNU C++ standard library.
341
342
343 %package -n libffi%{libffi_sover}%{libffi_suffix}
344 Summary:      Foreign Function Interface library
345 License:        BSD-3-Clause
346 Group:        Development/Building
347 Provides:       libffi%{libffi_sover} = %{version}-%{release}
348
349 %description -n libffi%{libffi_sover}%{libffi_suffix}
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
352 %post -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
353
354 %postun -n libffi%{libffi_sover}%{libffi_suffix} -p /sbin/ldconfig
355 %package -n libffi%{libffi_sover}%{libffi_suffix}-32bit
356 Summary:      Foreign Function Interface library
357 License:        BSD-3-Clause
358 Group:        Development/Building
359 Provides:       libffi%{libffi_sover}-32bit = %{version}-%{release}
360
361 %description -n libffi%{libffi_sover}%{libffi_suffix}-32bit
362 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.
363
364 %post -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
365
366 %postun -n libffi%{libffi_sover}%{libffi_suffix}-32bit -p /sbin/ldconfig
367 %package -n libffi%{libffi_sover}%{libffi_suffix}-64bit
368 Summary:      Foreign Function Interface library
369 License:        BSD-3-Clause
370 Group:        Development/Building
371 Provides:       libffi%{libffi_sover}-64bit = %{version}-%{release}
372
373 %description -n libffi%{libffi_sover}%{libffi_suffix}-64bit
374 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.
375
376 %post -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
377
378 %postun -n libffi%{libffi_sover}%{libffi_suffix}-64bit -p /sbin/ldconfig
379
380 %package -n libffi49-devel
381 Summary:      Foreign Function Interface library development files
382 License:        BSD 3-Clause
383 Group:        Development/Building
384 Requires: libffi%{libffi_sover} >= %{version}-%{release}
385 Provides: libffi-devel = %{version}-%{release}
386
387 %description -n libffi49-devel
388 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.
389 %package -n libffi49-devel-32bit
390 Summary:      Foreign Function Interface library development files
391 License:        BSD 3-Clause
392 Group:        Development/Building
393 Requires: libffi%{libffi_sover}-32bit >= %{version}-%{release}
394 Provides: libffi-devel-32bit = %{version}-%{release}
395
396 %description -n libffi49-devel-32bit
397 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.
398 %package -n libffi49-devel-64bit
399 Summary:      Foreign Function Interface library development files
400 License:        BSD 3-Clause
401 Group:        Development/Building
402 Requires: libffi%{libffi_sover}-64bit >= %{version}-%{release}
403 Provides: libffi-devel-64bit = %{version}-%{release}
404
405 %description -n libffi49-devel-64bit
406 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.
407
408 %package go
409 Summary:      GNU Go Compiler
410 License:        GPL-3.0+
411 Group:        Development/Languages
412 Requires: gcc49 = %{version}-%{release}
413 Requires: libgo%{libgo_sover} >= %{version}-%{release}
414
415 %description go
416 This package contains a Go compiler and associated development
417 files based on the GNU GCC technology.
418 %package go-32bit
419 Summary:      GNU Go Compiler
420 License:        GPL-3.0+
421 Group:        Development/Languages
422 Requires: gcc49-32bit = %{version}-%{release}
423 Requires: libgo%{libgo_sover}-32bit >= %{version}-%{release}
424
425 %description go-32bit
426 This package contains a Go compiler and associated development
427 files based on the GNU GCC technology.
428 %package go-64bit
429 Summary:      GNU Go Compiler
430 License:        GPL-3.0+
431 Group:        Development/Languages
432 Requires: gcc49-64bit = %{version}-%{release}
433 Requires: libgo%{libgo_sover}-64bit >= %{version}-%{release}
434
435 %description go-64bit
436 This package contains a Go compiler and associated development
437 files based on the GNU GCC technology.
438
439 %package -n libgo%{libgo_sover}%{libgo_suffix}
440 Summary:      GNU Go compiler runtime library
441 License:        BSD-3-Clause
442 Group:        Development/Languages
443 Provides:       libgo%{libgo_sover} = %{version}-%{release}
444
445 %description -n libgo%{libgo_sover}%{libgo_suffix}
446 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.
447
448 %post -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
449
450 %postun -n libgo%{libgo_sover}%{libgo_suffix} -p /sbin/ldconfig
451 %package -n libgo%{libgo_sover}%{libgo_suffix}-32bit
452 Summary:      GNU Go compiler runtime library
453 License:        BSD-3-Clause
454 Group:        Development/Languages
455 Provides:       libgo%{libgo_sover}-32bit = %{version}-%{release}
456
457 %description -n libgo%{libgo_sover}%{libgo_suffix}-32bit
458 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.
459
460 %post -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
461
462 %postun -n libgo%{libgo_sover}%{libgo_suffix}-32bit -p /sbin/ldconfig
463 %package -n libgo%{libgo_sover}%{libgo_suffix}-64bit
464 Summary:      GNU Go compiler runtime library
465 License:        BSD-3-Clause
466 Group:        Development/Languages
467 Provides:       libgo%{libgo_sover}-64bit = %{version}-%{release}
468
469 %description -n libgo%{libgo_sover}%{libgo_suffix}-64bit
470 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.
471
472 %post -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
473
474 %postun -n libgo%{libgo_sover}%{libgo_suffix}-64bit -p /sbin/ldconfig
475
476
477 %package -n gcc49-testresults
478 Summary:      Testsuite results
479 License:        SUSE-Public-Domain
480 Group:        Development/Languages
481
482 %description -n gcc49-testresults
483 Results from running the gcc and target library testsuites.
484
485
486
487
488 # Define the canonical target and host architecture
489 #   %gcc_target_arch  is supposed to be the full target triple
490 #   %TARGET_ARCH      is the canonicalized CPU part
491 #   %CONFIGURE_TARGET is the target triple used for --target=
492 %if 0%{?gcc_target_arch:1}
493 %define CONFIGURE_TARGET %{gcc_target_arch}
494 %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/;")
495 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
496 %define CONFIGURE_TARGET powerpc64-tizen-linux
497 %endif
498 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
499 %define CONFIGURE_TARGET powerpc64-tizen-linux
500 %endif
501 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
502 %define CONFIGURE_TARGET i586-tizen-linux
503 %endif
504 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "aarch64"
505 %define CONFIGURE_TARGET aarch64-tizen-linux
506 %endif
507 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
508 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
509 %endif
510 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
511 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
512 %endif
513 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
514 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
515 %endif
516 %else
517 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
518 %endif
519 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
520
521 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
522 %ifarch ppc
523 %define GCCDIST powerpc64-tizen-linux
524 %else
525 %ifarch %sparc
526 %define GCCDIST sparc64-tizen-linux
527 %else
528 %ifarch %arm
529 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
530 %else
531 %define GCCDIST %{HOST_ARCH}-tizen-linux
532 %endif
533 %endif
534 %endif
535
536 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
537 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
538
539
540 # Versionspecific directories
541 %define versmainlibdir %{libsubdir}
542 %define versmainlibdirbi32 %{libsubdir}/32
543 %define versmainlibdirbi64 %{libsubdir}/64
544 %ifarch ppc
545 %define versmainlibdirbi32 %{libsubdir}
546 %define versmainlibdirbi64 %{libsubdir}/64
547 %endif
548 %if %{build_primary_64bit}
549 %define versmainlibdirbi %{versmainlibdirbi32}
550 %else
551 %define versmainlibdirbi %{versmainlibdirbi64}
552 %endif
553
554 %define mainlibdir %{_libdir}
555 %define mainlibdirbi32 %{_prefix}/lib
556 %define mainlibdirbi64 %{_prefix}/lib64
557 %if %{build_primary_64bit}
558 %define mainlibdirbi %{mainlibdirbi32}
559 %else
560 %define mainlibdirbi %{mainlibdirbi64}
561 %endif
562
563
564 # Now define a few macros that make it easy to package libs and
565 # related files just to the right package, without caring for the
566 # exact path the files are in.
567 #   %mainlib  package X from all dirs that belong to the main package
568 #   %biarchlib   package X from all dirs that belong to the -32/64bit package
569 %define mainlib() %{mainlibdir}/%1\
570 %{nil}
571 %define biarchlib() %{nil}
572 %if %{biarch}
573 %if !%{separate_biarch}
574 %define mainlib() %{mainlibdir}/%1\
575 %{mainlibdirbi}/%1\
576 %{nil}
577 %else
578 %define biarchlib() %{mainlibdirbi}/%1\
579 %{nil}
580 %endif
581 %endif
582
583 %define versmainlib() %{versmainlibdir}/%1\
584 %{nil}
585 %define versbiarchlib() %{nil}
586 %if %{biarch}
587 %if !%{separate_biarch}
588 %define versmainlib() %{versmainlibdir}/%1\
589 %{versmainlibdirbi}/%1\
590 %{nil}
591 %else
592 %define versbiarchlib() %{versmainlibdirbi}/%1\
593 %{nil}
594 %endif
595 %endif
596
597
598
599 %prep
600 %setup -q -n gcc-%{version}
601
602 # We are configuring ppc as ppc64 but with switched multilibs.  Adjust
603 # the libstdc++ abi testsuite baseline files accordingly
604 %ifarch ppc
605 if [ -d libstdc++-v3/config/abi/post/powerpc64-linux-gnu ]; then
606   mkdir -p libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64
607   mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt \
608         libstdc++-v3/config/abi/post/powerpc64-linux-gnu/64/
609   mv libstdc++-v3/config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt \
610         libstdc++-v3/config/abi/post/powerpc64-linux-gnu/
611 fi
612 %endif
613
614 %build
615 # Avoid rebuilding of generated files
616 contrib/gcc_update --touch
617 # Avoid fucking up testsuite results with Java and indirect dispatch
618 export LD_AS_NEEDED=0
619 # Split version file into version used for directories (X.Y) and
620 # version to report with --version (X.Y.Z).
621 # See also gcc-dir-version.patch.
622 # Also decrement the patchlevel version by one if possible and remove
623 # the 'prerelease' tagging in this case
624 if test `cat gcc/DEV-PHASE` == "prerelease"; then
625   if test `cat gcc/BASE-VER | cut -d '.' -f 3` != "0"; then
626     : > gcc/DEV-PHASE
627   fi
628   ( 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
629 else
630   mv gcc/BASE-VER gcc/FULL-VER
631 fi
632 cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER
633
634 rm -rf obj-%{GCCDIST}
635 mkdir obj-%{GCCDIST}
636 cd obj-%{GCCDIST}
637 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' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g'
638 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
639 %ifarch %ix86
640 # -mcpu is superceded by -mtune but -mtune is not supported by
641 # our bootstrap compiler.  -mcpu gives a warning that stops
642 # the build process, so remove it for now.  Also remove all other
643 # -march and -mtune flags.  They are superseeded by proper
644 # default compiler settings now.
645 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'`
646 %endif
647 %ifarch s390 s390x
648 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'`
649 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'`
650 %endif
651 %if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
652 # Kill all -march/tune/cpu because that screws building the target libs
653 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
654 %endif
655 # Replace 2 spaces by one finally
656 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  / /g'`
657
658 languages=c
659 %if %{build_cp}
660 languages=$languages,c++
661 %endif
662 %if %{build_objc}
663 languages=$languages,objc
664 %endif
665 %if %{build_fortran}
666 languages=$languages,fortran
667 %endif
668 %if %{build_objcp}
669 languages=$languages,obj-c++
670 %endif
671 %if %{build_java}
672 languages=$languages,java
673 %endif
674 %if %{build_ada}
675 languages=$languages,ada
676 %endif
677 %if %{build_go}
678 languages=$languages,go
679 %endif
680
681 J=%{?jobs:%jobs}
682 if test -z "$J"; then
683   J=$(getconf _NPROCESSORS_CONF)
684   JL=$(($J * 2))
685 else
686   test 1 -gt "$J" && J=1
687   JL=$(($(getconf _NPROCESSORS_CONF)*2))
688 fi
689 if test "$J" == "0"; then
690   J=1
691 fi
692 if test "$JL" == "0"; then
693   JL=1
694 fi
695 PARALLEL="-j$J -l$JL"
696
697 # we don't want some miscompiles in the testsuite, or some fault in
698 # the compiler to kill the machine.  Hence we limit the amount of memory
699 # by the physical RAM plus half of swap
700 #MEM=$(free -m | awk '/^Mem:/ {print $2}')
701 #SWAP=$(free -m | awk '/^Swap:/ {print $2}')
702 #ulimit -v $(((MEM + SWAP/2)*1024))
703
704 # In general we want to ship release checking enabled compilers
705 # and run BETA with checking enabled.
706 #ENABLE_CHECKING="--enable-checking=yes"
707 ENABLE_CHECKING="--enable-checking=release"
708
709 # Work around tail/head -1 changes
710 export _POSIX2_VERSION=199209
711
712 %if %{build_ada}
713 # Using the host gnatmake like
714 #   CC="gcc%{hostsuffix}" GNATBIND="gnatbind%{hostsuffix}"
715 #   GNATMAKE="gnatmake%{hostsuffix}"
716 # doesn't work due to PR33857, so an un-suffixed gnatmake has to be
717 # available
718 mkdir -p host-tools/bin
719 cp -a /usr/bin/gnatmake%{hostsuffix} host-tools/bin/gnatmake
720 cp -a /usr/bin/gnatlink%{hostsuffix} host-tools/bin/gnatlink
721 cp -a /usr/bin/gnatbind%{hostsuffix} host-tools/bin/gnatbind
722 cp -a /usr/bin/gcc%{hostsuffix} host-tools/bin/gcc
723 ln -sf /usr/%{_lib} host-tools/%{_lib}
724 export PATH="`pwd`/host-tools/bin:$PATH"
725 %endif
726 #%if 0%{?gcc_target_arch:1} && 0%{!?gcc_icecream:1}
727 #%else
728 #       --enable-threads=posix \
729 #%endif
730 #       --enable-shared \
731 %if "%{TARGET_ARCH}" == "armv7l" || "%{TARGET_ARCH}" == "armv7hl"
732 # temporary workaround for a miscompilation of hash functions in java code
733 GCJ_EXTRA_FLAGS="-marm"
734 %endif
735
736 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
737 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS $GCJ_EXTRA_FLAGS" \
738 ../configure \
739         --prefix=%{_prefix} \
740         --infodir=%{_infodir} \
741         --mandir=%{_mandir} \
742         --libdir=%{_libdir} \
743         --libexecdir=%{_libdir} \
744         --enable-languages=$languages \
745         $ENABLE_CHECKING \
746         --with-gxx-include-dir=%{_prefix}/include/c++/%{gcc_dir_version} \
747         --enable-ssp \
748         --disable-libssp \
749         --disable-bootstrap \
750 %if 0%{!?build_libvtv:1}
751         --disable-libvtv \
752 %endif
753         --disable-plugin \
754         --with-bugurl="http://bugs.tizen.org/" \
755         --with-pkgversion="Tizen" \
756 %if !%{build_fortran}
757         --disable-libquadmath \
758 %endif
759 %if !%{build_libjava}
760         --disable-libgcj \
761 %else
762         --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
763         --with-ecj-jar=%{libsubdir}/ecj.jar \
764         --disable-java-awt \
765 %if !%{biarch_libjava}
766         --disable-libjava-multilib \
767 %endif
768 %endif
769         --with-slibdir=/%{_lib} \
770         --with-system-zlib \
771         --enable-__cxa_atexit \
772         --enable-libstdcxx-allocator=new \
773         --disable-libstdcxx-pch \
774         --enable-version-specific-runtime-libs \
775         --enable-linker-build-id \
776         --enable-linux-futex \
777         --program-suffix=%{binsuffix} \
778 %if 0%{!?gcc_target_arch:1}
779 %ifarch ia64
780         --with-system-libunwind \
781 %else
782         --without-system-libunwind \
783 %endif
784 %endif
785 %if 0%{?gcc_target_arch:1}
786         --program-prefix=%{gcc_target_arch}- \
787         --target=%{gcc_target_arch} \
788         --disable-nls \
789 %if 0%{?sysroot:1}
790         --with-sysroot=%sysroot \
791 %else
792         --with-sysroot=%{_prefix}/%{gcc_target_arch} \
793 %endif
794 %if 0%{?build_sysroot:1}
795         --with-build-sysroot=%{build_sysroot} \
796 %else
797 %if 0%{?sysroot:1}
798         --with-build-sysroot=%{sysroot} \
799 %else
800         --with-build-sysroot=%{_prefix}/%{gcc_target_arch} \
801 %endif
802 %endif
803 %if 0%{?canonical_target:1}
804         --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
805 %endif
806 %if "%{TARGET_ARCH}" == "spu"
807         --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
808         --with-newlib \
809 %endif
810 %endif
811 %if "%{TARGET_ARCH}" == "armv5tel"
812         --with-arch=armv5te \
813         --with-float=soft \
814         --with-mode=arm \
815         --with-abi=aapcs-linux \
816         --disable-sjlj-exceptions \
817 %endif
818 %if "%{TARGET_ARCH}" == "armv7l"
819         --with-arch=armv7-a \
820         --with-tune=cortex-a8 \
821         --with-float=softfp \
822         --with-fpu=vfpv3 \
823         --with-mode=thumb \
824         --disable-sjlj-exceptions \
825 %endif
826 %if "%{TARGET_ARCH}" == "armv7hl"
827         --with-arch=armv7-a \
828         --with-tune=cortex-a9 \
829         --with-float=hard \
830         --with-abi=aapcs-linux \
831         --with-fpu=vfpv3-d16 \
832         --disable-sjlj-exceptions \
833 %endif
834 %if  "%{TARGET_ARCH}" == "aarch64"
835         --with-arch=armv8-a \
836         --disable-sjlj-exceptions \
837 %endif
838 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
839 %if "%{TARGET_ARCH}" == "powerpc"
840         --with-cpu=default32 \
841 %endif
842 %if "%{TARGET_ARCH}" == "powerpc64le"
843         --with-cpu=power7 \
844 %else
845         --with-cpu-64=power4 \
846 %endif
847         --enable-secureplt \
848         --with-long-double-128 \
849 %if "%{TARGET_ARCH}" == "powerpc64le"
850         --disable-multilib \
851 %endif
852 %endif
853 %if "%{TARGET_ARCH}" == "sparc64"
854         --with-cpu=ultrasparc \
855         --with-long-double-128 \
856 %endif
857 %if "%{TARGET_ARCH}" == "sparc"
858         --with-cpu=v8 \
859         --with-long-double-128 \
860 %endif
861 %if "%{TARGET_ARCH}" == "i586"
862         --with-arch-32=i586 \
863         --with-tune=generic \
864 %endif
865 %if "%{TARGET_ARCH}" == "x86_64"
866         --with-arch-32=i586 \
867         --with-tune=generic \
868         --enable-multilib \
869 %endif
870 %if "%{TARGET_ARCH}" == "s390"
871         --with-tune=zEC12 --with-arch=z196 \
872         --with-long-double-128 \
873         --enable-decimal-float \
874 %endif
875 %if "%{TARGET_ARCH}" == "s390x"
876         --with-tune=zEC12 --with-arch=z196 \
877         --with-long-double-128 \
878         --enable-decimal-float \
879 %endif
880 %if "%{TARGET_ARCH}" == "m68k"
881         --disable-multilib \
882 %endif
883         --build=%{GCCDIST} \
884         --host=%{GCCDIST}
885
886
887 %if 0%{?building_libffi:1}
888 make stage1-bubble $PARALLEL
889 make all-target-libffi $PARALLEL
890 %else
891 STAGE1_FLAGS="-g"
892 # Only run profiled bootstrap on archs where it works and matters
893 %ifarch ppc64le s390x
894 make profiledbootstrap STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
895 %else
896 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
897 %endif
898 make info
899 %if 0%{?building_libjava:1}
900 make -C %{GCCDIST}/libstdc++-v3/doc doc-html-doxygen
901 %endif
902 %if 0%{?run_tests:1}
903 echo "Run testsuite"
904 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
905 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
906 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
907 # asan needs a whole shadow address space
908 ulimit -v unlimited || true
909 make -k check $PARALLEL || true
910 mkdir ../testresults
911 ../contrib/test_summary | tee ../testresults/test_summary.txt
912 %endif
913 %endif
914
915 %install
916 export NO_BRP_CHECK_BYTECODE_VERSION=true
917 cd obj-%{GCCDIST}
918 # Work around tail/head -1 changes
919 export _POSIX2_VERSION=199209
920 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
921 %if 0%{?building_libffi:1}
922 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
923 %else
924 %if 0%{?building_libjava:1}
925 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
926 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
927 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
928 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
929 # copy the libstdc++ API reference
930 cp -r %{GCCDIST}/libstdc++-v3/doc/doxygen/html ../libstdc++-v3/doc/html/api
931 # install-common also installs collect2, gcov and the g++ and gfortran driver
932 %if %{build_cp}
933 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
934 %endif
935 %if %{build_fortran}
936 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
937 %endif
938 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
939 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
940 %else
941 make install DESTDIR=$RPM_BUILD_ROOT
942 %if %{build_java}
943 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
944 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
945 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
946 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
947 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
948 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
949 %endif
950 %endif
951 %endif
952
953 # Remove libffi installed files if we did not want to build it
954 %if !0%{?building_libffi:1}
955 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
956 %if %{biarch}
957   rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
958 %endif
959 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
960 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
961 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
962 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
963 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
964 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3*
965 %endif
966
967 # Remove some useless .la files
968 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
969     libgomp libstdc++ libsupc++ libgcj-tools libgij libgo \
970     libasan libatomic libitm libtsan libcilkrts liblsan libubsan libvtv; do
971   rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
972 %if %{biarch}
973   rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
974 %endif
975 done
976
977 mkdir -p $RPM_BUILD_ROOT%{_libdir}
978 %if %{biarch}
979 %if %{build_primary_64bit}
980 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
981 %else
982 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
983 %endif
984 %endif
985
986
987 # move shared libs from versionspecific dir to main libdir
988 for libname in \
989 %if 0%{?building_libjava:1}
990   libgcj libgij libgcj-tools \
991 %else
992 %if %{build_fortran}
993   libgfortran \
994 %ifarch %quadmath_arch
995   libquadmath \
996 %endif
997 %endif
998 %if %{build_objc}
999   libobjc \
1000 %endif
1001 %if %{build_cp}
1002   libstdc++ \
1003 %endif
1004 %if %{build_go}
1005   libgo \
1006 %endif
1007   libgomp \
1008 %ifarch %atomic_arch
1009   libatomic \
1010 %endif
1011 %ifarch %itm_arch
1012   libitm \
1013 %endif
1014 %ifarch %asan_arch
1015   libasan \
1016 %endif
1017 %ifarch %tsan_arch
1018   libtsan \
1019 %endif
1020 %ifarch %cilkrts_arch
1021   libcilkrts \
1022 %endif
1023 %ifarch %lsan_arch
1024   liblsan \
1025 %endif
1026 %ifarch %ubsan_arch
1027   libubsan \
1028 %endif
1029 %ifarch %vtv_arch
1030   libvtv \
1031 %endif
1032 %endif
1033     ; do
1034   for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name $libname.so.*`; do
1035     mv $lib $RPM_BUILD_ROOT%{mainlibdir}/
1036   done
1037   ln -sf %{mainlibdir}/`readlink $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
1038          $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so
1039 %if %{biarch}
1040   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
1041     for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name "$libname.so.*"`; do
1042       mv $lib $RPM_BUILD_ROOT%{mainlibdirbi}/
1043     done
1044     ln -sf %{mainlibdirbi}/`readlink $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
1045          $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so
1046   fi
1047 %endif
1048 done
1049 # FIXME, tsan and lsan are not multilib
1050 %ifarch %tsan_arch
1051 %if %{biarch}
1052 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/libtsan.so
1053 %endif
1054 %endif
1055 %ifarch %lsan_arch
1056 %if %{biarch}
1057 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/liblsan.so
1058 %endif
1059 %endif
1060 %if %{build_cp}
1061 %if !0%{?building_libjava:1}
1062 # And we want to move the shlib gdb pretty printers to a more sane
1063 # place so ldconfig does not complain
1064 mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}
1065 mv $RPM_BUILD_ROOT%{mainlibdir}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/
1066 sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/libstdc++.so.*-gdb.py
1067 %if %{biarch}
1068   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
1069     mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}
1070     mv $RPM_BUILD_ROOT%{mainlibdirbi}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/
1071     sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/libstdc++.so.*-gdb.py
1072   fi
1073 %endif
1074 %endif
1075 %endif
1076 %if 0%{?building_libjava:1}
1077 # libgcj_bc is special as the .so file is actually a different
1078 # library as the library refered to by the SONAME which should
1079 # be a simple link to our libgcj.
1080 for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name libgcj_bc.so.*`; do
1081   rm $lib
1082 done
1083 ln -s libgcj.so.%{libgcj_sover} $RPM_BUILD_ROOT%{mainlibdir}/libgcj_bc.so.%{libgcj_bc_sover}
1084 %if %{biarch_libjava}
1085 for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name libgcj_bc.so.*`; do
1086   rm $lib
1087 done
1088 ln -s libgcj.so.%{libgcj_sover} $RPM_BUILD_ROOT%{mainlibdirbi}/libgcj_bc.so.%{libgcj_bc_sover}
1089 %endif
1090 mv $RPM_BUILD_ROOT%{libsubdir}/pkgconfig $RPM_BUILD_ROOT%{_libdir}/
1091 %endif
1092
1093
1094 %if %{build_ada}
1095 mv $RPM_BUILD_ROOT%{libsubdir}/adalib/lib*-*.so $RPM_BUILD_ROOT%{_libdir}
1096 ln -sf %{_libdir}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnarl.so
1097 ln -sf %{_libdir}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{libsubdir}/adalib/libgnat.so
1098 chmod a+x $RPM_BUILD_ROOT%{_libdir}/libgna*-*.so
1099 %if %{biarch}
1100 mv $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/lib*-*.so $RPM_BUILD_ROOT%{mainlibdirbi}/
1101 ln -sf %{mainlibdirbi}/libgnarl%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
1102 ln -sf %{mainlibdirbi}/libgnat%{binsuffix}.so $RPM_BUILD_ROOT%{versmainlibdirbi}/adalib/libgnarl.so
1103 chmod a+x $RPM_BUILD_ROOT%{mainlibdirbi}/libgna*-*.so
1104 %endif
1105 %endif
1106
1107 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/c++%{binsuffix}
1108
1109 # Remove some crap from the .la files:
1110 for l in `find $RPM_BUILD_ROOT -name '*.la'`; do
1111   echo "changing $l"
1112 # -e '/^dependency_libs/s|%{libsubdir}/\([^.]*\)\.la |%{_libdir}/\1\.la |g'
1113   sed -e '/^dependency_libs/s| -L%{_builddir}/[^ ]*||g' \
1114       -e '/^dependency_libs/s| -L/usr/%{GCCDIST}/bin||g' \
1115       -e '/^dependency_libs/s|-lm \(-lm \)*|-lm |' \
1116       -e '/^dependency_libs/s|-L[^ ]* ||g' \
1117 %if %{biarch}
1118 %if %{build_primary_64bit}
1119       -e '/^libdir/s|%{_libdir}/32|%{_prefix}/lib|' \
1120       -e '/^libdir/s|lib64/\.\./||' \
1121 %else
1122       -e '/^libdir/s|%{_libdir}/64|%{_prefix}/lib64|' \
1123 %endif
1124 %endif
1125       < $l  > $l.new
1126   mv $l.new $l
1127 done
1128
1129 %if 0%{?run_tests:1}
1130 cp `find . -name "*.sum"` ../testresults/
1131 cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
1132 chmod 644 ../testresults/*
1133 %endif
1134 %if %{build_cp}
1135 # Find C++ and Java headers
1136 find $RPM_BUILD_ROOT%{_prefix}/include/c++ \
1137   -regex ".*/\(org\|gcj\|gnu\|java\|javax\)" -prune \
1138   -o \( -type d -printf "%%%%dir " , \
1139         -printf "%{_prefix}/include/c++/%%P\n" \) > ../c++-headers
1140 %endif
1141 # Remove files that we do not need to clean up filelist
1142 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
1143 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
1144 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
1145 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
1146 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux/a.out.h
1147 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-generic/socket.h
1148 # no plugins
1149 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
1150 rm -f  $RPM_BUILD_ROOT%{_infodir}/dir
1151
1152
1153 %if 0%{?building_libjava:1}
1154 # gcj -static doesn't work properly anyway, unless using --whole-archive
1155 # let's save the space instead.
1156 find $RPM_BUILD_ROOT -name libgcj.a \
1157         -o -name libgcj-tools.a \
1158         -o -name libgij.a \
1159         -o -name libjvm.a \
1160         -o -name libgcj_bc.a \
1161   | xargs rm -f
1162
1163 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
1164   sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
1165
1166 # security files have broken install locations, also they cause conflicts
1167 # between libgcj versions.  Simply delete them here, libgcj will use its
1168 # defaults in this case (which is what these files contain anyway).
1169 rm -f $RPM_BUILD_ROOT%{libsubdir}/logging.properties
1170 rm -r $RPM_BUILD_ROOT%{libsubdir}/security
1171 %endif
1172
1173 %if 0%{?building_libffi:1}
1174 # Move libffi headers, remove empty libffi libtool file
1175 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
1176 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
1177 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
1178 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
1179 %if %{biarch}
1180 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
1181 %endif
1182 # Generate a simple pkg-config file
1183 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
1184 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
1185 %endif
1186
1187 %if %{build_java}
1188 %if !%{build_libjava}
1189 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
1190 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
1191 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
1192 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
1193 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
1194 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
1195 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
1196 %endif
1197 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
1198 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
1199 %endif
1200 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
1201 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
1202 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
1203 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
1204 %if %{biarch}
1205 %if %{build_primary_64bit}
1206 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
1207 %else
1208 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
1209 %endif
1210 %endif
1211 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
1212 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
1213 %if %{build_go}
1214 # gccgo.info isn't properly versioned
1215 rm $RPM_BUILD_ROOT%{_infodir}/gccgo.info*
1216 %endif
1217
1218 %if 0%{?building_libjava:1}
1219 # For building libjava only we need to delete other info docs
1220 rm $RPM_BUILD_ROOT%{_infodir}/cp-tools.info*
1221 # Remove stale manpages for binaries we do not build
1222 rm $RPM_BUILD_ROOT%{_mandir}/man1/gjdoc%{binsuffix}.1
1223 # For building the java frontend we need to copy the ecj jar
1224 mkdir -p $RPM_BUILD_ROOT%{libsubdir}
1225 cp $RPM_SOURCE_DIR/ecj.jar $RPM_BUILD_ROOT%{libsubdir}
1226 %else
1227 # For regular build, some info files do not get renamed properly.
1228 # Do so here.
1229 mv $RPM_BUILD_ROOT%{_infodir}/libgomp.info $RPM_BUILD_ROOT%{_infodir}/libgomp%{binsuffix}.info
1230 %ifarch %itm_arch
1231 mv $RPM_BUILD_ROOT%{_infodir}/libitm.info $RPM_BUILD_ROOT%{_infodir}/libitm%{binsuffix}.info
1232 %endif
1233 %if %{build_fortran}
1234 %ifarch %quadmath_arch
1235 mv $RPM_BUILD_ROOT%{_infodir}/libquadmath.info $RPM_BUILD_ROOT%{_infodir}/libquadmath%{binsuffix}.info
1236 %endif
1237 %endif
1238 %if %{build_ada}
1239 mv $RPM_BUILD_ROOT%{_infodir}/gnat-style.info $RPM_BUILD_ROOT%{_infodir}/gnat-style%{binsuffix}.info
1240 mv $RPM_BUILD_ROOT%{_infodir}/gnat_rm.info $RPM_BUILD_ROOT%{_infodir}/gnat_rm%{binsuffix}.info
1241 mv $RPM_BUILD_ROOT%{_infodir}/gnat_ugn.info $RPM_BUILD_ROOT%{_infodir}/gnat_ugn%{binsuffix}.info
1242 %endif
1243 %endif
1244
1245 %ifnarch %quadmath_arch
1246 rm -vf $RPM_BUILD_ROOT%{_infodir}/libquadmath*.info*
1247 %endif
1248
1249
1250
1251 %if %{build_java}
1252 %if 0%{?building_libjava:1}
1253 %files -n gcc49-java
1254 %defattr(-,root,root)
1255 %{_prefix}/bin/gcj%{binsuffix}
1256 %{_prefix}/bin/gcjh%{binsuffix}
1257 %{_prefix}/bin/gcj-dbtool%{binsuffix}
1258 %{_prefix}/bin/jcf-dump%{binsuffix}
1259 %{_prefix}/bin/jv-convert%{binsuffix}
1260 %{_prefix}/bin/gc-analyze%{binsuffix}
1261 %{_prefix}/bin/aot-compile%{binsuffix}
1262 %{_prefix}/bin/rebuild-gcj-db%{binsuffix}
1263 %{libsubdir}/jc1
1264 %{libsubdir}/jvgenmain
1265 %{libsubdir}/ecj.jar
1266 %{libsubdir}/ecj1
1267 %doc %{_mandir}/man1/gcj%{binsuffix}.1.gz
1268 %doc %{_mandir}/man1/gcjh%{binsuffix}.1.gz
1269 %doc %{_mandir}/man1/gcj-dbtool%{binsuffix}.1.gz
1270 %doc %{_mandir}/man1/jcf-dump%{binsuffix}.1.gz
1271 %doc %{_mandir}/man1/jv-convert%{binsuffix}.1.gz
1272 %doc %{_mandir}/man1/gc-analyze%{binsuffix}.1.gz
1273 %doc %{_mandir}/man1/aot-compile%{binsuffix}.1.gz
1274 %doc %{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1.gz
1275 %endif
1276 %endif
1277
1278 %if %{build_java}
1279 %if %{build_libjava}
1280 %files
1281 %defattr(-,root,root)
1282 %dir %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}
1283 %dir %{_libdir}/gcc
1284 %dir %{_libdir}/gcc/%{GCCDIST}
1285 %dir %{libsubdir}
1286 %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/classmap.db
1287 # We usually do not multilib libjava
1288 %if %{biarch_libjava}
1289 %versbiarchlib libgcj.la
1290 %biarchlib libgcj.so.*
1291 %biarchlib libgij.so.*
1292 %biarchlib libgcj-tools.so.*
1293 %else
1294 %versmainlib libgcj.la
1295 %mainlib libgcj.so.*
1296 %mainlib libgij.so.*
1297 %mainlib libgcj-tools.so.*
1298 %endif
1299 %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjvm.la
1300 %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjvm.so
1301 %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjavamath.la
1302 %{libsubdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjavamath.so
1303
1304 %files -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
1305 %defattr(-,root,root)
1306 %if %{biarch_libjava}
1307 %biarchlib libgcj_bc.so.%{libgcj_bc_sover}*
1308 %else
1309 %mainlib libgcj_bc.so.%{libgcj_bc_sover}*
1310 %endif
1311
1312 %files -n libgcj49-jar
1313 %defattr(-,root,root)
1314 %{_prefix}/share/java/libgcj-%{gcc_dir_version}.jar
1315 %{_prefix}/share/java/libgcj-tools-%{gcc_dir_version}.jar
1316
1317 %files -n libgcj49-devel
1318 %defattr(-,root,root)
1319 %dir %{_prefix}/include/c++
1320 %dir %{libsubdir}
1321 %dir %{libsubdir}/include
1322 %dir %{gxxinclude}
1323 %{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
1324 %{libsubdir}/include/jawt.h
1325 %{libsubdir}/include/jawt_md.h
1326 %{libsubdir}/include/jni.h
1327 %{libsubdir}/include/jni_md.h
1328 %{libsubdir}/include/jvmpi.h
1329 %{gxxinclude}/gnu
1330 %{gxxinclude}/gcj
1331 %{gxxinclude}/java
1332 %{gxxinclude}/javax
1333 %{gxxinclude}/org
1334 %{gxxinclude}/sun
1335 %{libsubdir}/include/gcj
1336 %if %{biarch_libjava}
1337 %versbiarchlib libgcj.so
1338 %versbiarchlib libgcj.spec
1339 %versbiarchlib libgcj-tools.so
1340 %versbiarchlib libgij.so
1341 %versbiarchlib libgcj_bc.so
1342 %else
1343 %versmainlib libgcj.so
1344 %versmainlib libgcj.spec
1345 %versmainlib libgcj-tools.so
1346 %versmainlib libgij.so
1347 %versmainlib libgcj_bc.so
1348 %endif
1349
1350 %files -n gcc49-gij
1351 %defattr(-,root,root)
1352 %{_prefix}/bin/gij%{binsuffix}
1353 %{_prefix}/bin/gappletviewer%{binsuffix}
1354 %{_prefix}/bin/gjar%{binsuffix}
1355 %{_prefix}/bin/gjarsigner%{binsuffix}
1356 %{_prefix}/bin/gjavah%{binsuffix}
1357 %{_prefix}/bin/gkeytool%{binsuffix}
1358 %{_prefix}/bin/gnative2ascii%{binsuffix}
1359 %{_prefix}/bin/gorbd%{binsuffix}
1360 %{_prefix}/bin/grmic%{binsuffix}
1361 %{_prefix}/bin/grmid%{binsuffix}
1362 %{_prefix}/bin/grmiregistry%{binsuffix}
1363 %{_prefix}/bin/gserialver%{binsuffix}
1364 %{_prefix}/bin/gtnameserv%{binsuffix}
1365 %doc %{_mandir}/man1/gij%{binsuffix}.1.gz
1366 %doc %{_mandir}/man1/gappletviewer%{binsuffix}.1.gz
1367 %doc %{_mandir}/man1/grmic%{binsuffix}.1.gz
1368 %doc %{_mandir}/man1/grmid%{binsuffix}.1.gz
1369 %doc %{_mandir}/man1/grmiregistry%{binsuffix}.1.gz
1370 %doc %{_mandir}/man1/gkeytool%{binsuffix}.1.gz
1371 %doc %{_mandir}/man1/gjar%{binsuffix}.1.gz
1372 %doc %{_mandir}/man1/gjarsigner%{binsuffix}.1.gz
1373 %doc %{_mandir}/man1/gjavah%{binsuffix}.1.gz
1374 %doc %{_mandir}/man1/gnative2ascii%{binsuffix}.1.gz
1375 %doc %{_mandir}/man1/gorbd%{binsuffix}.1.gz
1376 %doc %{_mandir}/man1/gserialver%{binsuffix}.1.gz
1377 %doc %{_mandir}/man1/gtnameserv%{binsuffix}.1.gz
1378 %endif
1379 %endif
1380
1381 %if 0%{?building_libjava:1}
1382 %files -n libstdc++49-doc
1383 %defattr(-,root,root)
1384 %doc libstdc++-v3/doc/html
1385 %endif
1386
1387 %if %{build_java}
1388 %if 0%{?building_libffi:1}
1389 %files -n libffi%{libffi_sover}%{libffi_suffix}
1390 %defattr(-,root,root)
1391 %mainlib libffi.so.%{libffi_sover}*
1392
1393 %if %{separate_biarch}
1394 %files -n libffi%{libffi_sover}%{libffi_suffix}%{separate_biarch_suffix}
1395 %defattr(-,root,root)
1396 %biarchlib libffi.so.%{libffi_sover}*
1397 %endif
1398
1399 %post -n libffi49-devel
1400 %install_info --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1401 %postun -n libffi49-devel
1402 %install_info_delete --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1403
1404 %files -n libffi49-devel
1405 %defattr(-,root,root)
1406 %{_prefix}/include/ffi.h
1407 %{_prefix}/include/ffitarget.h
1408 %mainlib libffi.so
1409 %mainlib libffi.a
1410 %{_libdir}/pkgconfig/libffi.pc
1411 %doc %{_infodir}/libffi%{binsuffix}.info.gz
1412 %doc %{_mandir}/man3/ffi%{binsuffix}.3.gz
1413 %doc %{_mandir}/man3/ffi_call%{binsuffix}.3.gz
1414 %doc %{_mandir}/man3/ffi_prep_cif%{binsuffix}.3.gz
1415 %doc %{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3.gz
1416
1417 %if %{separate_biarch}
1418 %files -n libffi49-devel%{separate_biarch_suffix}
1419 %defattr(-,root,root)
1420 %biarchlib libffi.so
1421 %biarchlib libffi.a
1422 %endif
1423 %endif
1424 %endif
1425
1426 %if %{build_go}
1427 %files go
1428 %{_prefix}/bin/gccgo%{binsuffix}
1429 %{libsubdir}/go1
1430 %versmainlib libgo.a
1431 %versmainlib libgo.so
1432 %versmainlib libgobegin.a
1433 %dir %mainlibdir/go
1434 %dir %mainlibdir/go/%{gcc_dir_version}
1435 %mainlibdir/go/%{gcc_dir_version}/%{GCCDIST}
1436 %doc %{_mandir}/man1/gccgo%{binsuffix}.1.gz
1437
1438 %if %{separate_biarch}
1439 %files go%{separate_biarch_suffix}
1440 %versbiarchlib libgo.a
1441 %versbiarchlib libgo.so
1442 %versbiarchlib libgobegin.a
1443 %dir %mainlibdirbi/go
1444 %dir %mainlibdirbi/go/%{gcc_dir_version}
1445 %mainlibdirbi/go/%{gcc_dir_version}/%{GCCDIST}
1446 %endif
1447
1448 %files -n libgo%{libgo_sover}%{libgo_suffix}
1449 %defattr(-,root,root)
1450 %mainlib libgo.so.%{libgo_sover}*
1451
1452 %if %{separate_biarch}
1453 %files -n libgo%{libgo_sover}%{libgo_suffix}%{separate_biarch_suffix}
1454 %defattr(-,root,root)
1455 %biarchlib libgo.so.%{libgo_sover}*
1456 %endif
1457 %endif
1458
1459 %if 0%{?run_tests:1}
1460 %files -n gcc49-testresults
1461 %defattr(-,root,root)
1462 %doc testresults/test_summary.txt
1463 %doc testresults/*.sum
1464 %doc testresults/*.log
1465 %endif
1466
1467
1468 %changelog