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

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

spec: gcc4 updated source code to 4.4.6, github tree.

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