source: rtems/contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec @ 49a5e79

4.104.115
Last change on this file since 49a5e79 was aab8725, checked in by Ralf Corsepius <ralf.corsepius@…>, on 03/10/09 at 10:56:03

Disable sim on mingw32.

  • Property mode set to 100644
File size: 6.1 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.10
7%define _exec_prefix            %{_prefix}
8%define _bindir                 %{_exec_prefix}/bin
9%define _sbindir                %{_exec_prefix}/sbin
10%define _libexecdir             %{_exec_prefix}/libexec
11%define _datarootdir            %{_prefix}/share
12%define _datadir                %{_datarootdir}
13%define _sysconfdir             %{_prefix}/etc
14%define _sharedstatedir         %{_prefix}/com
15%define _localstatedir          %{_prefix}/var
16%define _includedir             %{_prefix}/include
17%define _libdir                 %{_exec_prefix}/%{_lib}
18%define _mandir                 %{_datarootdir}/man
19%define _infodir                %{_datarootdir}/info
20%define _localedir              %{_datarootdir}/locale
21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
32%endif
33
34%ifos mingw mingw32
35%if %{defined _mingw32_cflags}
36%define optflags %{_mingw32_cflags}
37%else
38%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
39%endif
40%endif
41
42%if "%{_build}" != "%{_host}"
43%define _host_rpmprefix rtems-4.10-%{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.8.50.20090224
49%define gdb_rpmvers %{expand:%(echo 6.8.50.20090224 | tr - _)}
50
51Name:           rtems-4.10-m32c-rtems4.10-gdb
52Summary:        Gdb for target m32c-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        4%{?dist}
56License:        GPL/LGPL
57URL:            http://sources.redhat.com/gdb
58BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
59
60BuildRequires:  %{_host_rpmprefix}gcc
61
62%define build_sim --enable-sim
63%if "%{_build}" != "%{_host}"
64# psim doesn't support Cdn-X
65%if "m32c-rtems4.10" == "powerpc-rtems4.10"
66%define build_sim --disable-sim
67%endif
68%endif
69
70%ifos mingw mingw32
71# Mingw lacks functions required by the simulator
72%if "m32c-rtems4.10" == "sparc-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%if "m32c-rtems4.10" == "h8300-rtems4.10"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "m32c-rtems4.10" == "m32c-rtems4.10"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "m32c-rtems4.10" == "lm32-rtems4.10"
84%define build_sim --disable-sim
85%endif
86%if "m32c-rtems4.10" == "mipstx39-rtems4.10"
87%define build_sim --disable-sim
88%endif
89%endif
90
91%if "%{gdb_version}" >= "6.6"
92# suse
93%if "%{?suse}" >= "10.3"
94BuildRequires: libexpat-devel
95%else
96# Fedora/CentOS/Cygwin/MinGW
97BuildRequires: %{_host_rpmprefix}expat-devel
98%endif
99%endif
100
101%if "%{gdb_version}" < "6.7"
102%if "%{_build}" != "%{_host}"
103BuildRequires:  %{_host_rpmprefix}termcap-devel
104%endif
105%endif
106BuildRequires:  %{_host_rpmprefix}readline-devel
107BuildRequires:  %{_host_rpmprefix}ncurses-devel
108
109
110
111# A copy of a gdb development snapshot having been retrieved from
112# ftp://sources.redhat.com/pub/gdb/snapshots/gdb-%{gdb_version}.tar.bz2
113Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
114
115# rtems-4.10 patches
116# + lm32-sim/gdb http://sourceware.org/ml/gdb-patches/2008-12/msg00373.html
117# + misc small fixes to lm32-sim/gdb
118Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090225.diff
119
120%description
121GDB for target m32c-rtems4.10
122%prep
123%setup -q -c -T -n %{name}-%{version}
124
125%setup -q -D -T -n %{name}-%{version} -a0
126cd gdb-%{gdb_version}
127%{?PATCH0:%patch0 -p1}
128cd ..
129
130%if "%{gdb_version}" >= "6.7"
131# Force using a system-provided libreadline
132rm -f gdb-%{gdb_version}/readline/configure
133%endif
134%build
135  export PATH="%{_bindir}:${PATH}"
136  mkdir -p build
137  cd build
138%if "%{_build}" != "%{_host}"
139  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
140%endif
141  CFLAGS="$RPM_OPT_FLAGS" \
142  ../gdb-%{gdb_version}/configure \
143    --build=%_build --host=%_host \
144    --target=m32c-rtems4.10 \
145    --verbose --disable-nls \
146    --without-included-gettext \
147    --disable-win32-registry \
148    --disable-werror \
149    %{build_sim} \
150%if "%{gdb_version}" >= "6.7"
151    --with-system-readline \
152%endif
153%if "%{gdb_version}" >= "6.6"
154    --with-expat \
155%endif
156%if "%{gdb_version}" >= "6.8.50"
157    --without-python \
158%endif
159    --prefix=%{_prefix} --bindir=%{_bindir} \
160    --includedir=%{_includedir} --libdir=%{_libdir} \
161    --mandir=%{_mandir} --infodir=%{_infodir}
162
163  make %{?_smp_mflags} all
164  cd ..
165
166%install
167  export PATH="%{_bindir}:${PATH}"
168  rm -rf $RPM_BUILD_ROOT
169
170  cd build
171  make DESTDIR=$RPM_BUILD_ROOT install
172
173# Conflict with a native gdb's infos
174  rm -rf $RPM_BUILD_ROOT%{_infodir}
175
176# We don't ship host files
177  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
178
179# host library, installed to a bogus directory
180  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libm32c-rtems4.10-sim.a
181
182  cd ..
183
184# Extract %%__os_install_post into os_install_post~
185cat << \EOF > os_install_post~
186%__os_install_post
187EOF
188
189# Generate customized brp-*scripts
190cat os_install_post~ | while read a x y; do
191case $a in
192# Prevent brp-strip* from trying to handle foreign binaries
193*/brp-strip*)
194  b=$(basename $a)
195  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
196  chmod a+x $b
197  ;;
198# Fix up brp-compress to handle %%_prefix != /usr
199*/brp-compress*)
200  b=$(basename $a)
201  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
202  chmod a+x $b
203  ;;
204esac
205done
206
207sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
208  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
209< os_install_post~ > os_install_post
210%define __os_install_post . ./os_install_post
211
212%clean
213  rm -rf $RPM_BUILD_ROOT
214
215# ==============================================================
216# m32c-rtems4.10-gdb
217# ==============================================================
218# %package -n rtems-4.10-m32c-rtems4.10-gdb
219# Summary:      rtems gdb for m32c-rtems4.10
220# Group: Development/Tools
221# %if %build_infos
222# Requires: rtems-4.10-gdb-common
223# %endif
224
225%description -n rtems-4.10-m32c-rtems4.10-gdb
226GNU gdb targetting m32c-rtems4.10.
227
228%files -n rtems-4.10-m32c-rtems4.10-gdb
229%defattr(-,root,root)
230%dir %{_mandir}
231%dir %{_mandir}/man1
232%{_mandir}/man1/m32c-rtems4.10-*.1*
233
234%dir %{_bindir}
235%{_bindir}/m32c-rtems4.10-*
236
Note: See TracBrowser for help on using the repository browser.