adapt groups
[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
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.1
177 Release:      1
178 %define gcc_version %(echo %version | sed 's/_.*//')
179 %define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
180 %define snapshot_date %(echo %version | sed 's/[34]\.[0-9]\.[0-6]//' | sed 's/_/-/')
181 %define binsuffix -4.8
182
183 %if !0%{?building_libjava:1}%{?building_libffi:1}%{?building_testsuite:1}
184 Requires: binutils glibc-devel
185 Requires: cpp48 = %{version}-%{release}
186 Requires: libgcc_s%{libgcc_s} >= %{version}-%{release}
187 Requires: libgomp%{libgomp_sover} >= %{version}-%{release}
188 %if %{build_with_mudflap}
189 Requires: libmudflap%{libmudflap_sover} >= %{version}-%{release}
190 Requires: libmudflapth%{libmudflap_sover} >= %{version}-%{release}
191 %endif
192 %ifarch %asan_arch
193 Requires: libasan%{libasan_sover} >= %{version}-%{release}
194 %endif
195 %ifarch %tsan_arch
196 Requires: libtsan%{libtsan_sover} >= %{version}-%{release}
197 %endif
198 %ifarch %atomic_arch
199 Requires: libatomic%{libatomic_sover} >= %{version}-%{release}
200 %endif
201 %ifarch %itm_arch
202 Requires: libitm%{libitm_sover} >= %{version}-%{release}
203 %endif
204 Suggests: gcc48-info gcc48-locale
205 %endif
206
207 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
208 Source:         gcc-%{version}.tar.bz2
209 Source1:        change_spec
210 Source3:        gcc48-rpmlintrc
211 Source4:        ecj.jar
212 Source6:        baselibs.conf
213
214
215 Summary:      Java Runtime Library for gcc
216 License:      GPL-2.0-with-classpath-exception
217 Group:        System/Libraries
218
219 %description 
220 This library is needed if you want to use the GNU Java compiler, gcj.
221 Source code for this package is in gcc.
222
223 %post 
224 /sbin/ldconfig
225
226 %postun 
227 /sbin/ldconfig
228
229
230 %package -n gcc48-java
231 Summary:      The GNU Java Compiler
232 License:        GPL-3.0+
233 Requires: gcc48 = %{version}
234 Requires: libgcj48-devel = %{version}-%{release}
235
236 %description -n gcc48-java
237 The Java compiler from the GCC-tools-suite.
238
239
240 %package -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
241 Summary:      Fake library for BC-ABI compatibility.
242 License:        GPL-2.0-with-classpath-exception
243 # libgcj_bc is special in that it just contains a symlink to
244 # a proper libgcj version.  So require that library and add
245 # provides for the shlib version as created at link time
246 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
247 %ifarch x86_64 ia64 ppc64 s390x sparc64 aarch64
248 Provides: libgcj_bc.so.%{libgcj_bc_sover}()(64bit)
249 %else
250 Provides: libgcj_bc.so.%{libgcj_bc_sover}
251 %endif
252
253 %description -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
254 A fake library that is used at link time only. It ensures that
255 binaries built with the BC-ABI link against a constant SONAME.
256 This way, BC-ABI binaries continue to work if the SONAME underlying
257 libgcj.so changes.
258
259
260 %package -n libgcj48-jar
261 Summary:      Java runtime library (jar files).
262 License:        GPL-2.0-with-classpath-exception
263
264 %description -n libgcj48-jar
265 These are the jar files that go along with the gcj front end to gcc.
266
267
268 %package -n libgcj48-devel
269 Summary:      Include Files and Libraries mandatory for Development.
270 License:        GPL-2.0-with-classpath-exception
271 Requires: libstdc++48-devel = %{version}
272 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
273 Requires: libgcj_bc%{libgcj_bc_sover} >= %{version}-%{release}
274 Requires: libgcj48-jar = %{version}-%{release}
275 Requires: gtk2-devel
276 Requires: libart_lgpl-devel
277 Requires: glibc-devel
278 Requires: zlib-devel
279 %ifarch ia64
280 Requires: libunwind-devel
281 %endif
282
283 %description -n libgcj48-devel
284 This package contains all necessary include files and libraries needed
285 to develop applications that require these.
286
287
288 %package -n gcc48-gij
289 Summary:      Java Bytecode Interpreter for gcc
290 License:      GPL-2.0-with-classpath-exception
291 Requires: libgcj%{libgcj_sover} >= %{version}-%{release}
292
293 %description -n gcc48-gij
294 This package contains the java bytecode interpreter gij and related tools.
295
296 %package -n libffi%{libffi_sover}%{libffi_suffix}
297 Summary:      Foreign Function Interface library
298 License:        BSD-3-Clause
299
300 %description -n libffi%{libffi_sover}%{libffi_suffix}
301 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.
302
303 %post -n libffi%{libffi_sover}%{libffi_suffix}
304 /sbin/ldconfig
305
306 %postun -n libffi%{libffi_sover}%{libffi_suffix}
307 /sbin/ldconfig
308 %package -n libffi%{libffi_sover}%{libffi_suffix}-32bit
309 Summary:      Foreign Function Interface library
310 License:        BSD-3-Clause
311
312 %description -n libffi%{libffi_sover}%{libffi_suffix}-32bit
313 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.
314
315 %post -n libffi%{libffi_sover}%{libffi_suffix}-32bit
316 /sbin/ldconfig
317
318 %postun -n libffi%{libffi_sover}%{libffi_suffix}-32bit
319 /sbin/ldconfig
320 %package -n libffi%{libffi_sover}%{libffi_suffix}-64bit
321 Summary:      Foreign Function Interface library
322 License:        BSD-3-Clause
323
324 %description -n libffi%{libffi_sover}%{libffi_suffix}-64bit
325 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.
326
327 %post -n libffi%{libffi_sover}%{libffi_suffix}-64bit
328 /sbin/ldconfig
329
330 %postun -n libffi%{libffi_sover}%{libffi_suffix}-64bit
331 /sbin/ldconfig
332
333 %package -n libffi48-devel
334 Summary:      Foreign Function Interface library development files
335 License:        BSD 3-Clause
336 Requires: libffi%{libffi_sover} >= %{version}-%{release}
337
338 %description -n libffi48-devel
339 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.
340 %package -n libffi48-devel-32bit
341 Summary:      Foreign Function Interface library development files
342 License:        BSD 3-Clause
343 Requires: libffi%{libffi_sover}-32bit >= %{version}-%{release}
344
345 %description -n libffi48-devel-32bit
346 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.
347 %package -n libffi48-devel-64bit
348 Summary:      Foreign Function Interface library development files
349 License:        BSD 3-Clause
350 Requires: libffi%{libffi_sover}-64bit >= %{version}-%{release}
351
352 %description -n libffi48-devel-64bit
353 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.
354
355 %package -n gcc48-testresults
356 Summary:      Testsuite results
357 License:        SUSE-Public-Domain
358
359 %description -n gcc48-testresults
360 Results from running the gcc and target library testsuites.
361
362
363
364 # Define the canonical target and host architecture
365 #   %gcc_target_arch  is supposed to be the full target triple
366 #   %TARGET_ARCH      is the canonicalized CPU part
367 #   %CONFIGURE_TARGET is the target triple used for --target=
368 %if 0%{?gcc_target_arch:1}
369 %define CONFIGURE_TARGET %{gcc_target_arch}
370 %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/;")
371 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc"
372 %define CONFIGURE_TARGET powerpc64-tizen-linux
373 %endif
374 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "powerpc64"
375 %define CONFIGURE_TARGET powerpc64-tizen-linux
376 %endif
377 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "i586"
378 %define CONFIGURE_TARGET i586-tizen-linux
379 %endif
380 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7l"
381 %define CONFIGURE_TARGET armv7l-tizen-linux-gnueabi
382 %endif
383 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv7hl"
384 %define CONFIGURE_TARGET armv7hl-tizen-linux-gnueabi
385 %endif
386 %if 0%{?gcc_icecream:1} && %{TARGET_ARCH} == "armv5tel"
387 %define CONFIGURE_TARGET armv5tel-tizen-linux-gnueabi
388 %endif
389 %else
390 %define TARGET_ARCH %(echo %{_target_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
391 %endif
392 %define HOST_ARCH %(echo %{_host_cpu} | sed -e "s/i.86/i586/;s/ppc/powerpc/;s/sparc64.*/sparc64/;s/sparcv.*/sparc/;")
393
394 %define biarch %(case " %{biarch_targets} " in (*" %{TARGET_ARCH} "*) echo 1;; (*) echo 0;; esac)
395
396 %ifarch ppc
397 %define GCCDIST powerpc64-tizen-linux
398 %else
399 %ifarch %sparc
400 %define GCCDIST sparc64-tizen-linux
401 %else
402 %ifarch %arm
403 %define GCCDIST %{HOST_ARCH}-tizen-linux-gnueabi
404 %else
405 %define GCCDIST %{HOST_ARCH}-tizen-linux
406 %endif
407 %endif
408 %endif
409
410 %define libsubdir %{_libdir}/gcc/%{GCCDIST}/%{gcc_dir_version}
411 %define gxxinclude %{_prefix}/include/c++/%{gcc_dir_version}
412
413
414 # Versionspecific directories
415 %define versmainlibdir %{libsubdir}
416 %define versmainlibdirbi32 %{libsubdir}/32
417 %define versmainlibdirbi64 %{libsubdir}/64
418 %ifarch ppc
419 %define versmainlibdirbi32 %{libsubdir}
420 %define versmainlibdirbi64 %{libsubdir}/64
421 %endif
422 %if %{build_primary_64bit}
423 %define versmainlibdirbi %{versmainlibdirbi32}
424 %else
425 %define versmainlibdirbi %{versmainlibdirbi64}
426 %endif
427
428 %define mainlibdir %{_libdir}
429 %define mainlibdirbi32 %{_prefix}/lib
430 %define mainlibdirbi64 %{_prefix}/lib64
431 %if %{build_primary_64bit}
432 %define mainlibdirbi %{mainlibdirbi32}
433 %else
434 %define mainlibdirbi %{mainlibdirbi64}
435 %endif
436
437
438 # Now define a few macros that make it easy to package libs and
439 # related files just to the right package, without caring for the
440 # exact path the files are in.
441 #   %mainlib  package X from all dirs that belong to the main package
442 #   %biarchlib   package X from all dirs that belong to the -32/64bit package
443 %define mainlib() %{mainlibdir}/%1\
444 %{nil}
445 %define biarchlib() %{nil}
446 %if %{biarch}
447 %if !%{separate_biarch}
448 %define mainlib() %{mainlibdir}/%1\
449 %{mainlibdirbi}/%1\
450 %{nil}
451 %else
452 %define biarchlib() %{mainlibdirbi}/%1\
453 %{nil}
454 %endif
455 %endif
456
457 %define versmainlib() %{versmainlibdir}/%1\
458 %{nil}
459 %define versbiarchlib() %{nil}
460 %if %{biarch}
461 %if !%{separate_biarch}
462 %define versmainlib() %{versmainlibdir}/%1\
463 %{versmainlibdirbi}/%1\
464 %{nil}
465 %else
466 %define versbiarchlib() %{versmainlibdirbi}/%1\
467 %{nil}
468 %endif
469 %endif
470
471
472
473 %prep
474 %setup -q -n gcc-%{version}
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_libjava}
627         --disable-libgcj \
628 %else
629         --with-java-home=%{_libdir}/jvm/java-1.5.0-gcj%{binsuffix}-1.5.0.0/jre \
630         --with-ecj-jar=%{libsubdir}/ecj.jar \
631         --disable-java-awt \
632 %if !%{biarch_libjava}
633         --disable-libjava-multilib \
634 %endif
635 %endif
636 %if !%{build_with_mudflap}
637         --disable-libmudflap \
638 %endif
639         --with-slibdir=/%{_lib} \
640         --with-system-zlib \
641         --enable-__cxa_atexit \
642         --enable-libstdcxx-allocator=new \
643         --disable-libstdcxx-pch \
644         --enable-version-specific-runtime-libs \
645         --enable-linker-build-id \
646 %if 0%{?gcc_target_arch:1}
647 %if 0%{?gcc_icecream:1}
648         --with-build-sysroot=/ \
649         --with-sysroot=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi} \
650         --with-gxx-include-dir=%{_prefix}/%{gcc_target_arch}%{?canonical_target_abi:%canonical_target_abi}/usr/include/c++/%{gcc_dir_version} \
651         --enable-linux-futex \
652 %endif
653 %if 0%{?canonical_target:1}
654         --with-build-time-tools=/usr/%{canonical_target}-tizen-linux%{?canonical_target_abi:%canonical_target_abi}/bin \
655 %endif
656 %if 0%{?sysroot:1}
657         --with-sysroot=%sysroot \
658 %endif
659 %if 0%{?build_static:1}
660         --disable-shared \
661 %endif
662 %if "%{TARGET_ARCH}" == "spu"
663         --with-gxx-include-dir=%sysroot/include/c++/%{gcc_dir_version} \
664         --with-newlib \
665 %endif
666         --disable-nls \
667         --target=%{CONFIGURE_TARGET} \
668 %else
669         --program-suffix=%{binsuffix} \
670         --enable-linux-futex \
671 %ifarch ia64
672         --with-system-libunwind \
673 %else
674         --without-system-libunwind \
675 %endif
676 %endif
677 %if "%{TARGET_ARCH}" == "armv5tel"
678         --with-arch=armv5te \
679         --with-float=soft \
680         --with-mode=arm \
681         --with-abi=aapcs-linux \
682         --disable-sjlj-exceptions \
683 %endif
684 %if "%{TARGET_ARCH}" == "armv7l" 
685         --with-arch=armv7-a \
686         --with-tune=cortex-a9 \
687     --with-float=soft \
688         --with-fpu=vfpv3-d16 \
689         --disable-sjlj-exceptions \
690 %endif
691 %if  "%{TARGET_ARCH}" == "armv7hl"
692         --with-arch=armv7-a \
693         --with-tune=cortex-a9 \
694         --with-float=hard \
695         --with-abi=aapcs-linux \
696         --with-fpu=vfpv3-d16 \
697         --disable-sjlj-exceptions \
698 %endif
699 %if "%{TARGET_ARCH}" == "powerpc" || "%{TARGET_ARCH}" == "powerpc64"
700 %if "%{TARGET_ARCH}" == "powerpc"
701         --with-cpu=default32 \
702 %endif
703         --with-cpu-64=power4 \
704         --enable-secureplt \
705         --with-long-double-128 \
706 %endif
707 %if "%{TARGET_ARCH}" == "sparc64"
708         --with-cpu=ultrasparc \
709         --with-long-double-128 \
710 %endif
711 %if "%{TARGET_ARCH}" == "sparc"
712         --with-cpu=v8 \
713         --with-long-double-128 \
714 %endif
715 %if "%{TARGET_ARCH}" == "i586"
716         --with-arch-32=i586 \
717         --with-tune=generic \
718 %endif
719 %if "%{TARGET_ARCH}" == "x86_64"
720         --with-arch-32=i586 \
721         --with-tune=generic \
722 %endif
723 %if "%{TARGET_ARCH}" == "s390"
724         --with-tune=z196 --with-arch=z10 \
725         --with-long-double-128 \
726         --enable-decimal-float \
727 %endif
728 %if "%{TARGET_ARCH}" == "s390x"
729         --with-tune=z196 --with-arch=z10 \
730         --with-long-double-128 \
731         --enable-decimal-float \
732 %endif
733         --build=%{GCCDIST}
734
735
736 %if 0%{?building_libffi:1}
737 make stage1-bubble $PARALLEL
738 make all-target-libffi $PARALLEL
739 %else
740 STAGE1_FLAGS="-g"
741 # Only run profiled bootstrap on archs where it works
742 #%ifarch %ix86 x86_64 ppc ppc64 ia64
743 #make profiledbootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
744 #%else
745 #make bootstrap-lean STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
746 make STAGE1_CFLAGS="$STAGE1_FLAGS" BOOT_CFLAGS="$RPM_OPT_FLAGS" $PARALLEL
747 #%endif
748 #make -C gcc proto
749 make info
750 %if 0%{?run_tests:1}
751 echo "Run testsuite"
752 (make -C %{GCCDIST}/libstdc++-v3 check-abi || true)
753 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.log %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.log
754 mv %{GCCDIST}/libstdc++-v3/testsuite/libstdc++.sum %{GCCDIST}/libstdc++-v3/testsuite/libstdc++-abi.sum
755 # asan needs a whole shadow address space
756 ulimit -v unlimited || true
757 make -k check $PARALLEL || true
758 mkdir ../testresults
759 ../contrib/test_summary | tee ../testresults/test_summary.txt
760 %endif
761 %endif
762
763 %install
764 export NO_BRP_CHECK_BYTECODE_VERSION=true
765 cd obj-%{GCCDIST}
766 # Work around tail/head -1 changes
767 export _POSIX2_VERSION=199209
768 export LIBRARY_PATH=$RPM_BUILD_ROOT%{libsubdir}:$RPM_BUILD_ROOT%{mainlibdirbi}
769 %if 0%{?building_libffi:1}
770 make -C %{GCCDIST}/libffi install DESTDIR=$RPM_BUILD_ROOT
771 %else
772 %if 0%{?building_libjava:1}
773 make -C %{GCCDIST}/libjava install DESTDIR=$RPM_BUILD_ROOT
774 make -C gcc java.install-man DESTDIR=$RPM_BUILD_ROOT
775 make -C gcc java.install-common DESTDIR=$RPM_BUILD_ROOT
776 make -C gcc install-common DESTDIR=$RPM_BUILD_ROOT COMPILERS='jc1$(exeext) jvgenmain$(exeext)'
777 # install-common also installs collect2, gcov and the g++ and gfortran driver
778 %if %{build_cp}
779 rm $RPM_BUILD_ROOT%{_prefix}/bin/g++%{binsuffix}
780 %endif
781 %if %{build_fortran}
782 rm $RPM_BUILD_ROOT%{_prefix}/bin/gfortran%{binsuffix}
783 %endif
784 rm $RPM_BUILD_ROOT%{_prefix}/bin/gcov%{binsuffix}
785 rm $RPM_BUILD_ROOT%{libsubdir}/collect2
786 %else
787 make install DESTDIR=$RPM_BUILD_ROOT
788 %if %{build_java}
789 make -C gcc java.uninstall DESTDIR=$RPM_BUILD_ROOT
790 make -C gcc java.install-info DESTDIR=$RPM_BUILD_ROOT
791 rm $RPM_BUILD_ROOT%{_prefix}/bin/jcf-dump%{binsuffix}
792 rm $RPM_BUILD_ROOT%{_mandir}/man1/jcf-dump%{binsuffix}.1
793 rm $RPM_BUILD_ROOT%{libsubdir}/jc1
794 rm $RPM_BUILD_ROOT%{libsubdir}/jvgenmain
795 %endif
796 %endif
797 %endif
798
799 # Remove libffi installed files if we did not want to build it
800 %if !0%{?building_libffi:1}
801 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.*
802 %if %{biarch}
803   rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.*
804 %endif
805 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h
806 rm -f $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h
807 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi%{binsuffix}.3*
808 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_call%{binsuffix}.3*
809 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif%{binsuffix}.3*
810 rm -f $RPM_BUILD_ROOT%{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3*
811 %endif
812
813 # Remove some useless .la files
814 for lib in libobjc libgfortran libgfortranbegin libquadmath libcaf_single \
815     libmudflap libmudflapth libgomp libstdc++ libsupc++ libgcj-tools libgij \
816     libasan libatomic libitm libtsan; do
817   rm -f $RPM_BUILD_ROOT%{versmainlibdir}/$lib.la
818 %if %{biarch}
819   rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/$lib.la
820 %endif
821 done
822
823 mkdir -p $RPM_BUILD_ROOT%{_libdir}
824 %if %{biarch}
825 %if %{build_primary_64bit}
826 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib
827 %else
828 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib64
829 %endif
830 %endif
831
832
833 # move shared libs from versionspecific dir to main libdir
834 for libname in \
835 %if 0%{?building_libjava:1}
836   libgcj libgij libgcj-tools \
837 %else
838 %if %{build_fortran}
839   libgfortran \
840 %ifarch %quadmath_arch
841   libquadmath \
842 %endif
843 %endif
844 %if %{build_objc}
845   libobjc \
846 %endif
847 %if %{build_cp}
848   libstdc++ \
849 %endif
850   libgomp \
851 %ifarch %atomic_arch
852   libatomic \
853 %endif
854 %ifarch %itm_arch
855   libitm \
856 %endif
857 %ifarch %asan_arch
858   libasan \
859 %endif
860 %ifarch %tsan_arch
861   libtsan \
862 %endif
863 %if %{build_with_mudflap}
864   libmudflap libmudflapth \
865 %endif
866 %endif
867     ; do
868   for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name $libname.so.*`; do
869     mv $lib $RPM_BUILD_ROOT%{mainlibdir}/
870   done
871   ln -sf %{mainlibdir}/`readlink $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
872          $RPM_BUILD_ROOT%{versmainlibdir}/$libname.so
873 %if %{biarch}
874   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
875     for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name "$libname.so.*"`; do
876       mv $lib $RPM_BUILD_ROOT%{mainlibdirbi}/
877     done
878     ln -sf %{mainlibdirbi}/`readlink $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so | sed -e 's/\(.*\.so\.[^\.]*\).*/\1/'`  \
879          $RPM_BUILD_ROOT%{versmainlibdirbi}/$libname.so
880   fi
881 %endif
882 done
883 # FIXME, tsan is not multilib
884 %ifarch %tsan_arch
885 %if %{biarch}
886 rm -f $RPM_BUILD_ROOT%{versmainlibdirbi}/libtsan.so
887 %endif
888 %endif
889 %if %{build_cp}
890 %if !0%{?building_libjava:1}
891 # And we want to move the shlib gdb pretty printers to a more sane
892 # place so ldconfig does not complain
893 mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}
894 mv $RPM_BUILD_ROOT%{mainlibdir}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/
895 sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdir}/libstdc++.so.*-gdb.py
896 %if %{biarch}
897   if test -d $RPM_BUILD_ROOT%{versmainlibdirbi}; then
898     mkdir -p $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}
899     mv $RPM_BUILD_ROOT%{mainlibdirbi}/libstdc++.so.*-gdb.py $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/
900     sed -i -e '/^libdir/s/\/gcc\/%{GCCDIST}\/%{gcc_dir_version}//g' $RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{mainlibdirbi}/libstdc++.so.*-gdb.py
901   fi
902 %endif
903 %endif
904 %endif
905 %if 0%{?building_libjava:1}
906 # libgcj_bc is special as the .so file is actually a different
907 # library as the library refered to by the SONAME which should
908 # be a simple link to our libgcj.
909 for lib in `find $RPM_BUILD_ROOT%{versmainlibdir} -maxdepth 1 -name libgcj_bc.so.*`; do
910   rm $lib
911 done
912 ln -s libgcj.so.%{libgcj_sover} $RPM_BUILD_ROOT%{mainlibdir}/libgcj_bc.so.%{libgcj_bc_sover}
913 %if %{biarch_libjava}
914 for lib in `find $RPM_BUILD_ROOT%{versmainlibdirbi} -maxdepth 1 -name libgcj_bc.so.*`; do
915   rm $lib
916 done
917 ln -s libgcj.so.%{libgcj_sover} $RPM_BUILD_ROOT%{mainlibdirbi}/libgcj_bc.so.%{libgcj_bc_sover}
918 %endif
919 %endif
920
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 %if 0%{?run_tests:1} 
958 cp `find . -name "*.sum"` ../testresults/
959 cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
960 chmod 644 ../testresults/*
961 %endif
962 %if %{build_cp}
963 # Find C++ and Java headers
964 find $RPM_BUILD_ROOT%{_prefix}/include/c++ \
965   -regex ".*/\(org\|gcj\|gnu\|java\|javax\)" -prune \
966   -o \( -type d -printf "%%%%dir " , \
967         -printf "%{_prefix}/include/c++/%%P\n" \) > ../c++-headers
968 %endif
969 # Remove files that we do not need to clean up filelist
970 rm -f $RPM_BUILD_ROOT%{_prefix}/bin/%{GCCDIST}-*
971 rm -rf $RPM_BUILD_ROOT%{libsubdir}/install-tools
972 #rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
973 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/root
974 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/curses.h
975 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/asm-*
976 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/linux
977 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sound
978 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/features.h
979 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/ncurses.h
980 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/stdio.h
981 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/zutil.h
982 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/X11
983 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
984 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/obstack.h
985 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/spe.h
986 rm -f $RPM_BUILD_ROOT%{libsubdir}/include-fixed/tgmath.h
987 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/bits
988 rm -rf $RPM_BUILD_ROOT%{libsubdir}/include-fixed/sys
989 # no plugins
990 rm -rf $RPM_BUILD_ROOT%{libsubdir}/plugin
991 rm -f  $RPM_BUILD_ROOT%{_infodir}/dir
992 rm -f  $RPM_BUILD_ROOT%{_prefix}/bin/gccbug%{binsuffix}
993
994 %if !0%{?building_libjava:1}%{?building_libffi:1}
995 # delete compile flag tracking from crt files
996 crt_list=$RPM_BUILD_ROOT%{versmainlibdir}/crt*.o
997 %if %{biarch}
998 %if %{build_primary_64bit}
999 crt32_list=$RPM_BUILD_ROOT%{versmainlibdirbi32}/crt*.o
1000 %else
1001 crt64_list=$RPM_BUILD_ROOT%{versmainlibdirbi64}/crt*.o
1002 %endif
1003 %endif
1004 for o in $crt_list $crt32_list $crt64_list; do
1005   objcopy -R ".comment.SUSE.OPTs" $o
1006 done
1007 %endif
1008
1009 %if 0%{?building_libjava:1}
1010 # gcj -static doesn't work properly anyway, unless using --whole-archive
1011 # let's save the space instead.
1012 find $RPM_BUILD_ROOT -name libgcj.a \
1013         -o -name libgcj-tools.a \
1014         -o -name libgij.a \
1015         -o -name libjvm.a \
1016         -o -name libgcj_bc.a \
1017   | xargs rm -f
1018
1019 find $RPM_BUILD_ROOT -name libgcj.spec | xargs \
1020   sed -i -e 's/lib: /&%%{static:%%eJava programs cannot be linked statically}/'
1021
1022 # security files have broken install locations, also they cause conflicts
1023 # between libgcj versions.  Simply delete them here, libgcj will use its
1024 # defaults in this case (which is what these files contain anyway).
1025 rm $RPM_BUILD_ROOT%{_libdir}/logging.properties
1026 rm -r $RPM_BUILD_ROOT%{_libdir}/security
1027 %endif
1028
1029 %if 0%{?building_libffi:1}
1030 # Move libffi headers, remove empty libffi libtool file
1031 mkdir -p $RPM_BUILD_ROOT%{_prefix}/include
1032 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffitarget.h $RPM_BUILD_ROOT%{_prefix}/include/
1033 mv $RPM_BUILD_ROOT%{libsubdir}/include/ffi.h $RPM_BUILD_ROOT%{_prefix}/include/
1034 rm -f $RPM_BUILD_ROOT%{mainlibdir}/libffi.la
1035 %if %{biarch}
1036 rm -f $RPM_BUILD_ROOT%{mainlibdirbi}/libffi.la
1037 %endif
1038 # Generate a simple pkg-config file
1039 mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig
1040 echo -e 'Name: libffi\nVersion: 3.0.9\nDescription: libffi\nLibs: -lffi' > $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libffi.pc
1041 %endif
1042
1043 %if %{build_java}
1044 %if !%{build_libjava}
1045 rm $RPM_BUILD_ROOT%{_mandir}/man1/jv-convert%{binsuffix}.1
1046 rm $RPM_BUILD_ROOT%{_mandir}/man1/gcj-dbtool%{binsuffix}.1
1047 rm $RPM_BUILD_ROOT%{_mandir}/man1/gij%{binsuffix}.1
1048 rm $RPM_BUILD_ROOT%{_mandir}/man1/grmic%{binsuffix}.1
1049 rm $RPM_BUILD_ROOT%{_mandir}/man1/gc-analyze%{binsuffix}.1
1050 rm $RPM_BUILD_ROOT%{_mandir}/man1/aot-compile%{binsuffix}.1
1051 rm $RPM_BUILD_ROOT%{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1
1052 %endif
1053 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/aotcompile.py
1054 rm -f $RPM_BUILD_ROOT%{_datadir}/gcc%{binsuffix}/python/libjava/classfile.py
1055 %endif
1056 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/fsf-funding.7
1057 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gfdl.7
1058 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/gpl.7
1059 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
1060 %if %{biarch}
1061 %if %{build_primary_64bit}
1062 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/libiberty.a
1063 %else
1064 rm -f $RPM_BUILD_ROOT%{_prefix}/lib64/libiberty.a
1065 %endif
1066 %endif
1067 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.a
1068 rm -f $RPM_BUILD_ROOT%{libsubdir}/liblto_plugin.la
1069
1070 %if 0%{?building_libjava:1}
1071 # For building libjava only we need to delete other info docs
1072 rm $RPM_BUILD_ROOT%{_infodir}/cp-tools.info*
1073 # Remove stale manpages for binaries we do not build
1074 rm $RPM_BUILD_ROOT%{_mandir}/man1/gjdoc%{binsuffix}.1
1075 # For building the java frontend we need to copy the ecj jar
1076 mkdir -p $RPM_BUILD_ROOT%{libsubdir}
1077 cp $RPM_SOURCE_DIR/ecj.jar $RPM_BUILD_ROOT%{libsubdir}
1078 %else
1079 # For regular build, some info files do not get renamed properly.
1080 # Do so here.
1081 mv $RPM_BUILD_ROOT%{_infodir}/libgomp.info $RPM_BUILD_ROOT%{_infodir}/libgomp%{binsuffix}.info
1082 %ifarch %itm_arch
1083 mv $RPM_BUILD_ROOT%{_infodir}/libitm.info $RPM_BUILD_ROOT%{_infodir}/libitm%{binsuffix}.info
1084 %endif
1085 %if %{build_fortran} 
1086 %ifarch %quadmath_arch
1087 mv $RPM_BUILD_ROOT%{_infodir}/libquadmath.info $RPM_BUILD_ROOT%{_infodir}/libquadmath%{binsuffix}.info
1088 %endif
1089 %endif
1090 %if %{build_ada}
1091 mv $RPM_BUILD_ROOT%{_infodir}/gnat-style.info $RPM_BUILD_ROOT%{_infodir}/gnat-style%{binsuffix}.info
1092 mv $RPM_BUILD_ROOT%{_infodir}/gnat_rm.info $RPM_BUILD_ROOT%{_infodir}/gnat_rm%{binsuffix}.info
1093 mv $RPM_BUILD_ROOT%{_infodir}/gnat_ugn.info $RPM_BUILD_ROOT%{_infodir}/gnat_ugn%{binsuffix}.info
1094 %endif
1095 %endif
1096
1097
1098
1099 %if %{build_java}
1100 %if 0%{?building_libjava:1}
1101 %files -n gcc48-java
1102 %defattr(-,root,root)
1103 %{_prefix}/bin/gcj%{binsuffix}
1104 %{_prefix}/bin/gcjh%{binsuffix}
1105 %{_prefix}/bin/gcj-dbtool%{binsuffix}
1106 %{_prefix}/bin/jcf-dump%{binsuffix}
1107 %{_prefix}/bin/jv-convert%{binsuffix}
1108 %{_prefix}/bin/gc-analyze%{binsuffix}
1109 %{_prefix}/bin/aot-compile%{binsuffix}
1110 %{_prefix}/bin/rebuild-gcj-db%{binsuffix}
1111 %{libsubdir}/jc1
1112 %{libsubdir}/jvgenmain
1113 %{libsubdir}/ecj.jar
1114 %{libsubdir}/ecj1
1115 %doc %{_mandir}/man1/gcj%{binsuffix}.1.gz
1116 %doc %{_mandir}/man1/gcjh%{binsuffix}.1.gz
1117 %doc %{_mandir}/man1/gcj-dbtool%{binsuffix}.1.gz
1118 %doc %{_mandir}/man1/jcf-dump%{binsuffix}.1.gz
1119 %doc %{_mandir}/man1/jv-convert%{binsuffix}.1.gz
1120 %doc %{_mandir}/man1/gc-analyze%{binsuffix}.1.gz
1121 %doc %{_mandir}/man1/aot-compile%{binsuffix}.1.gz
1122 %doc %{_mandir}/man1/rebuild-gcj-db%{binsuffix}.1.gz
1123 %endif
1124 %endif
1125
1126 %if %{build_java}
1127 %if %{build_libjava}
1128 %files 
1129 %defattr(-,root,root)
1130 %dir %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}
1131 %dir %{_libdir}/gcc
1132 %dir %{_libdir}/gcc/%{GCCDIST}
1133 %dir %{libsubdir}
1134 %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/classmap.db
1135 # We usually do not multilib libjava
1136 %if %{biarch_libjava}
1137 %versbiarchlib libgcj.la
1138 %biarchlib libgcj.so.*
1139 %biarchlib libgij.so.*
1140 %biarchlib libgcj-tools.so.*
1141 %else
1142 %versmainlib libgcj.la
1143 %mainlib libgcj.so.*
1144 %mainlib libgij.so.*
1145 %mainlib libgcj-tools.so.*
1146 %endif
1147 %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjvm.la
1148 %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjvm.so
1149 %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjavamath.la
1150 %{_libdir}/gcj-%{gcc_dir_version}-%{libgcj_sover}/libjavamath.so
1151
1152 %files -n libgcj_bc%{libgcj_bc_sover}%{libgcj_bc_suffix}
1153 %defattr(-,root,root)
1154 %if %{biarch_libjava}
1155 %biarchlib libgcj_bc.so.%{libgcj_bc_sover}*
1156 %else
1157 %mainlib libgcj_bc.so.%{libgcj_bc_sover}*
1158 %endif
1159
1160 %files -n libgcj48-jar
1161 %defattr(-,root,root)
1162 %{_prefix}/share/java/libgcj-%{gcc_dir_version}.jar
1163 %{_prefix}/share/java/libgcj-tools-%{gcc_dir_version}.jar
1164
1165 %files -n libgcj48-devel
1166 %defattr(-,root,root)
1167 %dir %{_prefix}/include/c++
1168 %dir %{libsubdir}
1169 %dir %{libsubdir}/include
1170 %dir %{gxxinclude}
1171 %{_libdir}/pkgconfig/libgcj%{binsuffix}.pc
1172 %{libsubdir}/include/jawt.h
1173 %{libsubdir}/include/jawt_md.h
1174 %{libsubdir}/include/jni.h
1175 %{libsubdir}/include/jni_md.h
1176 %{libsubdir}/include/jvmpi.h
1177 %{gxxinclude}/gnu
1178 %{gxxinclude}/gcj
1179 %{gxxinclude}/java
1180 %{gxxinclude}/javax
1181 %{gxxinclude}/org
1182 %{gxxinclude}/sun
1183 %{libsubdir}/include/gcj
1184 %if %{biarch_libjava}
1185 %versbiarchlib libgcj.so
1186 %versbiarchlib libgcj.spec
1187 %versbiarchlib libgcj-tools.so
1188 %versbiarchlib libgij.so
1189 %versbiarchlib libgcj_bc.so
1190 %else
1191 %versmainlib libgcj.so
1192 %versmainlib libgcj.spec
1193 %versmainlib libgcj-tools.so
1194 %versmainlib libgij.so
1195 %versmainlib libgcj_bc.so
1196 %endif
1197
1198 %files -n gcc48-gij
1199 %defattr(-,root,root)
1200 %{_prefix}/bin/gij%{binsuffix}
1201 %{_prefix}/bin/gappletviewer%{binsuffix}
1202 %{_prefix}/bin/gjar%{binsuffix}
1203 %{_prefix}/bin/gjarsigner%{binsuffix}
1204 %{_prefix}/bin/gjavah%{binsuffix}
1205 %{_prefix}/bin/gkeytool%{binsuffix}
1206 %{_prefix}/bin/gnative2ascii%{binsuffix}
1207 %{_prefix}/bin/gorbd%{binsuffix}
1208 %{_prefix}/bin/grmic%{binsuffix}
1209 %{_prefix}/bin/grmid%{binsuffix}
1210 %{_prefix}/bin/grmiregistry%{binsuffix}
1211 %{_prefix}/bin/gserialver%{binsuffix}
1212 %{_prefix}/bin/gtnameserv%{binsuffix}
1213 %doc %{_mandir}/man1/gij%{binsuffix}.1.gz
1214 %doc %{_mandir}/man1/gappletviewer%{binsuffix}.1.gz
1215 %doc %{_mandir}/man1/grmic%{binsuffix}.1.gz
1216 %doc %{_mandir}/man1/grmid%{binsuffix}.1.gz
1217 %doc %{_mandir}/man1/grmiregistry%{binsuffix}.1.gz
1218 %doc %{_mandir}/man1/gkeytool%{binsuffix}.1.gz
1219 %doc %{_mandir}/man1/gjar%{binsuffix}.1.gz
1220 %doc %{_mandir}/man1/gjarsigner%{binsuffix}.1.gz
1221 %doc %{_mandir}/man1/gjavah%{binsuffix}.1.gz
1222 %doc %{_mandir}/man1/gnative2ascii%{binsuffix}.1.gz
1223 %doc %{_mandir}/man1/gorbd%{binsuffix}.1.gz
1224 %doc %{_mandir}/man1/gserialver%{binsuffix}.1.gz
1225 %doc %{_mandir}/man1/gtnameserv%{binsuffix}.1.gz
1226 %endif
1227 %endif
1228
1229 %if %{build_java}
1230 %if 0%{?building_libffi:1}
1231 %files -n libffi%{libffi_sover}%{libffi_suffix}
1232 %defattr(-,root,root)
1233 %mainlib libffi.so.%{libffi_sover}*
1234
1235 %if %{separate_biarch}
1236 %files -n libffi%{libffi_sover}%{libffi_suffix}%{separate_biarch_suffix}
1237 %defattr(-,root,root)
1238 %biarchlib libffi.so.%{libffi_sover}*
1239 %endif
1240
1241 %post -n libffi48-devel
1242 %install_info --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1243 %postun -n libffi48-devel
1244 %install_info_delete --info-dir=%{_infodir} %{_infodir}/libffi%{binsuffix}.info.gz
1245
1246 %files -n libffi48-devel
1247 %defattr(-,root,root)
1248 %{_prefix}/include/ffi.h
1249 %{_prefix}/include/ffitarget.h
1250 %mainlib libffi.so
1251 %mainlib libffi.a
1252 %{_libdir}/pkgconfig/libffi.pc
1253 %doc %{_infodir}/libffi%{binsuffix}.info.gz
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 %doc %{_mandir}/man3/ffi_prep_cif_var%{binsuffix}.3.gz
1258
1259 %if %{separate_biarch}
1260 %files -n libffi48-devel%{separate_biarch_suffix}
1261 %defattr(-,root,root)
1262 %biarchlib libffi.so
1263 %biarchlib libffi.a
1264 %endif
1265 %endif
1266 %endif
1267
1268 %if 0%{?run_tests:1}
1269 %files -n gcc48-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