summaryrefslogtreecommitdiffstats
path: root/source-builder/config/gdb-7-1.cfg
blob: 53bcd3a1e8f25f2f84793d6ae1ff8fccc9f96460 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
# GDB 7.xx Version 1.
#
# This configuration file configure's, make's and install's gdb.
#

%include %{_configdir}/checks.cfg

Name:      %{_target}-gdb-%{gdb_version}-%{release}
Summary:   GDB v%{gdb_version} for target %{_target} on host %{_host}
Version:   %{gdb_version}
Release:   %{release}
URL: 	   http://www.gnu.org/software/gdb/
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)

#
# Source
#
%ifn %{defined Source0}
 Source0: http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
 VersionControl0 git clone git://sourceware.org/git/gdb.git
%endif

#
# Disable Python on Cxc builds for now.
#
%if "%{_build}" != "%{_host}"
  %define without_python
%endif

#
#
# Prepare the source code.
#
%prep
  %setup -q -c -n %{name}-%{version}
  cd gdb-%{gdb_version}
  %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
  %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
  %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
  %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
  %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
  %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
  %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
  %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
  %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
  %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
  cd ..

%build
  if test "%{_build}" != "%{_host}" ; then
    build_dir="build-cxc"
  else
    build_dir="build"
  fi
  mkdir -p ${build_dir}
  cd ${build_dir}
  if test "%{_build}" != "%{_host}" ; then
    CFLAGS_FOR_BUILD="-g -O2 -Wall"
  fi
  CFLAGS="$SB_OPT_FLAGS" \
  ../gdb-%{gdb_version}/configure \
    --build=%{_build} --host=%{_host} \
    --target=%{_target} \
    --verbose --disable-nls \
    --without-included-gettext \
    --disable-win32-registry \
    --disable-werror \
    --enable-sim \
    --with-expat \
    %{!?without_python:--with-python} \
    --prefix=%{_prefix} --bindir=%{_bindir} \
    --exec-prefix=%{_exec_prefix} \
    --includedir=%{_includedir} --libdir=%{_libdir} \
    --mandir=%{_mandir} --infodir=%{_infodir}

  %{__make} %{?_smp_mflags} all
  cd ..

%install
  %{__rmdir} $SB_BUILD_ROOT

  cd ${build_dir}
  %{__make} DESTDIR=$SB_BUILD_ROOT install

  # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it.
  %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*

  %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
  touch $SB_BUILD_ROOT%{_infodir}/dir

  cd ..