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

Last change on this file since 321 was 319, checked in by Yuri Dario, 13 years ago

spec: remove unnecessary explicit requirements for libssp, libstdc++, libsupc++.

  • Property svn:eol-style set to native
File size: 7.2 KB
Line 
1%global gcc_version 4.4.6
2%global gcc_target_platform %{_target_cpu}
3
4Summary: Various compilers (C, C++, Objective-C, Java, ...)
5Name: gcc
6Version: %{gcc_version}
7Release: 15%{?dist}
8
9# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
10# GCC Runtime Exception.
11License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
12Group: Development/Languages
13URL: http://gcc.gnu.org
14
15Source0: gcc-os2-20111223.tar.bz2
16Patch0: gcc-os2.diff
17
18BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
19
20Obsoletes: gcc < %{gcc_version}
21
22BuildRequires: binutils
23BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1
24
25Requires: libgcc446 = %{gcc_version}
26Requires: libc-devel >= 0.6.3
27Requires: binutils
28
29%description
30The gcc package contains the GNU Compiler Collection version 4.4.
31You'll need this package in order to compile C code.
32
33%package -n libgcc446
34Summary: GCC version 4.4 shared support library
35Group: System Environment/Libraries
36Autoreq: false
37
38%description -n libgcc446
39This package contains GCC shared support library which is needed
40e.g. for exception handling support.
41
42%package -n libssp
43Summary: GCC stack protector shared library
44Group: System Environment/Libraries
45
46%description -n libssp
47This package contains GCC shared library which is needed
48for stack protector.
49
50%package -n libstdc++
51Summary: GNU Standard C++ Library v3
52Group: System Environment/Libraries
53
54%description -n libstdc++
55This package contains GNU Standard C++ Library v3 shared library.
56
57%package -n libsupc++
58Summary: GNU Standard C++ Library v3 subset
59Group: System Environment/Libraries
60
61%description -n libsupc++
62This package contains GNU Standard C++ Library v3 subset shared library.
63
64%package wlink
65Summary: GCC configuration changes for Watcom linker support.
66Group: Development/Languages
67Requires: watcom-wlink-hll
68
69%description wlink
70This package triggers the required config.sys settings to allow use of Watcom
71Linker instead of ld.
72
73%package wrc
74Summary: GCC configuration changes for Watcom resource compiler support.
75Group: Development/Languages
76Requires: watcom-wrc
77
78%description wrc
79This package triggers the required config.sys settings to allow use of Watcom
80resource compiler instead of IBM one.
81
82%prep
83%setup -q -c
84%patch0 -p1 -b .os2~
85
86%build
87rm -fr obj-%{gcc_target_platform}
88mkdir obj-%{gcc_target_platform}
89cd obj-%{gcc_target_platform}
90
91script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
92export PATH="$script_dir/gcc${PATH:+;$PATH}"
93export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
94
95export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe;
96export AWK=awk;
97export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
98export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
99export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
100export LANG="";
101../configure --prefix=%{_prefix} \
102 --with-sysroot=/@unixroot \
103 --enable-shared \
104 --enable-languages=c,c++ \
105 --with-gnu-as \
106 --disable-bootstrap \
107 --disable-multilib \
108 --disable-libstdcxx-pch \
109 --enable-threads \
110 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
111
112make %{?_smp_mflags}
113
114%install
115rm -rf $RPM_BUILD_ROOT
116
117cd obj-%{gcc_target_platform}
118
119# There are some MP bugs in libstdc++ Makefiles
120#make -C %{gcc_target_platform}/libstdc++-v3
121
122#make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
123# infodir=%{buildroot}%{_infodir} install
124
125make DESTDIR=${RPM_BUILD_ROOT} install
126
127#build dll
128dllar -o stdcpp.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/stdc++.a \
129 -d "GNU stdc++ %{gcc_version}" \
130 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
131 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
132 -libf "INITINSTANCE TERMINSTANCE" \
133 -libd "DATA MULTIPLE"
134cp -p stdcpp.dll %{buildroot}%{_libdir}
135cp -p stdcpp.a %{buildroot}%{_libdir}/stdc++.a
136cp -p stdcpp.lib %{buildroot}%{_libdir}/stdc++.lib
137mv %{buildroot}%{_libdir}/stdc++.a %{buildroot}%{_libdir}/stdc++_s.a
138
139#build dll
140dllar -o supcpp.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/supc++.a \
141 -d "GNU supc++ %{gcc_version}" \
142 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
143 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
144 -libf "INITINSTANCE TERMINSTANCE" \
145 -libd "DATA MULTIPLE"
146cp -p supcpp.dll %{buildroot}%{_libdir}
147cp -p supcpp.a %{buildroot}%{_libdir}/supc++.a
148cp -p supcpp.lib %{buildroot}%{_libdir}/supc++.lib
149mv %{buildroot}%{_libdir}/supc++.a %{buildroot}%{_libdir}/supc++_s.a
150
151#build dll
152dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
153 -d "GNU Stack Protector %{gcc_version}" \
154 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
155 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
156 -libf "INITINSTANCE TERMINSTANCE" \
157 -libd "DATA MULTIPLE"
158cp -p ssp.dll %{buildroot}%{_libdir}
159cp -p ssp.a %{buildroot}%{_libdir}
160cp -p ssp.lib %{buildroot}%{_libdir}
161mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
162
163cd ..
164
165echo dummy for virtual package > gcc-wrc.txt
166echo dummy for virtual package > gcc-wlink.txt
167
168#mkdir -p %{buildroot}%{_usr}
169
170rm %{buildroot}%{_libdir}/*.la
171
172#mv %{buildroot}%{_usr}/readme.os2 $RPM_BUILD_ROOT%_docdir/%{name}-%{version}/
173
174ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1
175ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{version}/cc1plus
176
177#yd fix attributes for executables
178chmod 0755 %{buildroot}%{_bindir}/*.exe
179
180%clean
181rm -rf %{buildroot}
182
183%post wrc
184if [ "$1" = 1 ] ; then
185#execute only on first install
186%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
187%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
188%cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
189%cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
190fi
191
192%postun wrc
193if [ "$1" = 0 ] ; then
194#execute only on last uninstall
195%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
196%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
197fi
198
199%post wlink
200if [ "$1" = 1 ] ; then
201#execute only on first install
202%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
203%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
204%cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
205%cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
206fi
207
208%postun wlink
209if [ "$1" = 0 ] ; then
210#execute only on last uninstall
211%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
212%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
213fi
214
215%files
216%defattr(-,root,root,-)
217%{_usr}/bin
218%{_usr}/include
219%{_usr}/info
220%{_libdir}/*.*a
221%{_libdir}/*.lib
222%{_libdir}/*.dll
223%exclude %{_libdir}/*.dll
224%{_libdir}/*.spec
225%{_libdir}/gcc/*
226%{_usr}/libexec
227%{_usr}/man
228%{_usr}/share
229
230%files -n libssp
231%defattr(-,root,root,-)
232%{_libdir}/ssp.dll
233
234%files -n libstdc++
235%defattr(-,root,root,-)
236%{_libdir}/stdcpp.dll
237
238%files -n libsupc++
239%defattr(-,root,root,-)
240%{_libdir}/supcpp.dll
241
242%files wlink
243%doc gcc-wlink.txt
244
245%files wrc
246%doc gcc-wrc.txt
247
248%files -n libgcc446
249%defattr(-,root,root,-)
250%{_libdir}/gcc446.dll
251#%doc %{_datadir}/doc/*
252
253%changelog
254* Wed Jan 11 2012 yd
255- use more conventionional names for shared libraries packages.
256
257* Mon Jan 09 2012 yd
258- install also dlls with main package.
259
260* Sun Jan 08 2012 yd
261- moved dlls out from main package.
262
263* Fri Dec 23 2011 yd
264- fixed spawn internal error report.
265- fixed handling of big command lines (fixes OOo building).
266- fixed Optlink calls.
267
268* Fri Dec 9 2011 yd
269- updated source code to 4.4.6, github tree
Note: See TracBrowser for help on using the repository browser.