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

Last change on this file since 357 was 357, checked in by dmik, 12 years ago

spec: gcc4: Release 4.4.6.17-1.

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