summaryrefslogtreecommitdiffstats
path: root/source-builder/config/binutils-2-1.cfg
blob: 890bd74493cf4387545b62a9af7fe179975ff162 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#
# Binutils 2.xx Version 1.
#
# This configuration file configure's, make's and install's binutils.
#

%include %{_configdir}/checks.cfg

#
# Select Snapshot Macro Maps
#
%select binutils-snapshot

#
# The description.
#
Name:      %{_target}-binutils-%{binutils_version}-%{_host}-%{release}
Summary:   Binutils v%{binutils_version} for target %{_target} on host %{_host}
Version:   %{binutils_version}
Release:   %{release}
URL: 	   http://sources.redhat.com/binutils

#
# Supports Candian Cross (Cxc).
#
%define allow_cxc

#
# Default gold to disable.
#
%ifn %{defined with_gold}
 %define with_gold 0
%endif

#
# Disable the new default options to check for stack exec and RWX sections
# instroduced in 2.39.
#
%define binutils_extra_config %nil
%ifn %{defined with_stackexec_warning}
 %define binutils_extra_config %{binutils_extra_config} --disable-warn-execstack
%endif
%ifn %{defined with_rwx_sections_warning}
 %define binutils_extra_config %{binutils_extra_config} --disable-warn-rwx-segments
%endif

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

#
# Prepare the source code.
#
%prep
  build_top=$(pwd)

  binutils_source=%{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:"binutils-%{binutils_version}"}

  source_dir_binutils=${binutils_source}
  %source setup binutils -q -n ${binutils_source}
  %patch setup binutils -p1

  cd ${build_top}

%build
  build_top=$(pwd)

  %{build_directory}

  mkdir -p ${build_dir}
  cd ${build_dir}

  %{host_build_flags}

  ../${source_dir_binutils}/configure \
    --build=%{_build} --host=%{_host} \
    --target=%{_target} \
    --verbose --disable-nls \
    --disable-gdb --disable-libdecnumber --disable-readline --disable-sim \
    %{?with_deterministic_archives:--enable-deterministic-archives} \
    %{?with_64_bit_bfd:--enable-64-bit-bfd} \
    %{?with_gold:--enable-gold=yes} \
    --without-included-gettext \
    --disable-win32-registry \
    --disable-werror \
    --prefix=%{_prefix} --bindir=%{_bindir} \
    --exec-prefix=%{_exec_prefix} \
    --includedir=%{_includedir} --libdir=%{_libdir} \
    --mandir=%{_mandir} --infodir=%{_infodir} \
    %{binutils_extra_config}

  %{__make} %{?_smp_mflags} all

  cd ${build_top}

%install
  cd ${build_top}

  %{__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

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

  # We don't ship host files
  %{__rmfile} ${SB_BUILD_ROOT}%{_libdir}/libiberty*

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

  cd ${build_top}