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

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

spec: gcc4 build from sources.

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