ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc.spec
(Generate patch)

Comparing COMP/CMSDIST/gcc.spec (file contents):
Revision 1.17 by dlange, Sat May 5 18:12:18 2007 UTC vs.
Revision 1.40 by eulisse, Wed Jan 2 13:23:11 2008 UTC

# Line 1 | Line 1
1 < ### RPM external gcc 3.4.5-CMS2
1 > ### RPM external gcc 3.4.5-CMS19
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 )
5   Source0: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realversion/%n-%realversion.tar.bz2
6   %define binutilsv 2.17
7   Source1: http://ftp.gnu.org/gnu/binutils/binutils-%binutilsv.tar.bz2
8 +
9 + # If gcc version >= 4.0.0, we need two additional sources, for gmp and mpfr,
10 + # and we set the fortranCompiler macro (which is going to be used by the
11 + # --enable-languages option of gcc's configure) to gfortran.
12 + # Notice that we need to build those twice: once using the system compiler
13 + # and the using the newly built gcc.
14 + %define gmpVersion 4.2.1
15 + %define mpfrVersion 2.2.1
16 + Source2: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmpVersion}.tar.bz2
17 + Source3: http://www.mpfr.org/mpfr-%{mpfrVersion}/mpfr-%{mpfrVersion}.tar.bz2
18 +
19   %define cpu %(echo %cmsplatf | cut -d_ -f2)
20 + %define gcc_major %(echo %realversion | cut -f1 -d.)
21   %prep
22   %setup -T -b 0 -n gcc-%realversion
23  
# Line 18 | Line 29 | tmake_file="$tmake_file i386/t-cms"
29   EOF_CONFIG_GCC
30  
31   cat << \EOF_CMS_H > gcc/config/i386/cms.h
32 + #undef ASM_SPEC
33   #define ASM_SPEC  "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
34 + #undef CC1_SPEC
35   #define CC1_SPEC  "%%(cc1_cpu) %%{profile:-p} -m32"
36 + #undef CC1PLUS_SPEC
37   #define CC1PLUS_SPEC "-m32"
38 + #undef MULTILIB_DEFAULTS
39   #define MULTILIB_DEFAULTS { "m32" }
40   EOF_CMS_H
41  
# Line 31 | Line 46 | MULTILIB_MATCHES = m32=m32
46   EOF_T_CMS
47   %endif
48  
34 #perl -p -i -e 's|SPECS = specs|SPECS = specs.install|' gcc/Makefile.in
49   %setup -D -T -b 1 -n binutils-%binutilsv
50 + %setup -D -T -b 2 -n gmp-%{gmpVersion}
51 + %setup -D -T -b 3 -n mpfr-%{mpfrVersion}
52 +
53   %build
54 < # FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3,
55 < # enabling it causes qt's uic to die with segmentation violation half
56 < # way down the build of qt (projecsettings.ui or something like that;
57 < # not the first or only call to uic).  Disabling the flag removes the
58 < # issue, so clearly the option does not work correctly on this
59 < # platform combination.
60 <
61 < buildGCC () {
62 <    target=$1
63 <    host=$2
64 <    prefix=$3
65 <
66 <    if [ "X$target" != "X" ]
67 <    then
68 <        targetOption="--target $target"
69 <    fi
70 <
71 <    if [ "X$host" != "X" ]
72 <    then
73 <        hostOption="--host $host"
74 <    fi
75 <
76 <    languages=c,c++
77 <    if [ "`echo %realversion | cut -d. -f 1`" == "3" ]
78 <    then
62 <        languages=c,c++,f77
63 <    fi
64 <
65 <    if [ "$prefix" == "" ]
66 <    then
67 <        prefix=%i
68 <    fi
69 <    
70 <    mkdir -p obj-$target
71 <    cd obj-$target
72 <    
73 <    ../configure --prefix=$prefix --enable-languages=$languages \
74 <        --enable-shared \
75 <        $targetOption \
76 <        $hostOption
77 <    make CC1_SPEC="bogus" %makeprocesses bootstrap
78 <    make install            
79 <    cd ..
80 < }
81 <
82 < # create a tmp
83 < mkdir -p %i/tmp
84 <
85 < # build the latest/greatest binutils
86 < mkdir -p %i/tmp/binutils
87 < cd ../binutils-%{binutilsv}
88 < ./configure --prefix=%i/tmp/binutils
54 > # Set special variables required to build 32-bit executables on 64-bit
55 > # systems.  Note that if the architecture is SLC4/IA32, we may be on a
56 > # 64-bit system and need to produce a 32-bit capable compiler, which
57 > # _itself_ is a 32-bit executable.
58 > case $(uname -m):%{cmsos} in
59 >  *:slc4_ia32 )
60 >    CCOPTS="-m32 -Wa,--32" ;;
61 >  * )
62 >    CCOPTS="" ;;
63 > esac
64 >
65 > # If requested, build our own binutils.  Currently the default is to use
66 > # the system binutils.
67 > %if "%{?use_external_binutils:set}" == "set"
68 > cd ../binutils-%{binutilsv}
69 > CC="gcc $CCOPTS" ./configure --prefix=%i
70 > make %makeprocesses
71 > make install
72 > %endif
73 >
74 > # Build GMP/MPFR for GCC 4.x
75 > %define gcc4opts %{nil}
76 > %if "%gcc_major" == "4"
77 > cd ../gmp-%{gmpVersion}
78 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
79   make %makeprocesses
80   make install
81  
82 < # build the native platform compiler
83 < cd ../gcc-%realversion
94 < export PATH=%i/tmp/binutils/bin:$PATH
95 < export LD_LIBRARY_PATH=%i/tmp/binutils/lib:$PATH
96 < buildGCC
97 <
98 < # rebuild binutils with the new compiler
99 < export PATH=%i/bin:$PATH
100 < export LD_LIBRARY_PATH=%i/lib:$PATH
101 < cd ../binutils-%binutilsv
102 < ./configure --prefix=%i
82 > cd ../mpfr-%{mpfrVersion}
83 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
84   make %makeprocesses
85   make install
86 < rm -fr %i/tmp
86 > %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
87 > %endif
88 >
89 > # Build the compilers
90 > cd ../gcc-%realversion
91 > mkdir -p obj
92 > cd obj
93 > CC="gcc $CCOPTS" \
94 > ../configure --prefix=%i \
95 >  --enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \
96 >  %gcc4opts --enable-shared
97  
98 + make %makeprocesses bootstrap
99  
100   %install
101 < #cd obj && make install
101 > cd %_builddir/gcc-%{realversion}/obj && make install
102   ln -s gcc %i/bin/cc
103 + find %i/lib %i/lib32 %i/lib64 -name '*.la' -exec rm -f {} \; || true
104 +
105 + # SCRAM ToolBox toolfile is now geneated by the gcc-toolfile.spec
106 + # so that everything works even in the case "--use-system-compiler"
107 + # option is specified.
108 +
109   %post
110 < %{relocateConfig}lib/libg2c.la
111 < %{relocateConfig}lib/libstdc++.la
112 < %{relocateConfig}lib/libsupc++.la
113 < %if "%cpu" == "amd64"
114 < %{relocateConfig}lib64/libg2c.la
115 < %{relocateConfig}lib64/libstdc++.la
116 < %{relocateConfig}lib64/libsupc++.la
117 < %{relocateConfig}lib/32/libg2c.la
118 < %{relocateConfig}lib/32/libstdc++.la
119 < %{relocateConfig}lib/32/libsupc++.la
120 < %endif
110 > # %{relocateConfig}lib/libg2c.la
111 > # %{relocateConfig}lib/libstdc++.la
112 > # %{relocateConfig}lib/libsupc++.la
113 > # %if "%cpu" == "amd64"
114 > # %{relocateConfig}lib64/libg2c.la
115 > # %{relocateConfig}lib64/libstdc++.la
116 > # %{relocateConfig}lib64/libsupc++.la
117 > # %{relocateConfig}lib/32/libg2c.la
118 > # %{relocateConfig}lib/32/libstdc++.la
119 > # %{relocateConfig}lib/32/libsupc++.la
120 > # %endif
121 > # %if "%gcc4" == "true"
122 > # %{relocateConfig}lib/libgfortran.la
123 > # %{relocateConfig}lib/libgfortranbegin.la
124 > # %endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines