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

Last change on this file since 277 was 277, checked in by Yuri Dario, 14 years ago

spec: gcc4, use more conventionional names for shared libraries packages.

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