source: spec/trunk/SPECS/gcc4.spec@ 370

Last change on this file since 370 was 370, checked in by Yuri Dario, 12 years ago

spec: gcc4, renamed stdc++, update to 4.7.3.

  • Property svn:eol-style set to native
File size: 9.3 KB
Line 
1%define ver_major 4
2%define ver_minor 7
3%define ver_patch 3
4
5%define os2_release 1
6
7%define rpm_release 1
8
9%global gcc_version %{ver_major}.%{ver_minor}.%{ver_patch}
10%global gcc_target_platform %{_target_cpu}
11
12# New package version scheme: X.Y.Z.N-R, where X.Y.Z is the GCC release (e.g.
13# 4.5.4, matches gcc_version above), N is the OS/2 release (1, 2, etc) and R is
14# the RPM release (1, 2, etc). The OS/2 release number increases with each
15# OS/2 specific update to the sources followed by a new build, the RPM repease
16# number increases with each new RPM build (which may use the same source tree
17# but fix only some RPM-specific things). Note that the RPM release number
18# resets to 1 each time the OS/2 release increases (which is reset to 1 in turn
19# when the GCC release changes.
20
21Summary: Various compilers (C, C++, Objective-C, Java, ...)
22Name: gcc
23Version: %{gcc_version}.%{os2_release}
24Release: %{rpm_release}%{?dist}
25
26# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
27# GCC Runtime Exception.
28License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
29Group: Development/Languages
30URL: http://gcc.gnu.org
31
32Source0: gcc-gcc-4_7-branch-os2.zip
33Patch0: gcc-os2.diff
34
35Obsoletes: gcc < %{gcc_version}
36
37BuildRequires: binutils make
38BuildRequires: os2-base-fhs
39BuildRequires: ash gcc gcc-wlink gcc-wrc grep gettext-devel diffutils gawk flex sed
40BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, mpc-devel
41
42Requires: libgcc%{ver_major}%{ver_minor}%{ver_patch} = %{version}-%{release}
43Requires: libssp = %{version}-%{release}
44Requires: libstdc++6 = %{version}-%{release}
45Requires: libsupc++6 = %{version}-%{release}
46Requires: libc-devel >= 0.6.3
47Requires: binutils
48
49%description
50The gcc package contains the GNU Compiler Collection version %{ver_major}.%{ver_minor}.
51You'll need this package in order to compile C code.
52
53%package -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
54Summary: GCC version %{ver_major}.%{ver_minor} shared support library
55Group: System Environment/Libraries
56Autoreq: false
57
58%description -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
59This package contains GCC shared support library which is needed
60e.g. for exception handling support.
61
62%package -n libssp
63Summary: GCC stack protector shared library
64Group: System Environment/Libraries
65Obsoletes: gcc-stack-protector
66
67%description -n libssp
68This package contains GCC shared library which is needed
69for stack protector.
70
71%package -n libstdc++6
72Summary: GNU Standard C++ Library v3
73Group: System Environment/Libraries
74
75%description -n libstdc++6
76This package contains GNU Standard C++ Library v3 shared library.
77
78%package -n libsupc++6
79Summary: GNU Standard C++ Library v3 subset
80Group: System Environment/Libraries
81
82%description -n libsupc++6
83This package contains GNU Standard C++ Library v3 subset shared library.
84
85%package wlink
86Summary: GCC configuration changes for Watcom linker support.
87Group: Development/Languages
88Requires: watcom-wlink-hll
89
90%description wlink
91This package triggers the required config.sys settings to allow use of Watcom
92Linker instead of ld.
93
94%package wrc
95Summary: GCC configuration changes for Watcom resource compiler support.
96Group: Development/Languages
97Requires: watcom-wrc
98
99%description wrc
100This package triggers the required config.sys settings to allow use of Watcom
101resource compiler instead of IBM one.
102
103%prep
104%setup -q -c
105%patch0 -p1 -b .os2~
106
107%build
108rm -fr obj-%{gcc_target_platform}
109mkdir obj-%{gcc_target_platform}
110cd obj-%{gcc_target_platform}
111
112script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
113export PATH="$script_dir/gcc${PATH:+;$PATH}"
114export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
115
116export CONFIG_SHELL=%{_bindir}/sh.exe
117export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
118export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
119export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
120export LANG=en_US
121export GREP=grep
122
123../configure --prefix=%{_prefix} \
124 --with-sysroot=/@unixroot \
125 --enable-shared \
126 --enable-languages=c,c++ \
127 --with-gnu-as \
128 --disable-bootstrap \
129 --disable-multilib \
130 --disable-libstdcxx-pch \
131 --enable-threads
132
133make
134# %{?_smp_mflags}
135
136
137%install
138rm -rf $RPM_BUILD_ROOT
139
140cd obj-%{gcc_target_platform}
141
142# There are some MP bugs in libstdc++ Makefiles
143#make -C %{gcc_target_platform}/libstdc++-v3
144
145#make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
146# infodir=%{buildroot}%{_infodir} install
147
148make DESTDIR=${RPM_BUILD_ROOT} install
149
150# copy runtime files
151emxomf -o i386-pc-os2-emx/libgcc/libgcc_so_d.lib i386-pc-os2-emx/libgcc/libgcc_so_d.a
152cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.a %{buildroot}%{_libdir}
153cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.lib %{buildroot}%{_libdir}
154cp -p i386-pc-os2-emx/libgcc/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll %{buildroot}%{_libdir}
155
156#build dll
157dllar -o stdcpp6.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/libstdc++.a \
158 -d "GNU stdc++ %{gcc_version}" \
159 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
160 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
161 -libf "INITINSTANCE TERMINSTANCE" \
162 -libd "DATA MULTIPLE"
163cp -p stdcpp6.dll %{buildroot}%{_libdir}
164cp -p stdcpp6.a %{buildroot}%{_libdir}/stdc++.a
165cp -p stdcpp6.lib %{buildroot}%{_libdir}/stdc++.lib
166mv %{buildroot}%{_libdir}/libstdc++.a %{buildroot}%{_libdir}/stdc++_s.a
167
168#build dll
169dllar -o supcpp6.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/libsupc++.a \
170 -d "GNU supc++ %{gcc_version}" \
171 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
172 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
173 -libf "INITINSTANCE TERMINSTANCE" \
174 -libd "DATA MULTIPLE"
175cp -p supcpp6.dll %{buildroot}%{_libdir}
176cp -p supcpp6.a %{buildroot}%{_libdir}/supc++.a
177cp -p supcpp6.lib %{buildroot}%{_libdir}/supc++.lib
178mv %{buildroot}%{_libdir}/libsupc++.a %{buildroot}%{_libdir}/supc++_s.a
179
180#build dll
181dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
182 -d "GNU Stack Protector %{gcc_version}" \
183 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
184 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
185 -libf "INITINSTANCE TERMINSTANCE" \
186 -libd "DATA MULTIPLE"
187cp -p ssp.dll %{buildroot}%{_libdir}
188cp -p ssp.a %{buildroot}%{_libdir}
189cp -p ssp.lib %{buildroot}%{_libdir}
190mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
191
192cd ..
193
194echo dummy for virtual package > gcc-wrc.txt
195echo dummy for virtual package > gcc-wlink.txt
196
197#mkdir -p %{buildroot}%{_usr}
198
199rm %{buildroot}%{_libdir}/*.la
200rm %{buildroot}%{_libdir}/*.py
201
202ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1
203ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1plus
204
205#yd fix attributes for executables
206chmod 0755 %{buildroot}%{_bindir}/*.exe
207
208%clean
209rm -rf %{buildroot}
210
211%post wrc
212if [ "$1" = 1 ] ; then
213#execute only on first install
214%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
215%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
216%cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
217%cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
218fi
219
220%postun wrc
221if [ "$1" = 0 ] ; then
222#execute only on last uninstall
223%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
224%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
225fi
226
227%post wlink
228if [ "$1" = 1 ] ; then
229#execute only on first install
230%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
231%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
232%cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
233%cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
234fi
235
236%postun wlink
237if [ "$1" = 0 ] ; then
238#execute only on last uninstall
239%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
240%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
241fi
242
243%files
244%defattr(-,root,root,-)
245%{_usr}/bin
246%{_usr}/include
247%{_libdir}/*.*a
248%{_libdir}/*.lib
249%exclude %{_libdir}/*.dll
250%{_libdir}/*.spec
251%{_libdir}/gcc/*
252%{_usr}/libexec
253%{_usr}/share
254%doc ChangeLog ChangeLog.*
255%doc README README.*
256%doc COPYING COPYING.*
257%doc MAINTAINERS
258
259%files -n libssp
260%defattr(-,root,root,-)
261%{_libdir}/ssp.dll
262
263%files -n libstdc++6
264%defattr(-,root,root,-)
265%{_libdir}/stdcp*.dll
266
267%files -n libsupc++6
268%defattr(-,root,root,-)
269%{_libdir}/supcp*.dll
270
271%files wlink
272%doc gcc-wlink.txt
273
274%files wrc
275%doc gcc-wrc.txt
276
277%files -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
278%defattr(-,root,root,-)
279%{_libdir}/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll
280
281
282%changelog
283* Wed Nov 27 2013 yd
284- Rename the following packages to avoid ABI breaks (using gcc versioning policy):
285 + libstdc++ => libstdc++6
286 + libsupc++ => libsupc++6
287- updated source code to gcc 4.7.3.
288
289* Mon Jul 25 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.17-1
290- New OS/2 Release 17 of 4.4.6. See ChangeLog.OS2 for more information.
291
292* Mon Jul 23 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.16-1
293- New OS/2 Release 16 of 4.4.6. See ChangeLog.OS2 for more information.
294- Rename the following packages to better match the conventions:
295 + gcc-stack-protector => libssp
296 + gcc-stdc++-shared-library => libstdc++
297 + gcc-supc++-shared-library => libsupc++
298
299* Mon Jan 09 2012 yd
300- install also dlls with main package.
301
302* Sun Jan 08 2012 yd
303- moved dlls out from main package.
304
305* Fri Dec 23 2011 yd
306- fixed spawn internal error report.
307- fixed handling of big command lines (fixes OOo building).
308- fixed Optlink calls.
309
310* Fri Dec 9 2011 yd
311- updated source code to 4.4.6, github tree
Note: See TracBrowser for help on using the repository browser.