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