summaryrefslogtreecommitdiffstats
path: root/config/binutils-2-1.cfg
blob: fdeae979feba19d1732432f0b8d475f95b332705 (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
#
# Binutils 2.xx Version 1.
#
# This configuration file configure's, make's and install's binutils.
#

%include %{_configdir}/checks.cfg

Summary:   Binutils v%{binutils_version} for target %{_target} on host %{_host}
Version:   %{binutils_version}
Release:   %{release}
URL: 	   http://sources.redhat.com/binutils
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)

#
# Source
#
Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2

#
# Prepare the source code.
#
%prep
%setup -q -c -T -n %{name}-%{version}
%setup -q -D -T -n %{name}-%{version} -a0
cd binutils-%{binutils_version}
%{?patch0:%patch0 -p1}
cd ..

%build
  export PATH="%{_bindir}:${PATH}"
  mkdir -p build
  cd build
%if "%{_build}" != "%{_host}"
  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
%endif
  CFLAGS="$TB_OPT_FLAGS" \
  ../binutils-%{binutils_version}/configure \
    --build=%{_build} --host=%{_host} \
    --target=%{_target} \
    --verbose --disable-nls \
    --without-included-gettext \
    --disable-win32-registry \
    --disable-werror \
    --prefix=%{_prefix} --bindir=%{_bindir} \
    --exec-prefix=%{_exec_prefix} \
    --includedir=%{_includedir} --libdir=%{_libdir} \
    --mandir=%{_mandir} --infodir=%{_infodir}

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

%install
  export PATH="%{_bindir}:${PATH}"
  rm -rf $TB_BUILD_ROOT

  cd build
  %{__make} DESTDIR=$TB_BUILD_ROOT install

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

  rm -f $TB_BUILD_ROOT%{_infodir}/dir
  touch $TB_BUILD_ROOT%{_infodir}/dir

  # binutils does not install share/locale, however it uses it
  mkdir -p $TB_BUILD_ROOT%{_prefix}/share/locale

  # We don't ship host files
  rm -f ${TB_BUILD_ROOT}%{_libdir}/libiberty*

  # manpages without corresponding tools
  if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-dlltool%{_exeext}; then
    rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-dlltool*
  fi
  if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-nlmconv%{_exeext}; then
    rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-nlmconv*
  fi
  if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windres%{_exeext}; then
    rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windres*
  fi
  if test ! -f ${TB_BUILD_ROOT}%{_bindir}/%{_target}-windmc%{_exeext}; then
    rm -f ${TB_BUILD_ROOT}%{_mandir}/man1/%{_target}-windmc*
  fi

  cd ..