source: rtems/contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec @ d7467d4

4.104.115
Last change on this file since d7467d4 was 757e5de0, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/05/09 at 05:10:06

Activate python.

  • Property mode set to 100644
File size: 6.2 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 %{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48%define gdb_version 6.5
49%define gdb_rpmvers %{expand:%(echo 6.5 | tr - _)}
50
51Name:           rtems-4.10-bfin-rtems4.10-gdb
52Summary:        Gdb for target bfin-rtems4.10
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        9%{?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 "bfin-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 "bfin-rtems4.10" == "sparc-rtems4.10"
73%define build_sim --disable-sim
74%endif
75%if "bfin-rtems4.10" == "h8300-rtems4.10"
76%define build_sim --disable-sim
77%endif
78%if "%{gdb_version}" >= "6.8.50"
79%if "bfin-rtems4.10" == "m32c-rtems4.10"
80%define build_sim --disable-sim
81%endif
82%endif
83%if "bfin-rtems4.10" == "lm32-rtems4.10"
84%define build_sim --disable-sim
85%endif
86%if "bfin-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%if "%{gdb_version}" >= "6.8.50"
110%if "%{_build}" != "%{_host}"
111# Can't build python Cdn-X
112%bcond_with python
113%else
114%bcond_without python
115%endif
116%endif
117%{?with_python:BuildRequires: %{_host_rpmprefix}python-devel}
118
119
120
121Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2
122%{?_without_sources:NoSource:   0}
123Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-6.5-bfinrtems-20090122.diff
124
125%description
126GDB for target bfin-rtems4.10
127%prep
128%setup -q -c -T -n %{name}-%{version}
129
130%setup -q -D -T -n %{name}-%{version} -a0
131cd gdb-%{gdb_version}
132%{?PATCH0:%patch0 -p1}
133cd ..
134
135%if "%{gdb_version}" >= "6.7"
136# Force using a system-provided libreadline
137rm -f gdb-%{gdb_version}/readline/configure
138%endif
139%build
140  export PATH="%{_bindir}:${PATH}"
141  mkdir -p build
142  cd build
143%if "%{_build}" != "%{_host}"
144  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
145%endif
146  CFLAGS="$RPM_OPT_FLAGS" \
147  ../gdb-%{gdb_version}/configure \
148    --build=%_build --host=%_host \
149    --target=bfin-rtems4.10 \
150    --verbose --disable-nls \
151    --without-included-gettext \
152    --disable-win32-registry \
153    --disable-werror \
154    %{build_sim} \
155%if "%{gdb_version}" >= "6.7"
156    --with-system-readline \
157%endif
158%if "%{gdb_version}" >= "6.6"
159    --with-expat \
160%endif
161%if "%{gdb_version}" >= "6.8.50"
162%if %{with python}
163    --with-python \
164%else
165    --without-python \
166%endif
167%endif
168    --prefix=%{_prefix} --bindir=%{_bindir} \
169    --includedir=%{_includedir} --libdir=%{_libdir} \
170    --mandir=%{_mandir} --infodir=%{_infodir}
171
172  make %{?_smp_mflags} all
173  cd ..
174
175%install
176  export PATH="%{_bindir}:${PATH}"
177  rm -rf $RPM_BUILD_ROOT
178
179  cd build
180  make DESTDIR=$RPM_BUILD_ROOT install
181
182# Conflict with a native gdb's infos
183  rm -rf $RPM_BUILD_ROOT%{_infodir}
184
185# We don't ship host files
186  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
187
188# host library, installed to a bogus directory
189  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.10-sim.a
190
191  cd ..
192
193# Extract %%__os_install_post into os_install_post~
194cat << \EOF > os_install_post~
195%__os_install_post
196EOF
197
198# Generate customized brp-*scripts
199cat os_install_post~ | while read a x y; do
200case $a in
201# Prevent brp-strip* from trying to handle foreign binaries
202*/brp-strip*)
203  b=$(basename $a)
204  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
205  chmod a+x $b
206  ;;
207# Fix up brp-compress to handle %%_prefix != /usr
208*/brp-compress*)
209  b=$(basename $a)
210  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
211  chmod a+x $b
212  ;;
213esac
214done
215
216sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
217  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
218< os_install_post~ > os_install_post
219%define __os_install_post . ./os_install_post
220
221%clean
222  rm -rf $RPM_BUILD_ROOT
223
224# ==============================================================
225# bfin-rtems4.10-gdb
226# ==============================================================
227# %package -n rtems-4.10-bfin-rtems4.10-gdb
228# Summary:      rtems gdb for bfin-rtems4.10
229# Group: Development/Tools
230# %if %build_infos
231# Requires: rtems-4.10-gdb-common
232# %endif
233
234%description -n rtems-4.10-bfin-rtems4.10-gdb
235GNU gdb targetting bfin-rtems4.10.
236
237%files -n rtems-4.10-bfin-rtems4.10-gdb
238%defattr(-,root,root)
239%dir %{_prefix}
240%dir %{_prefix}/share
241
242%dir %{_mandir}
243%dir %{_mandir}/man1
244%{_mandir}/man1/bfin-rtems4.10-*.1*
245
246%dir %{_bindir}
247%{_bindir}/bfin-rtems4.10-*
248
Note: See TracBrowser for help on using the repository browser.