ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/gcc.spec
Revision: 1.15
Committed: Sun Apr 29 10:34:13 2007 UTC (18 years ago) by dlange
Branch: MAIN
CVS Tags: pe20070501c-ports
Changes since 1.14: +22 -3 lines
Log Message:
add capability for revisions of gcc without changing arch of entire system

File Contents

# Content
1 ### RPM external gcc 3.4.5-CMS1
2 ## INITENV +PATH LD_LIBRARY_PATH %i/lib/32
3 ## BUILDIF case $(uname):$(uname -p) in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) true ;; esac
4 %define realVersion %(echo %v | cut -d- -f1)
5 Source: ftp://ftp.fu-berlin.de/unix/gnu/%n/%n-%realVersion/%n-%realVersion.tar.bz2
6 %define cpu %(echo %cmsplatf | cut -d_ -f2)
7
8 %prep
9 %setup -q -n %{n}-%{realVersion}
10
11 %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
21 if [ "`echo %v | cut -d. -f 1`" == "3" ]
22 then
23 ../configure --prefix=%i --enable-languages=c,c++,f77 \
24 --enable-shared # --enable-__cxa_atexit
25 else
26 ../configure --prefix=%i --enable-languages=c,c++ \
27 --enable-shared # --enable-__cxa_atexit
28 fi
29 make %makeprocesses bootstrap
30
31 %install
32 cd obj && make install
33
34 ln -s gcc %i/bin/cc
35
36 %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
50 %{relocateConfig}lib/libg2c.la
51 %{relocateConfig}lib/libstdc++.la
52 %{relocateConfig}lib/libsupc++.la
53 %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