source: rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gdb.spec @ ac620ef

4.115
Last change on this file since ac620ef was ac620ef, checked in by Ralf Corsepius <ralf.corsepius@…>, on Sep 1, 2011 at 3:55:47 AM

Regenerate.

  • 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.11
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 7.3
49%define gdb_rpmvers %{expand:%(echo 7.3 | tr - _)}
50
51Name:           rtems-4.11-bfin-rtems4.11-gdb
52Summary:        Gdb for target bfin-rtems4.11
53Group:          Development/Tools
54Version:        %{gdb_rpmvers}
55Release:        1%{?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%global build_sim --enable-sim
63
64# Whether to build against system readline
65# Default: yes
66%bcond_without system_readline
67
68# Whether to build python support
69%if "%{_build}" != "%{_host}"
70# Can't build python Cdn-X
71%bcond_with python
72%else
73%bcond_without python
74%endif
75%{?with_python:BuildRequires: %{_host_rpmprefix}python-devel}
76
77
78# suse
79%if "%{?suse}" >= "10.3"
80BuildRequires: libexpat-devel
81%else
82# Fedora/CentOS/Cygwin/MinGW
83BuildRequires: %{_host_rpmprefix}expat-devel
84%endif
85
86%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
87BuildRequires:  %{_host_rpmprefix}ncurses-devel
88
89BuildRequires:  rtems-4.11-bfin-rtems4.11-binutils
90BuildRequires:  texinfo
91
92# The bfin simulator silently tries to conditionally build an SDL based GUI,
93# but fails to link correctly
94# Force not building the GUI.
95%{!?suse:BuildConflicts: SDL-devel}
96%{?suse:BuildConflicts: libSDL-devel}
97
98Source0:        ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}a.tar.bz2
99Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gdb-7.3-rtems4.11-20110831.diff
100
101%description
102GDB for target bfin-rtems4.11
103%prep
104%setup -q -c -T -n %{name}-%{version}
105
106%setup -q -D -T -n %{name}-%{version} -a0
107cd gdb-%{gdb_version}
108%{?PATCH0:%patch0 -p1}
109cd ..
110
111# Force using a system-provided libreadline
112%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
113%build
114  export PATH="%{_bindir}:${PATH}"
115  mkdir -p build
116  cd build
117%if "%{_build}" != "%{_host}"
118  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
119%endif
120  CFLAGS="$RPM_OPT_FLAGS" \
121  ../gdb-%{gdb_version}/configure \
122    --build=%_build --host=%_host \
123    --target=bfin-rtems4.11 \
124    --verbose --disable-nls \
125    --without-included-gettext \
126    --disable-win32-registry \
127    --disable-werror \
128    %{build_sim} \
129    %{?with_system_readline:--with-system-readline} \
130    --with-expat \
131    %{?with_python:--with-python}%{!?with_python:--without-python} \
132    --with-gdb-datadir=%{_datadir}/bfin-rtems4.11-gdb \
133    --prefix=%{_prefix} --bindir=%{_bindir} \
134    --includedir=%{_includedir} --libdir=%{_libdir} \
135    --mandir=%{_mandir} --infodir=%{_infodir}
136
137  make %{?_smp_mflags} all
138  cd ..
139
140%install
141  export PATH="%{_bindir}:${PATH}"
142  rm -rf $RPM_BUILD_ROOT
143
144  cd build
145  make DESTDIR=$RPM_BUILD_ROOT install
146
147# Conflict with a native gdb's infos
148  rm -rf $RPM_BUILD_ROOT%{_infodir}
149
150# We don't ship host files
151  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
152
153# host library, installed to a bogus directory
154  rm -f ${RPM_BUILD_ROOT}%{_libdir}/libbfin-rtems4.11-sim.a
155
156# Bug in gdb-7.0, bogusly installs linux-only files
157  somethinguseful=0
158  for f in ${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/syscalls/*.xml; do
159    case $f in
160    *linux.xml) rm -f $f;;
161    *.xml) somethinguseful=1;;
162    esac
163  done
164  if test $somethinguseful -eq 0; then
165    rm -rf "${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/syscalls"
166  fi
167
168%if "{gdb_version}" >= "7.3"
169%if ! %{with python}
170# gdb-7.3 doesn't honor --without-python correctly
171  rm -rf ${RPM_BUILD_ROOT}%{_datadir}/bfin-rtems4.11-gdb/python
172%endif
173%endif
174  cd ..
175
176# Extract %%__os_install_post into os_install_post~
177cat << \EOF > os_install_post~
178%__os_install_post
179EOF
180
181# Generate customized brp-*scripts
182cat os_install_post~ | while read a x y; do
183case $a in
184# Prevent brp-strip* from trying to handle foreign binaries
185*/brp-strip*)
186  b=$(basename $a)
187  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
188  chmod a+x $b
189  ;;
190# Fix up brp-compress to handle %%_prefix != /usr
191*/brp-compress*)
192  b=$(basename $a)
193  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
194  chmod a+x $b
195  ;;
196esac
197done
198
199sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
200  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
201< os_install_post~ > os_install_post
202%define __os_install_post . ./os_install_post
203
204%clean
205  rm -rf $RPM_BUILD_ROOT
206
207# ==============================================================
208# bfin-rtems4.11-gdb
209# ==============================================================
210# %package -n rtems-4.11-bfin-rtems4.11-gdb
211# Summary:      rtems gdb for bfin-rtems4.11
212# Group: Development/Tools
213# %if %build_infos
214# Requires: rtems-4.11-gdb-common
215# %endif
216
217%description -n rtems-4.11-bfin-rtems4.11-gdb
218GNU gdb targetting bfin-rtems4.11.
219
220%files -n rtems-4.11-bfin-rtems4.11-gdb
221%defattr(-,root,root)
222%dir %{_prefix}
223%dir %{_prefix}/share
224%{?with_python:%{_datadir}/bfin-rtems4.11-gdb}
225
226%dir %{_mandir}
227%dir %{_mandir}/man1
228%{_mandir}/man1/bfin-rtems4.11-*.1*
229
230%dir %{_bindir}
231%{_bindir}/bfin-rtems4.11-*
232
Note: See TracBrowser for help on using the repository browser.