1 |
dlange |
1.15 |
### RPM external gcc 3.4.5-CMS1
|
2 |
eulisse |
1.3 |
## INITENV +PATH LD_LIBRARY_PATH %i/lib/32
|
3 |
elmer |
1.12 |
## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
|
4 |
dlange |
1.15 |
%define realVersion %(echo %v | cut -d- -f1)
|
5 |
|
|
Source: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realVersion/%n-%realVersion.tar.bz2
|
6 |
eulisse |
1.11 |
%define cpu %(echo %cmsplatf | cut -d_ -f2)
|
7 |
dlange |
1.15 |
|
8 |
|
|
%prep
|
9 |
|
|
%setup -q -n %{n}-%{realVersion}
|
10 |
|
|
|
11 |
argiro |
1.1 |
%build
|
12 |
|
|
# FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3,
|
13 |
|
|
# enabling it causes qt's uic to die with segmentation violation half
|
14 |
|
|
# way down the build of qt (projecsettings.ui or something like that;
|
15 |
|
|
# not the first or only call to uic). Disabling the flag removes the
|
16 |
|
|
# issue, so clearly the option does not work correctly on this
|
17 |
|
|
# platform combination.
|
18 |
|
|
mkdir -p obj
|
19 |
|
|
cd obj
|
20 |
eulisse |
1.3 |
|
21 |
|
|
if [ "`echo %v | cut -d. -f 1`" == "3" ]
|
22 |
|
|
then
|
23 |
argiro |
1.1 |
../configure --prefix=%i --enable-languages=c,c++,f77 \
|
24 |
|
|
--enable-shared # --enable-__cxa_atexit
|
25 |
eulisse |
1.3 |
else
|
26 |
|
|
../configure --prefix=%i --enable-languages=c,c++ \
|
27 |
|
|
--enable-shared # --enable-__cxa_atexit
|
28 |
|
|
fi
|
29 |
eulisse |
1.2 |
make %makeprocesses bootstrap
|
30 |
argiro |
1.1 |
|
31 |
|
|
%install
|
32 |
|
|
cd obj && make install
|
33 |
dlange |
1.15 |
|
34 |
argiro |
1.1 |
ln -s gcc %i/bin/cc
|
35 |
dlange |
1.15 |
|
36 |
eulisse |
1.9 |
%post
|
37 |
dlange |
1.15 |
|
38 |
|
|
mkdir $RPM_INSTALL_PREFIX/%{pkgrel}/bin.orig
|
39 |
|
|
|
40 |
|
|
for exe in `ls $RPM_INSTALL_PREFIX/%{pkgrel}/bin`; do
|
41 |
|
|
mv $RPM_INSTALL_PREFIX/%{pkgrel}/bin/${exe} $RPM_INSTALL_PREFIX/%{pkgrel}/bin.orig/${exe}
|
42 |
|
|
cat << \EOF | sed -e "s|\@EXEC\@|$RPM_INSTALL_PREFIX/%{pkgrel}/bin.orig/${exe}|g" > $RPM_INSTALL_PREFIX/%{pkgrel}/bin/$exe
|
43 |
|
|
#!/bin/sh
|
44 |
|
|
@EXEC@ "$@" -m32 -Wa,--32
|
45 |
|
|
EOF
|
46 |
|
|
chmod +x $RPM_INSTALL_PREFIX/%{pkgrel}/bin/$exe
|
47 |
|
|
done
|
48 |
|
|
|
49 |
|
|
|
50 |
eulisse |
1.9 |
%{relocateConfig}lib/libg2c.la
|
51 |
|
|
%{relocateConfig}lib/libstdc++.la
|
52 |
|
|
%{relocateConfig}lib/libsupc++.la
|
53 |
eulisse |
1.11 |
%if "%cpu" == "amd64"
|
54 |
|
|
%{relocateConfig}lib64/libg2c.la
|
55 |
|
|
%{relocateConfig}lib64/libstdc++.la
|
56 |
|
|
%{relocateConfig}lib64/libsupc++.la
|
57 |
|
|
%{relocateConfig}lib/32/libg2c.la
|
58 |
|
|
%{relocateConfig}lib/32/libstdc++.la
|
59 |
|
|
%{relocateConfig}lib/32/libsupc++.la
|
60 |
|
|
%endif
|