Magellan Linux

Contents of /smage/trunk/core/gcc/gcc-4.2.3-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations) (download)
Sun Jan 11 01:07:49 2009 UTC (15 years, 3 months ago) by niro
File size: 3244 byte(s)
-fixed old cvs headers
1 # $Id$
2
3 PNAME="gcc"
4 PVER="4.2.3"
5 PBUILD="r2"
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.18
15 >= virtual/glibc"
16
17 SDEPEND=">= virtual/kernel-headers"
18
19 SRCFILE="${PNAME}-${PVER}.tar.bz2"
20 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
21
22 # languages to build into gcc
23 MyLanguages=c,c++
24
25 sminclude mtools libtool alx
26
27 SRC_URI=(
28 gnu://${PNAME}/${PNAME}-${PVER}/${SRCFILE}
29 mirror://${PNAME}/${SRCFILE}
30 mirror://${PNAME}/${PNAME}-${PVER}-no-fixincludes.patch
31 mirror://${PNAME}/${PNAME}-${PVER}-magellan-version.patch
32 )
33
34 # gcc don't like strong CFLAGS
35 export CFLAGS="${CFLAGS//-O?} -O2"
36 export CXXFLAGS="${CFLAGS}"
37
38 # check for crosscompile or export default CHOST
39 if [[ -z ${CCHOST} ]]
40 then
41 # no crosscompile defined
42 export CCHOST=${CHOST}
43 else
44 # use crosscompile host
45 export CCHOST=${CCHOST}
46 fi
47
48 src_prepare()
49 {
50 munpack ${SRCFILE} || die
51 cd ${SRCDIR}
52
53 # generic fixes
54 mpatch ${PNAME}-${PVER}-no-fixincludes.patch || die
55 mpatch ${PNAME}-${PVER}-magellan-version.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 # you better off when not using distcc to compile
70 # your new compiler :) maybe not all are the same
71 export SMAGE_USE_DISTCC=false
72
73 ../configure \
74 --host=${CHOST} \
75 --target=${CCHOST} \
76 --prefix=/usr \
77 --mandir=/usr/share/man \
78 --infodir=/usr/share/info \
79 --libdir=/usr/$(mlibdir) \
80 --libexecdir=/usr/$(mlibdir) \
81 --enable-shared \
82 --enable-threads=posix \
83 --enable-__cxa_atexit \
84 --enable-clocale=gnu \
85 --disable-checking \
86 --disable-libunwind-exceptions \
87 --with-system-zlib \
88 --enable-long-long \
89 --enable-cstdio=stdio \
90 --enable-languages=${MyLanguages} \
91 --disable-libstdcxx-pch \
92 || die
93
94 # parallel builds seems to break sometimes on x86_64
95 local myopts
96 [[ ${ARCH} = x86_64 ]] && myopts=-j1
97
98 mmake ${myopts} bootstrap-lean || die
99 }
100
101 src_install()
102 {
103 cd ${SRCDIR}/build
104 minstalldir /$(mlibdir) || die
105
106 make DESTDIR=${BINDIR} install || die
107
108 # versionize all bins and symlink them
109 for bin in $(find ${BINDIR}/usr/bin -type f)
110 do
111 echo ${bin}
112 mv ${bin} ${bin}-${PVER} || die
113 ln -snf $(basename ${bin}-${PVER}) ${bin} || die
114 done
115
116 mlink ../usr/bin/cpp-${PVER} /$(mlibdir)/cpp || die
117 # this one is needed on multlib system.
118 # rpcgen may not find the cpp compiler correctly if not in /lib/cpp
119 if [[ $(mlibdir) != lib ]]
120 then
121 minstalldir /lib || die
122 mlink ../usr/bin/cpp-${PVER} /lib/cpp || die
123 fi
124 mlink gcc-${PVER} /usr/bin/cc || die
125
126 # deletes libstdc++ && libgcc_s
127 rm ${BINDIR}/usr/$(mlibdir)/{libgcc_s*.*,libstdc++*.*} || die
128
129 # fix all .la files
130 # the contain invalid libpathes and they are not needed
131 local la
132 for la in $(find ${BINDIR} -name \*.la)
133 do
134 fix_la_file ${la} || die ${la}
135 done
136 }
137
138 postinstall()
139 {
140 echo
141 echo "Please remember that the flag -mcpu does not exist anymore."
142 echo "It has been replaced with '-mtune'. Please update your /etc/mage.rc."
143 echo
144 }

Properties

Name Value
svn:keywords Id