summaryrefslogtreecommitdiff
path: root/gcc49/gcc49.spec
blob: 564798ac5f2567bac2b13578eb85a39f935fe824 (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
%global _optdir /opt
%global _islver 0.12.2
%global _cloogver 0.18.4
%global _mpfrver 3.1.4
%global _gmpver 6.1.0
%global _mpcver 1.0.3
%global gcc_target_platform %{_arch}-fedoraunited-linux-gnu
%define debug_package %{nil}

Summary: Various compilers (C, C++, Objective-C, Java, ada, go, obj-c++ ...)
Name: gcc49
Version: 4.9.3
Release: 5

License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Group: Development/Languages

#Source: http://gcc.gnu.org/pub/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2
#Source1: http://isl.gforge.inria.fr/isl-%{_islver}.tar.bz2
#Source2: http://www.bastoul.net/cloog/pages/download/cloog-%{_cloogver}.tar.gz
#Source3: http://www.mpfr.org/mpfr-current/mpfr-%{_mpfrver}.tar.bz2
#Source4: https://gmplib.org/download/gmp/gmp-%{_gmpver}.tar.bz2
#Source5: ftp://ftp.gnu.org/gnu/mpc/mpc-%{_mpcver}.tar.gz
Source: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/gcc-%{version}.tar.bz2
Source1: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/isl-%{_islver}.tar.bz2
Source2: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/cloog-%{_cloogver}.tar.gz
Source3: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/mpfr-%{_mpfrver}.tar.bz2
Source4: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/gmp-%{_gmpver}.tar.bz2
Source5: https://gitlab.com/bgstack15/big-sources/raw/master/gcc49/mpc-%{_mpcver}.tar.gz
Source6: gcc49
Patch:  target.path

# Patch1 for libitm: Don't redefine __always_inline in local_atomic.
# https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=227040
Patch1: local_atomic.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: binutils >= 2.24
BuildRequires: make autoconf m4 gettext dejagnu bison flex sharutils
BuildRequires: texinfo texinfo-tex
BuildRequires: python-sphinx
BuildRequires: zlib-devel
BuildRequires: texinfo
BuildRequires: glibc-devel
#ada
BuildRequires: dejagnu

# go
BuildRequires: hostname, procps

# java
# BuildRequires: which
# BuildRequires: dejagnu
# BuildRequires: libart_lgpl-devel
# BuildRequires: gtk2-devel

Requires: binutils >= 2.24
Conflicts: gdb < 5.1-2
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
AutoReq: true



%description
The gcc package contains the GNU Compiler Collection version 4.9.
You'll need this package in order to compile C code.
You can change the environment variables as follows adding
"source /usr/bin/gcc49" 



%prep
%setup -n gcc-4.9.3
%patch -p0
%patch1 -p0

tar jxvf %{SOURCE1} -C %{_builddir}/gcc-%{version}/
tar zxvf %{SOURCE2} -C %{_builddir}/gcc-%{version}/
tar jxvf %{SOURCE3} -C %{_builddir}/gcc-%{version}/
tar jxvf %{SOURCE4} -C %{_builddir}/gcc-%{version}/
tar zxvf %{SOURCE5} -C %{_builddir}/gcc-%{version}/

  # link isl/cloog for in-tree builds
  ln -s isl-%{_islver} isl
  ln -s cloog-%{_cloogver} cloog
  ln -s mpfr-%{_mpfrver} mpfr
  ln -s gmp-%{_gmpver} gmp
  ln -s mpc-%{_mpcver} mpc

  # Do not run fixincludes
  sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

  # Fedora Linux installs x86_64 libraries /lib

[[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64

  echo %{version} > gcc/BASE-VER

  # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure

  mkdir -p %{_builddir}/gcc-build

%build
cd %{_builddir}/gcc-build

  # using -pipe causes spurious test-suite failures
  # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  CFLAGS=${CFLAGS/-pipe/}
  CXXFLAGS=${CXXFLAGS/-pipe/}


  %{_builddir}/gcc-%{version}/configure --prefix=/opt/gcc-%{version} \
      --libdir=/opt/gcc-%{version}/%{_lib} --libexecdir=/opt/gcc-%{version}/%{_lib} \
      --mandir=/opt/gcc-%{version}/man --infodir=/opt/gcc-%{version}/info --with-gxx-include-dir=/opt/gcc-%{version}/include \
      --host=%{_arch}-fedoraunited-linux-gnu \
      --build=%{_arch}-fedoraunited-linux-gnu \
      --enable-languages=c,c++,objc,obj-c++,go,fortran,lto \
      --with-system-zlib \
      --enable-libstdcxx-time \
      --disable-multilib \
      --enable-version-specific-runtime-libs \
      --enable-plugin \
      --enable-threads=posix \
      --enable-checking=release \
      --enable-gnu-unique-object \
      --enable-linker-build-id \
      --enable-lto \
      --enable-initfini-array \
      --enable-gnu-indirect-function \
      --enable-tls \
      %ifarch %{ix86} x86_64
	  --with-tune=generic \
%endif
      --enable-bootstrap 
 

make bootstrap || return 1

  

%install

cd %{_builddir}/gcc-build

  make -j1 DESTDIR=%{buildroot} install


  # Install Runtime Library Exception
  install -dm 755 %{buildroot}/usr/share/licenses/%{name}/
  install -m 0644 %{_builddir}/gcc-%{version}/COPYING.RUNTIME %{buildroot}/usr/share/licenses/%{name}/RUNTIME.LIBRARY.EXCEPTION

  # Help plugins find out nvra.
echo "gcc-%{version}-%{release}.%{_arch}" | tee %{buildroot}/opt/gcc-%{version}/%{_lib}/gcc/%{gcc_target_platform}/rpmver

  # i686
%ifarch i686
  ln -sf %{_optdir}/gcc-%{version}/lib/gcc/i386-fedoraunited-linux-gnu %{buildroot}/opt/gcc-%{version}/%{_lib}/gcc/i686-fedoraunited-linux-gnu
%endif 

  # fix id bgstack15-gcc49-0001
%ifarch x86_64
  pushd %{buildroot}%{_optdir}/gcc-%{version}/lib64/gcc/x86_64-fedoraunited-linux-gnu/%{version}
  %{__cp} -p ../lib64/libgcc_s.so.1 .
  %{__ln_s} libgcc_s.so.1 libgcc_s.so
  popd
%endif

  # We need a script to change environment variables as follows
  install -dm 755 %{buildroot}/%{_bindir}/
  install -m 0644 %{SOURCE6} %{buildroot}/%{_bindir}/
  chmod a+x %{buildroot}/%{_bindir}/gcc49


%files 

%{_optdir}/gcc-%{version}/
%{_datadir}/licenses/%{name}/RUNTIME.LIBRARY.EXCEPTION
%{_bindir}/gcc49


%changelog
* Sat Sep  1 2018 B Stack <bgstack15@gmail.com> 4.9.3-5
- fix x86_64 gcc_s.so symlink

* Mon Mar 28 2016 David Vasquez <davidjeremias82@gmail.com> 4.9.3-2
- Added i686 symlink

* Sat Oct 10 2015 David Vasquez <davidjeremias82@gmail.com> 4.9.3-1
- New package
bgstack15