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