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