1 |
< |
### RPM external gcc 3.4.5-CMS1 |
1 |
> |
### RPM external gcc 3.4.5 |
2 |
|
## INITENV +PATH LD_LIBRARY_PATH %i/lib/32 |
3 |
+ |
## INITENV +PATH LD_LIBRARY_PATH %i/lib64 |
4 |
|
## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac |
5 |
< |
%define realVersion %(echo %v | cut -d- -f1) |
6 |
< |
Source: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realVersion/%n-%realVersion.tar.bz2 |
5 |
> |
Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%v/%n-%v.tar.bz2 |
6 |
> |
%define binutilsv 2.17 |
7 |
> |
Source1: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2 |
8 |
|
%define cpu %(echo %cmsplatf | cut -d_ -f2) |
7 |
– |
|
9 |
|
%prep |
10 |
< |
%setup -q -n %{n}-%{realVersion} |
10 |
> |
%setup -T -b 0 -n gcc-%v |
11 |
> |
|
12 |
> |
%if "%cmsos" == "slc4_ia32" |
13 |
> |
cat << \EOF_CONFIG_GCC >> gcc/config.gcc |
14 |
> |
# CMS patch to include gcc/config/i386/t-cms when building gcc |
15 |
> |
tm_file="$tm_file i386/cms.h" |
16 |
> |
tmake_file="$tmake_file i386/t-cms" |
17 |
> |
EOF_CONFIG_GCC |
18 |
> |
|
19 |
> |
cat << \EOF_CMS_H > gcc/config/i386/cms.h |
20 |
> |
#define ASM_SPEC "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32" |
21 |
> |
#define CC1_SPEC "%%(cc1_cpu) %%{profile:-p} -m32" |
22 |
> |
#define CC1PLUS_SPEC "-m32" |
23 |
> |
#define MULTILIB_DEFAULTS { "m32" } |
24 |
> |
EOF_CMS_H |
25 |
> |
|
26 |
> |
cat << \EOF_T_CMS > gcc/config/i386/t-cms |
27 |
> |
MULTILIB_OPTIONS = m32 |
28 |
> |
MULTILIB_DIRNAMES = ../lib |
29 |
> |
MULTILIB_MATCHES = m32=m32 |
30 |
> |
EOF_T_CMS |
31 |
> |
%endif |
32 |
|
|
33 |
+ |
#perl -p -i -e 's|SPECS = specs|SPECS = specs.install|' gcc/Makefile.in |
34 |
+ |
%setup -D -T -b 1 -n binutils-%binutilsv |
35 |
|
%build |
36 |
|
# FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3, |
37 |
|
# enabling it causes qt's uic to die with segmentation violation half |
39 |
|
# not the first or only call to uic). Disabling the flag removes the |
40 |
|
# issue, so clearly the option does not work correctly on this |
41 |
|
# platform combination. |
18 |
– |
mkdir -p obj |
19 |
– |
cd obj |
42 |
|
|
43 |
< |
if [ "`echo %v | cut -d. -f 1`" == "3" ] |
44 |
< |
then |
45 |
< |
../configure --prefix=%i --enable-languages=c,c++,f77 \ |
46 |
< |
--enable-shared # --enable-__cxa_atexit |
47 |
< |
else |
48 |
< |
../configure --prefix=%i --enable-languages=c,c++ \ |
49 |
< |
--enable-shared # --enable-__cxa_atexit |
50 |
< |
fi |
51 |
< |
make %makeprocesses bootstrap |
43 |
> |
buildGCC () { |
44 |
> |
target=$1 |
45 |
> |
host=$2 |
46 |
> |
prefix=$3 |
47 |
> |
|
48 |
> |
if [ "X$target" != "X" ] |
49 |
> |
then |
50 |
> |
targetOption="--target $target" |
51 |
> |
fi |
52 |
> |
|
53 |
> |
if [ "X$host" != "X" ] |
54 |
> |
then |
55 |
> |
hostOption="--host $host" |
56 |
> |
fi |
57 |
> |
|
58 |
> |
languages=c,c++ |
59 |
> |
if [ "`echo %v | cut -d. -f 1`" == "3" ] |
60 |
> |
then |
61 |
> |
languages=c,c++,f77 |
62 |
> |
fi |
63 |
> |
|
64 |
> |
if [ "$prefix" == "" ] |
65 |
> |
then |
66 |
> |
prefix=%i |
67 |
> |
fi |
68 |
> |
|
69 |
> |
mkdir -p obj-$target |
70 |
> |
cd obj-$target |
71 |
> |
|
72 |
> |
../configure --prefix=$prefix --enable-languages=$languages \ |
73 |
> |
--enable-shared \ |
74 |
> |
$targetOption \ |
75 |
> |
$hostOption |
76 |
> |
make CC1_SPEC="bogus" %makeprocesses bootstrap |
77 |
> |
make install |
78 |
> |
cd .. |
79 |
> |
} |
80 |
> |
|
81 |
> |
# create a tmp |
82 |
> |
mkdir -p %i/tmp |
83 |
> |
|
84 |
> |
# build the latest/greatest binutils |
85 |
> |
mkdir -p %i/tmp/binutils |
86 |
> |
cd ../binutils-%{binutilsv} |
87 |
> |
./configure --prefix=%i/tmp/binutils |
88 |
> |
make %makeprocesses |
89 |
> |
make install |
90 |
> |
|
91 |
> |
# build the native platform compiler |
92 |
> |
cd ../gcc-%v |
93 |
> |
export PATH=%i/tmp/binutils/bin:$PATH |
94 |
> |
export LD_LIBRARY_PATH=%i/tmp/binutils/lib:$PATH |
95 |
> |
buildGCC |
96 |
> |
|
97 |
> |
# rebuild binutils with the new compiler |
98 |
> |
export PATH=%i/bin:$PATH |
99 |
> |
export LD_LIBRARY_PATH=%i/lib:$PATH |
100 |
> |
cd ../binutils-%binutilsv |
101 |
> |
./configure --prefix=%i |
102 |
> |
make %makeprocesses |
103 |
> |
make install |
104 |
> |
rm -fr %i/tmp |
105 |
|
|
31 |
– |
%install |
32 |
– |
cd obj && make install |
106 |
|
|
107 |
+ |
%install |
108 |
+ |
#cd obj && make install |
109 |
|
ln -s gcc %i/bin/cc |
35 |
– |
|
110 |
|
%post |
37 |
– |
|
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 |
– |
|
111 |
|
%{relocateConfig}lib/libg2c.la |
112 |
|
%{relocateConfig}lib/libstdc++.la |
113 |
|
%{relocateConfig}lib/libsupc++.la |