source: rtems/scripts/gdb/gdb.add @ 5537653

4.104.114.84.95
Last change on this file since 5537653 was 5537653, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/25/05 at 12:33:38

2005-04-25 Ralf Corsepius <ralf.corsepius@…>

  • Property mode set to 100644
File size: 4.0 KB
Line 
1
2%define gdb_version     @gdb_version@
3%define gdb_target      @target_alias@
4
5Name:         %{rpmprefix}%{gdb_target}-gdb
6Release:      @Release@
7License:      GPL/LGPL
8Group:        %{rpmgroup}
9
10Packager:     ralf.corsepius@rtems.org and joel@OARcorp.com
11
12Version:      %{gdb_version}
13Summary:      gdb for target %{gdb_version}
14
15%if "%{gdb_version}" < "6.0"
16Source0:      ftp://ftp.gnu.org/pub/gnu/gdb-%{gdb_version}@gdb_suffix@
17Patch0:       gdb-%{gdb_version}-rtems-base-@gdb_patch_version@.diff
18Patch1:       gdb-%{gdb_version}-rtems-cg-@gdb_patch_version@.diff
19Patch2:       gdb-%{gdb_version}-rtems-rdbg-@gdb_patch_version@.diff
20%else
21Source0:      ftp://ftp.gnu.org/pub/gnu/gdb-%{gdb_version}@gdb_suffix@
22@PATCH1@
23%endif
24
25%if "%{_vendor}" == "redhat"
26BuildRequires:  ncurses-devel
27%endif
28
29#
30# The original sources are not included in the source RPM.
31# If we included them, then the source RPMs for each target
32# would duplicate MBs of source unnecessarily.  This is
33# a duplication of over 30 MBs of source for each of
34# the more than 10 targets it is possible to build.
35#
36# You can get them yourself from the Internet and copy them to
37# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
38# Or you can try the ftp options of rpm :-)
39#
40%{?!_with_sources:NoSource:      0}
41
42#  Account as best possible for targets without simulators
43#  and targets which require extra arguments.
44%define _sim    1
45
46%if "%{gdb_target}" == "avr-rtems@osversion@"
47%define _sim    0
48%endif
49%if "%{gdb_target}" == "m68k-rtems@osversion@"
50%define _sim    0
51%endif
52%if "%{gdb_target}" == "i386-rtems@osversion@"
53%define _sim    0
54%endif
55%if "%{gdb_target}" == "powerpc-rtems@osversion@"
56%define _sim    0
57%endif
58%if "%{gdb_target}" == "sparc-rtems@osversion@"
59%define _sim    0
60%endif
61
62
63%description
64RTEMS is an open source operating system for embedded systems.
65
66This is the GNU gdb for RTEMS targetting %{gdb_version}.
67
68%prep
69%setup -c -T -n %{name}-%{version} -a0
70
71cd gdb-%{gdb_version}
72%{?PATCH0:%patch0 -p1}
73%{?PATCH1:%patch1 -p1}
74%{?PATCH2:%patch2 -p1}
75cd ..
76
77%build
78%if "%_sim" == "1"
79 simargs="--enable-sim"
80%endif
81
82%if "%{gdb_target}" == "powerpc-rtems@osversion@"
83 simargs="$simargs --enable-sim-timebase --enable-sim-hardware"
84 #  Enabling this causes the program image to be huge and causes
85 #  some gcc/hosts combinations to run out of memory.
86 # simargs="$simargs --enable-sim-inline"
87%endif
88
89  mkdir -p build
90  cd build
91  export PATH="%{_bindir}:${PATH}"
92  CFLAGS="$RPM_OPT_FLAGS" \
93  ../gdb-%{gdb_version}/configure \
94    --build=%_build --host=%_host \
95    --target=%{gdb_target} \
96    --prefix=%{_prefix} --bindir=%{_bindir} \
97    --includedir=%{_includedir} --libdir=%{_libdir} \
98    --mandir=%{_mandir} --infodir=%{_infodir} \
99    --verbose $simargs \
100    --disable-nls
101
102  make all
103  make info
104
105%install
106  rm -rf $RPM_BUILD_ROOT
107
108  cd build
109  make prefix=$RPM_BUILD_ROOT%{_prefix} \
110    bindir=$RPM_BUILD_ROOT%{_bindir} \
111    includedir=$RPM_BUILD_ROOT%{_includedir} \
112    libdir=$RPM_BUILD_ROOT%{_libdir} \
113    infodir=$RPM_BUILD_ROOT%{_infodir} \
114    mandir=$RPM_BUILD_ROOT%{_mandir} \
115    install
116  make prefix=$RPM_BUILD_ROOT%{_prefix} \
117    bindir=$RPM_BUILD_ROOT%{_bindir} \
118    includedir=$RPM_BUILD_ROOT%{_includedir} \
119    libdir=$RPM_BUILD_ROOT%{_libdir} \
120    infodir=$RPM_BUILD_ROOT%{_infodir} \
121    mandir=$RPM_BUILD_ROOT%{_mandir} \
122    install-info
123
124  # host files
125  rm -rf $RPM_BUILD_ROOT%{_includedir}/*.h
126  rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*a
127
128  # These come from other packages
129  rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd*
130  rm -rf $RPM_BUILD_ROOT%{_infodir}/configure*
131  rm -rf $RPM_BUILD_ROOT%{_infodir}/standards*
132
133  # gdb 4.18 installed this, later versions don't
134  # Don't care about it, anymore
135  rm -rf $RPM_BUILD_ROOT%{_infodir}/readline.info*
136 
137  # gzip info files
138  ls $RPM_BUILD_ROOT%{_infodir}/*.info \
139    $RPM_BUILD_ROOT%{_infodir}/*.info-? \
140    $RPM_BUILD_ROOT%{_infodir}/*.info-?? \
141  | while read a; do \
142    gzip -9qf $a 2>/dev/null; \
143  done
144
145  # We don't ship info/dir
146  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
147
148  # gzip man pages
149  gzip -9qf $RPM_BUILD_ROOT%{_mandir}/man?/*.? 2>/dev/null
Note: See TracBrowser for help on using the repository browser.