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

Last change on this file since 081f8ff was f07504d, checked in by Sebastian Huber <sebastian.huber@…>, on 01/23/19 at 12:41:30

Use HTTPS instead of FTP

FTP is an outdated protocol and blocked by some firewalls.

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