source: rtems-source-builder/rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg @ 8ef0d73

5
Last change on this file since 8ef0d73 was d5a7951, checked in by Gedare Bloom <gedare@…>, on 03/03/15 at 18:00:15

Fix broken URLs to FTP site

  • Property mode set to 100644
File size: 4.7 KB
Line 
1#
2# RTEMS NIOS2 GCC 4.1., Newlib 1.19.0
3#
4# This configuration has special support for the NIOS2.
5#
6
7%disable select
8
9%include %{_configdir}/checks.cfg
10%include %{_configdir}/base.cfg
11
12%define gcc_version    4.1
13%define newlib_version 1.19.0
14%define newlib_cfg     normalc
15
16%define with_threads 1
17%define with_plugin  0
18%define enable_cxx   1
19
20#
21# The RTEMS 4.11 patches
22#
23%patch add gcc %{rtems_gcc_patches}/nios2/nios2-gcc-4.1-rtems-20110818.diff
24%patch add newlib %{rtems_newlib_patches}/nios2/nios2-newlib-1.19.0-rtems-20110720.diff
25
26Name:      %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release}
27Summary:   GCC v%{gcc_version} and Newlib v%{newlib_version} for target %{_target} on host %{_host}
28Version:   %{gcc_version}
29Release:   %{release}
30URL:       http://gcc.gnu.org/
31BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
32
33#
34# Supports Candian Cross (Cxc).
35#
36%define allow_cxc
37
38#
39# Source
40#
41#
42# GCC core and G++
43#
44%source set gcc http://ftp.rtems.org/pub/rtems/people/chrisj/nios/nios2-gcc-4.1.tar.bz2
45%hash   md5 nios2-gcc-4.1.tar.bz2 717e5a25fda68d96d09353bcfa149cff
46
47#
48# Newlib
49#
50%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
51%hash   md5 newlib-%{newlib_version}.tar.gz 0966e19f03217db9e9076894b47e6601
52
53#
54# The GCC library directory
55#
56%global _gcclibdir %{_prefix}/lib
57
58#
59# Prepare the source code.
60#
61%prep
62  # save the build top directory and cd back to it rather than
63  # using 'cd ..' because some shells change $PWD to a symlink's
64  # target location and 'cd ..' fails.
65  build_top=$(pwd)
66
67  # gcc
68  source_dir_gcc="gcc-%{gcc_version}"
69  %source setup gcc -q -b -n gcc-%{gcc_version}
70  %patch setup gcc -p1
71  cd ${build_top}
72
73  # newlib
74  source_dir_newlib="newlib-%{newlib_version}"
75  %source setup newlib -q -b -n newlib-%{newlib_version}
76  %patch setup newlib -p1
77  cd ${build_top}
78
79  # Link newlib into the gcc source tree
80  %{__rmfile} ${source_dir_gcc}/newlib
81  %{__ln_s} $PWD/${source_dir_newlib}/newlib ${source_dir_gcc}/newlib
82
83  echo "%{gcc_version_message}" > gcc-%{gcc_version}/gcc/DEV-PHASE
84
85  # Fix timestamps
86  cd ${source_dir_gcc}
87  contrib/gcc_update --touch
88  cd ${build_top}
89
90%build
91  %{build_directory}
92
93  mkdir -p ${build_dir}
94  cd ${build_dir}
95
96  languages="c"
97%if %{enable_cxx}
98  languages="$languages,c++"
99%endif
100
101  %{host_build_flags}
102
103  ../${source_dir_gcc}/configure \
104    --prefix=%{_prefix} \
105    --bindir=%{_bindir} \
106    --exec_prefix=%{_exec_prefix} \
107    --includedir=%{_includedir} \
108    --libdir=%{_gcclibdir} \
109    --libexecdir=%{_libexecdir} \
110    --mandir=%{_mandir} \
111    --infodir=%{_infodir} \
112    --datadir=%{_datadir} \
113    --build=%_build --host=%_host \
114    --target=%{_target} \
115    --disable-libstdcxx-pch \
116    --with-gnu-as --with-gnu-ld --verbose \
117    --with-newlib \
118    --with-system-zlib \
119    --disable-nls --without-included-gettext \
120    --disable-win32-registry \
121    --enable-version-specific-runtime-libs \
122    %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \
123    %{?with_threads:--enable-threads}%{!?with_threads:--disable-threads} \
124    %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \
125    %{?enable_obsolete:--enable-obsolete} \
126    --enable-languages="$languages"
127
128  if test "%_host" != "%_build" ; then
129    # Bug in gcc-3.2.1:
130    # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
131    mkdir -p gcc/include
132    cp ../${source_dir_gcc}/gcc/gsyslimits.h gcc/include/syslimits.h
133  fi
134
135  # jobs > 1 is broken with this version of gcc
136  %{__make} -w N2GNU_BUILD_NEWLIB="%{newlib_cfg}" all
137  cd ..
138
139%install
140  %{__rmdir} $SB_BUILD_ROOT
141
142  cd ${build_dir}
143
144  #
145  # Filter the doc stuff we do not want so it builds without error on
146  # hosts that do not have tex to pdf converters installed.
147  #
148  for m in $(find . -name Makefile)
149  do
150    mv $m $m.orig
151    echo "Doc filteirng $m.orig -> $m"
152    cat $m.orig | sed -e 's/ pdf / /g' \
153                      -e 's/ pdf$/ /g' \
154                      -e 's/ install-pdf / /g' \
155                      -e 's/ install-pdf$/ /g' \
156                      -e 's/ install-html / /g' \
157                      -e 's/ install-html$/ /g' \
158                      -e 's/ html / /g' \
159                      -e 's/ html$/ /g' > $m
160  done
161
162  %{__make} -w DESTDIR=$SB_BUILD_ROOT N2GNU_BUILD_NEWLIB="%{newlib_cfg}" install
163  cd ..
164
165  # libiberty doesn't honor --libdir, but always installs to a
166  # magically guessed _libdir
167  %{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty.a
168
169  # We use the version from binutils
170  %{__rmfile} $SB_BUILD_ROOT%{_bindir}/%{_target}-c++filt%{_exeext}
171
172  # We don't ship info/dir
173  %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
174
175  # Don't want libffi's man-pages
176  %{__rmfile} $SB_BUILD_ROOT%{_mandir}/man3/*ffi*
177
178  # Clean the symlinks away incase the source is a repo
179  %{__rmfile} ${source_dir_gcc}/newlib
Note: See TracBrowser for help on using the repository browser.