source: rtems/contrib/crossrpms/netbsd5.0.1/i386/i386-pc-netbsdelf5.0.1-gcc.spec @ e2b68fc

4.104.11
Last change on this file since e2b68fc was e2b68fc, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 17, 2010 at 5:29:35 AM

Regenerate *.spec.

  • Property mode set to 100644
File size: 12.8 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6
7%ifos cygwin cygwin32 mingw mingw32
8%define _exeext .exe
9%define debug_package           %{nil}
10%define _libdir                 %{_exec_prefix}/lib
11%else
12%define _exeext %{nil}
13%endif
14
15%ifos cygwin cygwin32
16%define optflags -O3 -pipe -march=i486 -funroll-loops
17%endif
18
19%ifos mingw mingw32
20%if %{defined _mingw32_cflags}
21%define optflags %{_mingw32_cflags}
22%else
23%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
24%endif
25%endif
26
27%if "%{_build}" != "%{_host}"
28%define _host_rpmprefix %{_host}-
29%else
30%define _host_rpmprefix %{nil}
31%endif
32
33
34%define gcc_pkgvers 4.3.4
35%define gcc_version 4.3.4
36%define gcc_rpmvers %{expand:%(echo "4.3.4" | tr - _ )}
37
38
39Name:           i386-pc-netbsdelf5.0.1-gcc
40Summary:        i386-pc-netbsdelf5.0.1 gcc
41
42Group:          Development/Tools
43Version:        %{gcc_rpmvers}
44Release:        0.20100317.1%{?dist}
45License:        GPL
46URL:            http://gcc.gnu.org
47BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
48
49%define _use_internal_dependency_generator 0
50
51BuildRequires:  %{_host_rpmprefix}gcc
52
53%if "%{gcc_version}" >= "4.3.0"
54%define _gmp_minvers            4.1
55%else
56%if "%{gcc_version}" >= "4.2.0"
57%endif
58%endif
59
60%if %{defined _gmp_minvers}
61BuildRequires: gmp-devel >= %{_gmp_minvers}
62%if "%{_build}" != "%{_host}"
63BuildRequires:  %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers}
64%endif
65%endif
66
67%if "%{gcc_version}" >= "4.3.3"
68%define _cloog_minvers 0.15
69%endif
70
71%if %{defined _cloog_minvers}
72%{?fc11:BuildRequires: cloog-ppl-devel >= %_cloog_minvers}
73%{?fc12:BuildRequires: cloog-ppl-devel >= %_cloog_minvers}
74%{?fc13:BuildRequires: cloog-ppl-devel >= %_cloog_minvers}
75%{?suse11_2:BuildRequires: cloog-devel >= %_cloog_minvers, ppl-devel}
76%{?suse11_1:BuildRequires: cloog-devel >= %_cloog_minvers, ppl-devel}
77%endif
78
79%if "%{gcc_version}" >= "4.4.0"
80%define _mpfr_minvers   2.3.2
81%define mpfr_version    2.4.1
82%else
83%if "%{gcc_version}" >= "4.3.0"
84%define _mpfr_minvers   2.3.1
85%define mpfr_version    2.3.2
86%else
87%if "%{gcc_version}" >= "4.2.0"
88%endif
89%endif
90%endif
91
92%if %{defined _mpfr_minvers}
93# FIXME: This is an ugly cludge
94%{?fc11:%global mpfr_provided 2.4.1}
95%{?fc12:%global mpfr_provided 2.4.1}
96%{?fc13:%global mpfr_provided 2.4.1}
97%{?suse11_0:%global mpfr_provided 2.3.1}
98%{?suse11_1:%global mpfr_provided 2.3.2}
99%{?suse11_2:%global mpfr_provided 2.4.1}
100%{?cygwin:%global mpfr_provided 2.4.1}
101%{?mingw32:%global mpfr_provided %{nil}}
102
103%if %{defined mpfr_provided}
104%if "%{mpfr_provided}" < "%{_mpfr_minvers}"
105%define _build_mpfr 1
106%else
107%if "%{_build}" != "%{_host}"
108BuildRequires:  %{_host_rpmprefix}mpfr-devel >= %{_mpfr_minvers}
109%else
110BuildRequires: mpfr-devel >= %{_mpfr_minvers}
111%endif
112%endif
113%else
114%define _build_mpfr 1
115%endif
116
117%endif
118
119%if "%{_build}" != "%{_host}"
120BuildRequires:  i386-pc-netbsdelf5.0.1-gcc = %{gcc_rpmvers}
121%endif
122
123%if "%{gcc_version}" >= "4.2.0"
124BuildRequires:  flex bison
125%endif
126
127
128BuildRequires:  texinfo >= 4.2
129BuildRequires:  i386-pc-netbsdelf5.0.1-binutils
130BuildRequires:  i386-pc-netbsdelf5.0.1-sys-root
131
132Requires:       i386-pc-netbsdelf5.0.1-binutils
133Requires:       i386-pc-netbsdelf5.0.1-sys-root
134Requires:       i386-pc-netbsdelf5.0.1-gcc-libgcc = %{gcc_rpmvers}-%{release}
135
136
137%define _gcclibdir %{_prefix}/lib
138
139Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
140%{?_without_sources:NoSource:   0}
141
142
143%if "%{gcc_version}" >= "4.3.0"
144Source60:    http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2
145%endif
146
147%description
148Cross gcc for i386-pc-netbsdelf5.0.1.
149
150%prep
151%setup -c -T -n %{name}-%{version}
152
153%setup -q -T -D -n %{name}-%{version} -a0
154%{?PATCH0:%patch0 -p0}
155
156
157
158
159
160
161
162%if 0%{?_build_mpfr}
163%setup -q -T -D -n %{name}-%{version} -a60
164%{?PATCH60:%patch60 -p1}
165  # Build mpfr one-tree style
166  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
167%endif
168
169
170  # Fix timestamps
171  cd gcc-%{gcc_pkgvers}
172  contrib/gcc_update --touch
173  cd ..
174%build
175  mkdir -p build
176
177  cd build
178
179  languages="c"
180%if "%{_build}" != "%{_host}"
181  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
182  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
183%else
184# gcc is not ready to be compiled with -std=gnu99
185  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
186%endif
187  ../gcc-%{gcc_pkgvers}/configure \
188    --prefix=%{_prefix} \
189    --bindir=%{_bindir} \
190    --exec_prefix=%{_exec_prefix} \
191    --includedir=%{_includedir} \
192    --libdir=%{_gcclibdir} \
193    --libexecdir=%{_libexecdir} \
194    --mandir=%{_mandir} \
195    --infodir=%{_infodir} \
196    --datadir=%{_datadir} \
197    --build=%_build --host=%_host \
198    --target=i386-pc-netbsdelf5.0.1 \
199    --disable-libstdcxx-pch \
200    --with-gnu-as --with-gnu-ld --verbose \
201    --with-system-zlib \
202    --disable-nls --without-included-gettext \
203    --disable-win32-registry \
204    --enable-version-specific-runtime-libs \
205    --enable-threads \
206    --with-sysroot=%{_exec_prefix}/i386-pc-netbsdelf5.0.1/sys-root \
207    --enable-languages="$languages" $optargs
208
209%if "%_host" != "%_build"
210  # Bug in gcc-3.2.1:
211  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
212  mkdir -p gcc/include
213  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
214%endif
215
216  make %{?_smp_mflags} all
217  cd ..
218
219%install
220  rm -rf $RPM_BUILD_ROOT
221
222  cd build
223
224  make DESTDIR=$RPM_BUILD_ROOT install
225  cd ..
226
227
228%if "%{gcc_version}" <= "4.1.2"
229# Misplaced header file
230  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
231    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
232      $RPM_BUILD_ROOT%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include/
233  fi
234%endif
235
236  # host library
237%if "%{gcc_version}" >= "4.2.0"
238  # libiberty doesn't honor --libdir, but always installs to a
239  # magically guessed _libdir
240  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
241%else
242  # libiberty installs to --libdir=...
243  rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a
244%endif
245
246  # We use the version from binutils
247  rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.0.1-c++filt%{_exeext}
248
249
250# Conflict with a native GCC's infos
251  rm -rf $RPM_BUILD_ROOT%{_infodir}
252
253# Conflict with a native GCC's man pages
254  rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
255
256  # Bug in gcc-3.4.0pre
257  rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.0.1-i386-pc-netbsdelf5.0.1-gcjh%{_exeext}
258
259  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
260  # the fixinclude-install-tools
261  rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/install-tools
262  rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/install-tools
263
264  # Bug in gcc > 4.1.0: Installs an unused, empty directory
265  if test -d ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.0.1/include/bits; then
266    rmdir ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.0.1/include/bits
267  fi
268
269  # Collect multilib subdirectories
270  multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
271
272
273  rm -f dirs ;
274  echo "%defattr(-,root,root,-)" >> dirs
275  TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}"
276  for i in $multilibs; do
277    case $i in
278    \.) ;; # ignore, handled elsewhere
279    *)  echo "%dir ${TGTDIR}/$i" >> dirs
280      ;;
281    esac
282  done
283
284  # Collect files to go into different packages
285  cp dirs build/files.gcc
286  cp dirs build/files.gfortran
287  cp dirs build/files.objc
288  cp dirs build/files.gcj
289  cp dirs build/files.g++
290
291  TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}"
292  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
293  for i in $f; do
294    case $i in
295    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
296    *f771) ;;
297    *f951) ;;
298    *cc1) ;;
299    *cc1obj) ;;
300    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
301    *collect2) ;;
302    *libobjc*) echo "$i" >> build/files.objc ;;
303    *include/objc*) ;;
304    *include/g++*);;
305    *include/c++*);;
306    *include-fixed/*);;
307    *finclude/*);;
308    *adainclude*);;
309    *adalib*);;
310    *gnat1);;
311    *jc1) ;;
312    *jvgenmain) ;;
313    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
314    */libstdc++.*) echo "$i" >> build/files.g++ ;;
315    */libsupc++.*) echo "$i" >> build/files.g++ ;;
316    *) echo "$i" >> build/files.gcc ;;
317    esac
318  done
319
320  TGTDIR="%{_exec_prefix}/i386-pc-netbsdelf5.0.1/lib"
321  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
322  for i in $f; do
323    case $i in
324    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
325    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
326# all other files belong to newlib
327    *) echo "$i" >> build/files.newlib ;;
328    esac
329  done
330# Extract %%__os_install_post into os_install_post~
331cat << \EOF > os_install_post~
332%__os_install_post
333EOF
334
335# Generate customized brp-*scripts
336cat os_install_post~ | while read a x y; do
337case $a in
338# Prevent brp-strip* from trying to handle foreign binaries
339*/brp-strip*)
340  b=$(basename $a)
341  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
342  chmod a+x $b
343  ;;
344esac
345done
346
347sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
348< os_install_post~ > os_install_post
349%define __os_install_post . ./os_install_post
350
351
352cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
353#!/bin/sh
354grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.1/(lib|include|sys-root)' \
355  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/'} | %__find_provides
356EOF
357chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
358%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
359
360cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
361#!/bin/sh
362grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.1/(lib|include|sys-root)' \
363  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/'} | %__find_requires
364EOF
365chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
366%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
367
368%ifnarch noarch
369# Extract %%__debug_install_post into debug_install_post~
370cat << \EOF > debug_install_post~
371%__debug_install_post
372EOF
373
374# Generate customized debug_install_post script
375cat debug_install_post~ | while read a x y; do
376case $a in
377# Prevent find-debuginfo.sh* from trying to handle foreign binaries
378*/find-debuginfo.sh)
379  b=$(basename $a)
380  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
381  chmod a+x $b
382  ;;
383esac
384done
385
386sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
387< debug_install_post~ > debug_install_post
388%define __debug_install_post . ./debug_install_post
389
390%endif
391
392%clean
393  rm -rf $RPM_BUILD_ROOT
394
395# ==============================================================
396# i386-pc-netbsdelf5.0.1-gcc
397# ==============================================================
398# %package -n i386-pc-netbsdelf5.0.1-gcc
399# Summary:        GNU cc compiler for i386-pc-netbsdelf5.0.1
400# Group:          Development/Tools
401# Version:        %{gcc_rpmvers}
402# Requires:       i386-pc-netbsdelf5.0.1-binutils
403# License:      GPL
404
405# %if %build_infos
406# Requires:      gcc-common
407# %endif
408
409%description -n i386-pc-netbsdelf5.0.1-gcc
410GNU cc compiler for i386-pc-netbsdelf5.0.1.
411
412# ==============================================================
413# i386-pc-netbsdelf5.0.1-gcc-libgcc
414# ==============================================================
415%package -n i386-pc-netbsdelf5.0.1-gcc-libgcc
416Summary:        libgcc for i386-pc-netbsdelf5.0.1-gcc
417Group:          Development/Tools
418Version:        %{gcc_rpmvers}
419%{?_with_noarch_subpackages:BuildArch: noarch}
420License:        GPL
421
422%description -n i386-pc-netbsdelf5.0.1-gcc-libgcc
423libgcc i386-pc-netbsdelf5.0.1-gcc.
424
425
426%files -n i386-pc-netbsdelf5.0.1-gcc
427%defattr(-,root,root)
428
429%{_mandir}/man1/i386-pc-netbsdelf5.0.1-gcc.1*
430%{_mandir}/man1/i386-pc-netbsdelf5.0.1-cpp.1*
431%{_mandir}/man1/i386-pc-netbsdelf5.0.1-gcov.1*
432
433%{_bindir}/i386-pc-netbsdelf5.0.1-cpp%{_exeext}
434%{_bindir}/i386-pc-netbsdelf5.0.1-gcc%{_exeext}
435%{_bindir}/i386-pc-netbsdelf5.0.1-gcc-%{gcc_version}%{_exeext}
436%{_bindir}/i386-pc-netbsdelf5.0.1-gcov%{_exeext}
437%{_bindir}/i386-pc-netbsdelf5.0.1-gccbug
438
439%dir %{_libexecdir}/gcc
440%dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1
441%dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}
442%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/cc1%{_exeext}
443%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/collect2%{_exeext}
444
445
446%files -n i386-pc-netbsdelf5.0.1-gcc-libgcc -f build/files.gcc
447%defattr(-,root,root)
448%dir %{_gcclibdir}/gcc
449%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1
450%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}
451%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include
452
453%if "%{gcc_version}" > "4.0.3"
454%if "i386-pc-netbsdelf5.0.1" != "bfin-rtems4.10"
455%if "i386-pc-netbsdelf5.0.1" != "avr-rtems4.10"
456%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include/ssp
457%endif
458%endif
459%endif
460
461%if "%{gcc_version}" >= "4.3.0"
462%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include-fixed
463%endif
464
465
466
467
Note: See TracBrowser for help on using the repository browser.