Magellan Linux

Contents of /trunk/core/gcc/gcc-4.3.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (show annotations) (download)
Sun Oct 12 17:28:15 2008 UTC (15 years, 7 months ago) by niro
File size: 3748 byte(s)
-fixed some configure issues on multilib arches and cross-compile builds
1 # $Header: /magellan-cvs/smage/gcc/gcc-4.2.3-r2.smage2,v 1.1 2008/04/02 21:15:47 niro Exp $
2
3 PNAME="gcc"
4 PVER="4.3.2"
5 PBUILD="r1"
6
7 PCATEGORIE="sys-dev"
8 STATE="unstable"
9
10 DESCRIPTION="Modern C/C++ compiler written by the GNU people."
11 HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
12
13 DEPEND="== sys-libs/libstdc++-${PVER}
14 >= sys-dev/binutils-2.19
15 >= virtual/glibc
16 >= dev-libs/gmp-4.2.4
17 >= dev-libs/mpfr-2.3.2"
18
19 SDEPEND=">= virtual/kernel-headers"
20
21 SRCFILE="${PNAME}-${PVER}.tar.bz2"
22 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
23
24 # languages to build into gcc
25 MyLanguages=c,c++
26
27 sminclude mtools libtool
28
29 SRC_URI=(
30 gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE}
31 mirror://${PNAME}/${SRCFILE}
32 mirror://${PNAME}/${PNAME}-${PVER}-no-fixincludes.patch
33 )
34
35 # gcc don't like strong CFLAGS
36 export CFLAGS="${CFLAGS//-O?} -O2"
37 export CXXFLAGS="${CFLAGS}"
38
39 # check for crosscompile or export default CHOST
40 if [[ -z ${CCHOST} ]]
41 then
42 # no crosscompile defined
43 export CCHOST=${CHOST}
44 else
45 # use crosscompile host
46 export CCHOST=${CCHOST}
47 fi
48
49 src_prepare()
50 {
51 munpack ${SRCFILE} || die
52 cd ${SRCDIR}
53
54 # generic fixes
55 mpatch ${PNAME}-${PVER}-no-fixincludes.patch || die
56
57 # suppress installation of libiberty, as we will be
58 # using the one from binutils
59 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in || die
60
61 install -d ${SRCDIR}/build || die
62 cd ${SRCDIR}/build
63 }
64
65 src_compile()
66 {
67 cd ${SRCDIR}/build
68
69 local myconf
70
71 # you better off when not using distcc to compile
72 # your new compiler :) maybe not all are the same
73 export SMAGE_USE_DISTCC=false
74
75 # gcc >= 4.3 has now configure flags for uri and version - yeah!
76
77 # Straight from the GCC install doc:
78 # "GCC has code to correctly determine the correct value for target
79 # for nearly all native systems. Therefore, we highly recommend you
80 # not provide a configure target when configuring a native compiler."
81 if [[ ${CHOST} != ${CCHOST} ]]
82 then
83 myconf+=" --target=${CCHOST}"
84 fi
85
86 AR=ar \
87 ../configure \
88 --with-bugurl="http://bugs.magellan-linux.de/" \
89 --with-pkgversion="${PVER} (Magellan-Linux)" \
90 --build=${CHOST} \
91 --host=${CHOST} \
92 --prefix=/usr \
93 --mandir=/usr/share/man \
94 --infodir=/usr/share/info \
95 --libdir=/usr/$(mlibdir) \
96 --libexecdir=/usr/$(mlibdir) \
97 --enable-shared \
98 --enable-threads=posix \
99 --enable-__cxa_atexit \
100 --enable-clocale=gnu \
101 --disable-checking \
102 --with-system-zlib \
103 --enable-long-long \
104 --enable-cstdio=stdio \
105 --enable-languages=${MyLanguages} \
106 --disable-libstdcxx-pch \
107 ${myconf} \
108 || die
109
110 # parallel builds seems to break sometimes on x86_64
111 local myopts
112 [[ ${ARCH} = x86_64 ]] && myopts=-j1
113
114 mmake ${myopts} bootstrap-lean || die
115 }
116
117 src_install()
118 {
119 cd ${SRCDIR}/build
120 minstalldir /$(mlibdir) || die
121
122 make DESTDIR=${BINDIR} install || die
123
124 # versionize all bins and symlink them
125 for bin in $(find ${BINDIR}/usr/bin -type f)
126 do
127 echo ${bin}
128 mv ${bin} ${bin}-${PVER} || die
129 ln -snf $(basename ${bin}-${PVER}) ${bin} || die
130 done
131
132 mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die
133 # this one is needed on multlib system.
134 # rpcgen may not find the cpp compiler correctly if not in /lib/cpp
135 if [[ $(mlibdir) != lib ]]
136 then
137 minstalldir /lib || die
138 mlink ../usr/bin/cpp-${PVER} /lib/cpp || die
139 fi
140 mlink gcc-${PVER} /usr/bin/cc || die
141
142 # deletes libstdc++ && libgcc_s
143 rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*} || die
144
145 # fix all .la files
146 # the contain invalid libpathes and they are not needed
147 local la
148 for la in $(find ${BINDIR} -name \*.la)
149 do
150 fix_la_file ${la} || die ${la}
151 done
152 }
153
154 postinstall()
155 {
156 echo
157 echo "Please remember that the flag -mcpu does not exist anymore."
158 echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc."
159 echo
160 }

Properties

Name Value
svn:keywords Id