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

Last change on this file since 249 was 249, 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 AR=ar;
86export AWK=awk;
87export CFLAGS="-g -O2 -DEMX -DOS2"
88export CXXFLAGS="-g -O2 -DEMX -DOS2"
89export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
90export LANG="";
91../configure --prefix=%{_prefix} \
92 --with-sysroot=/@unixroot \
93 --enable-shared \
94 --enable-languages=c,c++ \
95 --with-gnu-as \
96 --disable-bootstrap \
97 --disable-multilib \
98 --disable-libstdcxx-pch \
99 --enable-threads \
100 "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache"
101
102make %{?_smp_mflags}
103
104%install
105rm -rf $RPM_BUILD_ROOT
106
107cd obj-%{gcc_target_platform}
108
109# There are some MP bugs in libstdc++ Makefiles
110#make -C %{gcc_target_platform}/libstdc++-v3
111
112#make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
113# infodir=%{buildroot}%{_infodir} install
114
115make DESTDIR=${RPM_BUILD_ROOT} install
116
117#build dll
118dllar -o stdcpp.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/stdc++.a \
119 -d "GNU stdc++ %{gcc_version}" \
120 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
121 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
122 -libf "INITINSTANCE TERMINSTANCE" \
123 -libd "DATA MULTIPLE"
124cp -p stdcpp.dll %{buildroot}%{_libdir}
125cp -p stdcpp.a %{buildroot}%{_libdir}/stdc++.a
126cp -p stdcpp.lib %{buildroot}%{_libdir}/stdc++.lib
127mv %{buildroot}%{_libdir}/stdc++.a %{buildroot}%{_libdir}/stdc++_s.a
128
129#build dll
130dllar -o supcpp.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/supc++.a \
131 -d "GNU supc++ %{gcc_version}" \
132 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
133 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
134 -libf "INITINSTANCE TERMINSTANCE" \
135 -libd "DATA MULTIPLE"
136cp -p supcpp.dll %{buildroot}%{_libdir}
137cp -p supcpp.a %{buildroot}%{_libdir}/supc++.a
138cp -p supcpp.lib %{buildroot}%{_libdir}/supc++.lib
139mv %{buildroot}%{_libdir}/supc++.a %{buildroot}%{_libdir}/supc++_s.a
140
141#build dll
142dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
143 -d "GNU Stack Protector %{gcc_version}" \
144 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g" \
145 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
146 -libf "INITINSTANCE TERMINSTANCE" \
147 -libd "DATA MULTIPLE"
148cp -p ssp.dll %{buildroot}%{_libdir}
149cp -p ssp.a %{buildroot}%{_libdir}
150cp -p ssp.lib %{buildroot}%{_libdir}
151mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
152
153cd ..
154
155echo dummy for virtual package > gcc-wrc.txt
156echo dummy for virtual package > gcc-wlink.txt
157
158#mkdir -p %{buildroot}%{_usr}
159
160rm %{buildroot}%{_libdir}/*.la
161
162#mv %{buildroot}%{_usr}/readme.os2 $RPM_BUILD_ROOT%_docdir/%{name}-%{version}/
163
164ln -s /@unixroot/usr/libexec/gcc/i386-pc-os2-emx/%{version}/cc1.exe %{buildroot}%{_bindir}/cc1.exe
165ln -s /@unixroot/usr/libexec/gcc/i386-pc-os2-emx/%{version}/cc1plus.exe %{buildroot}%{_bindir}/cc1plus.exe
166
167#yd fix attributes for executables
168chmod 0755 %{buildroot}%{_bindir}/*.exe
169
170%clean
171rm -rf %{buildroot}
172
173%post wrc
174if [ "$1" = 1 ] ; then
175#execute only on first install
176%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
177%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
178%cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
179%cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
180fi
181
182%postun wrc
183if [ "$1" = 0 ] ; then
184#execute only on last uninstall
185%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
186%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
187fi
188
189%post wlink
190if [ "$1" = 1 ] ; then
191#execute only on first install
192%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
193%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
194%cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
195%cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
196fi
197
198%postun wlink
199if [ "$1" = 0 ] ; then
200#execute only on last uninstall
201%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
202%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
203fi
204
205%files
206%defattr(-,root,root,-)
207%{_usr}/bin
208%{_usr}/include
209%{_usr}/info
210%{_libdir}/*.*a
211%{_libdir}/*.lib
212%{_libdir}/*.dll
213%exclude %{_libdir}/ssp.dll
214%exclude %{_libdir}/gcc*.dll
215%{_libdir}/*.spec
216%{_libdir}/gcc/*
217%{_usr}/libexec
218%{_usr}/man
219%{_usr}/share
220
221%files stack-protector
222%defattr(-,root,root,-)
223%{_libdir}/ssp.dll
224
225%files wlink
226%doc gcc-wlink.txt
227
228%files wrc
229%doc gcc-wrc.txt
230
231%files -n libgcc446
232%defattr(-,root,root,-)
233%{_libdir}/gcc446.dll
234#%doc %{_datadir}/doc/*
235
236%changelog
237* Fri Dec 9 2011 yd
238- updated source code to 4.4.6, github tree
Note: See TracBrowser for help on using the repository browser.