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