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.7 by eulisse, Wed Jul 19 08:34:20 2006 UTC vs.
Revision 1.44 by elmer, Fri Nov 21 13:10:33 2008 UTC

# Line 1 | Line 1
1 < ### RPM external gcc 3.4.4
1 > ### RPM external gcc 4.3.2
2   ## INITENV +PATH LD_LIBRARY_PATH %i/lib/32
3   ## INITENV +PATH LD_LIBRARY_PATH %i/lib64
4 < ## BUILDIF [ $(uname) != Darwin ]
5 < Source: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%v/%n-%v.tar.bz2
4 > ## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;;  Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
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.4
15 > %define mpfrVersion 2.3.2
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 >
24 > case %cmsos in
25 >  "slc4_ia32" | "slc5_ia32" )
26 > cat << \EOF_CONFIG_GCC >> gcc/config.gcc
27 > # CMS patch to include gcc/config/i386/t-cms when building gcc
28 > tm_file="$tm_file i386/cms.h"
29 > tmake_file="$tmake_file i386/t-cms"
30 > EOF_CONFIG_GCC
31 >
32 > cat << \EOF_CMS_H > gcc/config/i386/cms.h
33 > #undef ASM_SPEC
34 > #define ASM_SPEC  "%%{v:-V} %%{Qy:} %%{!Qn:-Qy} %%{n} %%{T} %%{Ym,*} %%{Yd,*} %%{Wa,*:%%*} --32"
35 > #undef CC1_SPEC
36 > #define CC1_SPEC  "%%(cc1_cpu) %%{profile:-p} -m32"
37 > #undef CC1PLUS_SPEC
38 > #define CC1PLUS_SPEC "-m32"
39 > #undef MULTILIB_DEFAULTS
40 > #define MULTILIB_DEFAULTS { "m32" }
41 > EOF_CMS_H
42 >
43 > cat << \EOF_T_CMS > gcc/config/i386/t-cms
44 > MULTILIB_OPTIONS = m32
45 > MULTILIB_DIRNAMES = ../lib
46 > MULTILIB_MATCHES = m32=m32
47 > EOF_T_CMS
48 >  ;;
49 > esac
50 >
51 > %setup -D -T -b 1 -n binutils-%binutilsv
52 > %setup -D -T -b 2 -n gmp-%{gmpVersion}
53 > %setup -D -T -b 3 -n mpfr-%{mpfrVersion}
54  
55   %build
56 < # FIXME: --enable-__cxa_atexit can't be used with gcc 3.2.3 on RH 7.3,
57 < # enabling it causes qt's uic to die with segmentation violation half
58 < # way down the build of qt (projecsettings.ui or something like that;
59 < # not the first or only call to uic).  Disabling the flag removes the
60 < # issue, so clearly the option does not work correctly on this
61 < # platform combination.
56 > # Set special variables required to build 32-bit executables on 64-bit
57 > # systems.  Note that if the architecture is SLC4/IA32, we may be on a
58 > # 64-bit system and need to produce a 32-bit capable compiler, which
59 > # _itself_ is a 32-bit executable.
60 > case $(uname -m):%{cmsos} in
61 >  *:slc4_ia32 )
62 >    CCOPTS="-m32 -Wa,--32" ;;
63 >  *:slc5_ia32 )
64 >    CCOPTS="-m32 -Wa,--32" ;;
65 >  * )
66 >    CCOPTS="" ;;
67 > esac
68 >
69 > # If requested, build our own binutils.  Currently the default is to use
70 > # the system binutils.
71 > %if "%{?use_external_binutils:set}" == "set"
72 > cd ../binutils-%{binutilsv}
73 > CC="gcc $CCOPTS" ./configure --prefix=%i
74 > make %makeprocesses
75 > make install
76 > %endif
77 >
78 > # Build GMP/MPFR for GCC 4.x
79 > %define gcc4opts %{nil}
80 > %if "%gcc_major" == "4"
81 > cd ../gmp-%{gmpVersion}
82 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/gmp --disable-shared
83 > make %makeprocesses
84 > make install
85 >
86 > cd ../mpfr-%{mpfrVersion}
87 > CC="gcc $CCOPTS" ./configure --prefix=%i/tmp/mpfr --with-gmp=%i/tmp/gmp --disable-shared
88 > make %makeprocesses
89 > make install
90 > %define gcc4opts --with-gmp=%i/tmp/gmp --with-mpfr=%i/tmp/mpfr
91 > %endif
92 >
93 > # Build the compilers
94 > cd ../gcc-%realversion
95   mkdir -p obj
96   cd obj
97 + CC="gcc $CCOPTS" \
98 + ../configure --prefix=%i \
99 +  --enable-languages=c,c++,`case %v in 3.*) echo f77;; *) echo fortran;; esac` \
100 +  %gcc4opts --enable-shared
101  
17 if [ "`echo %v | cut -d. -f 1`" == "3" ]
18 then
19 ../configure --prefix=%i --enable-languages=c,c++,f77 \
20    --enable-shared # --enable-__cxa_atexit
21 else
22 ../configure --prefix=%i --enable-languages=c,c++ \
23    --enable-shared # --enable-__cxa_atexit
24 fi
102   make %makeprocesses bootstrap
103  
104   %install
105 < cd obj && make install
105 > cd %_builddir/gcc-%{realversion}/obj && make install
106   ln -s gcc %i/bin/cc
107 < #
108 < #
107 > find %i/lib %i/lib32 %i/lib64 -name '*.la' -exec rm -f {} \; || true
108 >
109 > # SCRAM ToolBox toolfile is now geneated by the gcc-toolfile.spec
110 > # so that everything works even in the case "--use-system-compiler"
111 > # option is specified.
112 >
113 > %post
114 > # %{relocateConfig}lib/libg2c.la
115 > # %{relocateConfig}lib/libstdc++.la
116 > # %{relocateConfig}lib/libsupc++.la
117 > # %if "%cpu" == "amd64"
118 > # %{relocateConfig}lib64/libg2c.la
119 > # %{relocateConfig}lib64/libstdc++.la
120 > # %{relocateConfig}lib64/libsupc++.la
121 > # %{relocateConfig}lib/32/libg2c.la
122 > # %{relocateConfig}lib/32/libstdc++.la
123 > # %{relocateConfig}lib/32/libsupc++.la
124 > # %endif
125 > # %if "%gcc4" == "true"
126 > # %{relocateConfig}lib/libgfortran.la
127 > # %{relocateConfig}lib/libgfortranbegin.la
128 > # %endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines