/[gentoo-x86]/sys-devel/gcc/gcc-3.2.2.ebuild
Gentoo

Contents of /sys-devel/gcc/gcc-3.2.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (hide annotations) (download)
Thu Mar 25 08:12:54 2004 UTC (10 years, 5 months ago) by mr_bones_
Branch: MAIN
Changes since 1.24: +5 -2 lines
don't use deprecated ? : use syntax

1 agriffis 1.22 # Copyright 1999-2004 Gentoo Technologies, Inc.
2 azarah 1.1 # Distributed under the terms of the GNU General Public License v2
3 mr_bones_ 1.25 # $Header: /home/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2.2.ebuild,v 1.24 2004/02/23 00:20:14 agriffis Exp $
4 azarah 1.1
5     IUSE="static nls bootstrap java build"
6    
7     inherit eutils flag-o-matic libtool
8    
9     # Compile problems with these (bug #6641 among others)...
10     filter-flags "-fno-exceptions -fomit-frame-pointer"
11    
12     # Recently there has been a lot of stability problem in Gentoo-land. Many
13     # things can be the cause to this, but I believe that it is due to gcc3
14     # still having issues with optimizations, or with it not filtering bad
15     # combinations (protecting the user maybe from himeself) yet.
16     #
17     # This can clearly be seen in large builds like glibc, where too aggressive
18     # CFLAGS cause the tests to fail miserbly.
19     #
20     # Quote from Nick Jones <carpaski@gentoo.org>, who in my opinion
21     # knows what he is talking about:
22     #
23     # People really shouldn't force code-specific options on... It's a
24     # bad idea. The -march options aren't just to look pretty. They enable
25     # options that are sensible (and include sse,mmx,3dnow when apropriate).
26     #
27     # The next command strips CFLAGS and CXXFLAGS from nearly all flags. If
28     # you do not like it, comment it, but do not bugreport if you run into
29     # problems.
30     #
31     # <azarah@gentoo.org> (13 Oct 2002)
32     strip-flags
33    
34     # Theoretical cross compiler support
35     [ ! -n "${CCHOST}" ] && export CCHOST="${CHOST}"
36    
37     LOC="/usr"
38     MY_PV="`echo ${PV} | awk -F. '{ gsub(/_pre.*|_alpha.*/, ""); print $1 "." $2 }'`"
39     MY_PV_FULL="`echo ${PV} | awk '{ gsub(/_pre.*|_alpha.*/, ""); print $0 }'`"
40    
41     LIBPATH="${LOC}/lib/gcc-lib/${CCHOST}/${MY_PV_FULL}"
42     BINPATH="${LOC}/${CCHOST}/gcc-bin/${MY_PV}"
43     DATAPATH="${LOC}/share/gcc-data/${CCHOST}/${MY_PV}"
44     # Dont install in /usr/include/g++-v3/, but in gcc internal directory.
45     # We will handle /usr/include/g++-v3/ with gcc-config ...
46     STDCXX_INCDIR="${LIBPATH}/include/g++-v${MY_PV/\.*/}"
47    
48     # Patch tarball support ...
49     #PATCH_VER="1.0"
50     PATCH_VER=""
51    
52     # Snapshot support ...
53     #SNAPSHOT="2002-08-12"
54     SNAPSHOT=""
55    
56     # Branch update support ...
57     MAIN_BRANCH="${PV}" # Tarball, etc used ...
58     #BRANCH_UPDATE="20021208"
59     BRANCH_UPDATE=""
60    
61     if [ -z "${SNAPSHOT}" ]
62     then
63     S="${WORKDIR}/${PN}-${MAIN_BRANCH}"
64     SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/${P}/${PN}-${MAIN_BRANCH}.tar.bz2"
65 msterret 1.19
66 azarah 1.1 if [ -n "${PATCH_VER}" ]
67     then
68     SRC_URI="${SRC_URI}
69     mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2"
70     fi
71    
72     if [ -n "${BRANCH_UPDATE}" ]
73     then
74     SRC_URI="${SRC_URI}
75     mirror://gentoo/${PN}-${MAIN_BRANCH}-branch-update-${BRANCH_UPDATE}.patch.bz2"
76     fi
77     else
78     S="${WORKDIR}/gcc-${SNAPSHOT//-}"
79     SRC_URI="ftp://sources.redhat.com/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT//-}.tar.bz2"
80     fi
81     #SRC_URI="${SRC_URI} mirror://gentoo/${P}-manpages.tar.bz2"
82    
83     DESCRIPTION="The GNU Compiler Collection. Includes C/C++ and java compilers"
84     HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
85    
86     LICENSE="GPL-2 LGPL-2.1"
87 agriffis 1.24 KEYWORDS="x86 ~ppc sparc alpha hppa mips ~ia64"
88 azarah 1.1
89     # Ok, this is a hairy one again, but lets assume that we
90     # are not cross compiling, than we want SLOT to only contain
91     # $PV, as people upgrading to new gcc layout will not have
92     # their old gcc unmerged ...
93     if [ "${CHOST}" == "${CCHOST}" ]
94     then
95     SLOT="${MY_PV}"
96     else
97     SLOT="${CCHOST}-${MY_PV}"
98     fi
99    
100     DEPEND="virtual/glibc
101 mr_bones_ 1.25 !hppa? (
102     mips? ( >=sys-devel/binutils-2.13.90.0.16 )
103     !mips? ( >=sys-devel/binutils-2.13.90.0.18 )
104     )
105 gmsoft 1.17 hppa? ( >=sys-devel/binutils-2.13.90.0.16 )
106 azarah 1.1 >=sys-devel/gcc-config-1.3.1
107 azarah 1.23 !build? ( !arm? ( >=sys-libs/ncurses-5.2-r2 )
108 azarah 1.1 nls? ( sys-devel/gettext ) )"
109 msterret 1.19
110 azarah 1.1 RDEPEND="virtual/glibc
111     >=sys-devel/gcc-config-1.3.1
112     >=sys-libs/zlib-1.1.4
113     >=sys-apps/texinfo-4.2-r4
114 azarah 1.23 !build? ( !arm? ( >=sys-libs/ncurses-5.2-r2 ) )"
115 azarah 1.1
116     PDEPEND="sys-devel/gcc-config"
117    
118    
119     # Hack used to patch Makefiles to install into the build dir
120     FAKE_ROOT=""
121    
122 azarah 1.12 chk_gcc_version() {
123     # This next bit is for updating libtool linker scripts ...
124 azarah 1.18 local OLD_GCC_VERSION="`gcc -dumpversion`"
125     local OLD_GCC_CHOST="$(gcc -v 2>&1 | egrep '^Reading specs' |\
126     sed -e 's:^.*/gcc-lib/\([^/]*\)/[0-9]\+.*$:\1:')"
127 azarah 1.12
128     if [ "${OLD_GCC_VERSION}" != "${MY_PV_FULL}" ]
129     then
130 azarah 1.18 echo "${OLD_GCC_VERSION}" > "${WORKDIR}/.oldgccversion"
131     fi
132    
133     if [ -n "${OLD_GCC_CHOST}" ]
134     then
135     if [ "${CHOST}" = "${CCHOST}" -a "${OLD_GCC_CHOST}" != "${CHOST}" ]
136     then
137     echo "${OLD_GCC_CHOST}" > "${WORKDIR}/.oldgccchost"
138     fi
139 azarah 1.12 fi
140    
141     # Did we check the version ?
142 azarah 1.18 touch "${WORKDIR}/.chkgccversion"
143 azarah 1.12 }
144    
145 azarah 1.1 src_unpack() {
146     if [ -z "${SNAPSHOT}" ]
147     then
148     unpack ${PN}-${MAIN_BRANCH}.tar.bz2
149 msterret 1.19
150 azarah 1.1 if [ -n "${PATCH_VER}" ]
151     then
152     unpack ${P}-patches-${PATCH_VER}.tar.bz2
153     fi
154     else
155     unpack gcc-${SNAPSHOT//-}.tar.bz2
156     fi
157    
158     cd ${S}
159     # Fixup libtool to correctly generate .la files with portage
160     elibtoolize --portage --shallow
161    
162     echo
163    
164     # Branch update ...
165     if [ -n "${BRANCH_UPDATE}" ]
166     then
167     epatch ${DISTDIR}/${PN}-${MAIN_BRANCH}-branch-update-${BRANCH_UPDATE}.patch.bz2
168     fi
169    
170     # Do bulk patches included in ${P}-patches-${PATCH_VER}.tar.bz2
171     if [ -n "${PATCH_VER}" ]
172     then
173     epatch ${WORKDIR}/patch
174     fi
175    
176     # Patches from Redhat ...
177 george 1.20 #epatch ${FILESDIR}/3.2.1/gcc32-ada-make.patch
178 azarah 1.1 epatch ${FILESDIR}/3.2.1/gcc32-shared-pthread.patch
179     use sparc && epatch ${FILESDIR}/3.2.1/gcc32-sparc32-hack.patch
180    
181     # Patches from Mandrake/Suse ...
182     epatch ${FILESDIR}/3.2.1/gcc31-loop-load-final-value.patch
183     epatch ${FILESDIR}/3.2.1/gcc32-pr8213.patch
184     epatch ${FILESDIR}/3.2.1/gcc32-strip-dotdot.patch
185     epatch ${FILESDIR}/3.2.1/gcc32-athlon-alignment.patch
186 zwelch 1.6
187     # Patches from debian-arm
188     if [ "${ARCH}" = "arm" ]; then
189 zwelch 1.7 epatch ${FILESDIR}/3.2.1/gcc32-arm-disable-mathf.patch
190 zwelch 1.6 epatch ${FILESDIR}/3.2.1/gcc32-arm-reload1-fix.patch
191     fi
192 azarah 1.1
193     # Install our pre generated manpages if we do not have perl ...
194     # if [ ! -x /usr/bin/perl ]
195     # then
196     # cd ${S}; unpack ${P}-manpages.tar.bz2
197     # fi
198    
199     # Currently if any path is changed via the configure script, it breaks
200     # installing into ${D}. We should not patch it in src_install() with
201     # absolute paths, as some modules then gets rebuild with the wrong
202     # paths. Thus we use $FAKE_ROOT.
203     einfo "Fixing Makefiles..."
204     cd ${S}
205     for x in $(find . -name Makefile.in)
206     do
207     # Fix --datadir=
208     cp ${x} ${x}.orig
209     sed -e 's:datadir = @datadir@:datadir = $(FAKE_ROOT)@datadir@:' \
210     ${x}.orig > ${x}
211 msterret 1.19
212 azarah 1.1 # Fix --bindir=
213     cp ${x} ${x}.orig
214     sed -e 's:bindir = @bindir@:bindir = $(FAKE_ROOT)@bindir@:' \
215     ${x}.orig > ${x}
216    
217     # Fix --includedir=
218     cp ${x} ${x}.orig
219     sed -e 's:includedir = @includedir@:includedir = $(FAKE_ROOT)@includedir@:' \
220     ${x}.orig > ${x}
221    
222     # Fix --with-gxx-include-dir=
223     cp ${x} ${x}.orig
224     sed -e 's:gxx_include_dir = @gxx_:gxx_include_dir = $(FAKE_ROOT)@gxx_:' \
225     -e 's:glibcppinstalldir = @gxx_:glibcppinstalldir = $(FAKE_ROOT)@gxx_:' \
226     ${x}.orig > ${x}
227 msterret 1.19
228 azarah 1.1 # Where java security stuff should be installed
229     cp ${x} ${x}.orig
230     sed -e 's:secdir = $(libdir)/security:secdir = $(FAKE_ROOT)$(LIBPATH)/security:' \
231     ${x}.orig > ${x}
232 msterret 1.19
233 azarah 1.1 rm -f ${x}.orig
234     done
235     }
236    
237     src_compile() {
238     local myconf=""
239     local gcc_lang=""
240 msterret 1.19
241 azarah 1.1 if [ -z "`use build`" ]
242     then
243     myconf="${myconf} --enable-shared"
244 george 1.20 gcc_lang="c,c++,f77,objc"
245 azarah 1.1 else
246     gcc_lang="c"
247     fi
248     if [ -z "`use nls`" ] || [ "`use build`" ]
249     then
250     myconf="${myconf} --disable-nls"
251     else
252     myconf="${myconf} --enable-nls --without-included-gettext"
253     fi
254     if [ -n "`use java`" ] && [ -z "`use build`" ]
255     then
256     gcc_lang="${gcc_lang},java"
257     fi
258    
259     # In general gcc does not like optimization, and add -O2 where
260     # it is safe.
261     export CFLAGS="${CFLAGS//-O?}"
262     export CXXFLAGS="${CXXFLAGS//-O?}"
263    
264     # Build in a separate build tree
265     mkdir -p ${WORKDIR}/build
266     cd ${WORKDIR}/build
267    
268     einfo "Configuring GCC..."
269     addwrite "/dev/zero"
270     ${S}/configure --prefix=${LOC} \
271     --bindir=${BINPATH} \
272     --includedir=${LIBPATH}/include \
273     --datadir=${DATAPATH} \
274     --mandir=${DATAPATH}/man \
275     --infodir=${DATAPATH}/info \
276     --enable-shared \
277     --host=${CHOST} \
278     --target=${CCHOST} \
279     --with-system-zlib \
280     --enable-languages=${gcc_lang} \
281     --enable-threads=posix \
282     --enable-long-long \
283     --disable-checking \
284     --enable-cstdio=stdio \
285     --enable-clocale=generic \
286     --enable-__cxa_atexit \
287     --enable-version-specific-runtime-libs \
288     --with-gxx-include-dir=${STDCXX_INCDIR} \
289     --with-local-prefix=${LOC}/local \
290     ${myconf} || die
291    
292     touch ${S}/gcc/c-gperf.h
293    
294     # Do not make manpages if we do not have perl ...
295     if [ ! -x /usr/bin/perl ]
296 msterret 1.19 then
297 azarah 1.1 find ${S} -name '*.[17]' -exec touch {} \; || :
298     fi
299    
300     # Setup -j in MAKEOPTS
301     get_number_of_jobs
302    
303     einfo "Building GCC..."
304 azarah 1.13 # Only build it static if we are just building the C frontend, else
305     # a lot of things break because there are not libstdc++.so ....
306     if [ -n "`use static`" -a "${gcc_lang}" = "c" ]
307 azarah 1.1 then
308     # Fix for our libtool-portage.patch
309     S="${WORKDIR}/build" \
310 azarah 1.13 emake LDFLAGS="-static" bootstrap \
311 azarah 1.1 LIBPATH="${LIBPATH}" \
312     BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
313     # Above FLAGS optimize and speedup build, thanks
314     # to Jeff Garzik <jgarzik@mandrakesoft.com>
315     else
316 azarah 1.13 # Fix for our libtool-portage.patch
317 azarah 1.1 S="${WORKDIR}/build" \
318 azarah 1.13 emake bootstrap-lean \
319 azarah 1.1 LIBPATH="${LIBPATH}" \
320     BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die
321     fi
322     }
323    
324     src_install() {
325     # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include as
326     # this can break the build.
327     for x in cd ${WORKDIR}/build/gcc/include/*
328     do
329     if [ -L ${x} ]
330     then
331     rm -f ${x}
332     fi
333     done
334    
335     einfo "Installing GCC..."
336     # Do the 'make install' from the build directory
337     cd ${WORKDIR}/build
338     S="${WORKDIR}/build" \
339     make prefix=${D}${LOC} \
340     bindir=${D}${BINPATH} \
341     includedir=${D}${LIBPATH}/include \
342     datadir=${D}${DATAPATH} \
343     mandir=${D}${DATAPATH}/man \
344     infodir=${D}${DATAPATH}/info \
345     LIBPATH="${LIBPATH}" \
346     FAKE_ROOT="${D}" \
347     install || die
348 msterret 1.19
349 azarah 1.1 [ -r ${D}${BINPATH}/gcc ] || die "gcc not found in ${D}"
350 msterret 1.19
351 azarah 1.1 dodir /lib /usr/bin
352     dodir /etc/env.d/gcc
353     echo "PATH=\"${BINPATH}\"" > ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
354     echo "ROOTPATH=\"${BINPATH}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
355     echo "LDPATH=\"${LIBPATH}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
356     echo "MANPATH=\"${DATAPATH}/man\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
357     echo "INFOPATH=\"${DATAPATH}/info\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
358     echo "STDCXX_INCDIR=\"${STDCXX_INCDIR##*/}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
359     # Also set CC and CXX
360     echo "CC=\"gcc\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
361     echo "CXX=\"g++\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL}
362 msterret 1.19
363 azarah 1.1 # Install wrappers
364     # Handled by gcc-config now ...
365     # exeinto /lib
366     # doexe ${FILESDIR}/cpp
367     # exeinto /usr/bin
368     # doexe ${FILESDIR}/cc
369 msterret 1.19
370 azarah 1.1 # This should be invalidated by the linker scripts we have as the latest
371     # fix for bug #4411
372     #
373     # # gcc-3.1 have a problem with the ordering of Search Directories. For
374     # # instance, if you have libreadline.so in /lib, and libreadline.a in
375     # # /usr/lib, then it will link with libreadline.a instead of .so. As far
376     # # as I can see from the source, /lib should be searched before /usr/lib,
377     # # and this also differs from gcc-2.95.3 and possibly 3.0.4, but ill have
378     # # to check on 3.0.4. Thanks to Daniel Robbins for noticing this oddity,
379     # # bugzilla bug #4411
380     # #
381     # # Azarah - 3 Jul 2002
382     # #
383     # cd ${D}${LIBPATH}
384     # dosed -e "s:%{L\*} %(link_libgcc):%{L\*} -L/lib %(link_libgcc):" \
385     # ${LIBPATH}/specs
386    
387     # Make sure we dont have stuff lying around that
388     # can nuke multiple versions of gcc
389     if [ -z "`use build`" ]
390     then
391     cd ${D}${LIBPATH}
392    
393     # Tell libtool files where real libraries are
394     for LA in ${D}${LOC}/lib/*.la ${D}${LIBPATH}/../*.la
395     do
396     if [ -f ${LA} ]
397     then
398     sed -e "s:/usr/lib:${LIBPATH}:" ${LA} > ${LA}.hacked
399     mv ${LA}.hacked ${LA}
400     mv ${LA} ${D}${LIBPATH}
401     fi
402     done
403    
404     # Move all the libraries to version specific libdir.
405     for x in ${D}${LOC}/lib/*.{so,a}* ${D}${LIBPATH}/../*.{so,a}*
406     do
407     [ -f ${x} ] && mv -f ${x} ${D}${LIBPATH}
408     done
409    
410     # Move Java headers to compiler-specific dir
411     for x in ${D}${LOC}/include/gc*.h ${D}${LOC}/include/j*.h
412     do
413     [ -f ${x} ] && mv -f ${x} ${D}${LIBPATH}/include/
414     done
415     for x in gcj gnu java javax org
416     do
417     if [ -d ${D}${LOC}/include/${x} ]
418     then
419     dodir /${LIBPATH}/include/${x}
420     mv -f ${D}${LOC}/include/${x}/* ${D}${LIBPATH}/include/${x}/
421     rm -rf ${D}${LOC}/include/${x}
422     fi
423     done
424    
425     # Move libgcj.spec to compiler-specific directories
426     [ -f ${D}${LOC}/lib/libgcj.spec ] && \
427     mv -f ${D}${LOC}/lib/libgcj.spec ${D}${LIBPATH}/libgcj.spec
428    
429     # Rename jar because it could clash with Kaffe's jar if this gcc is
430     # primary compiler (aka don't have the -<version> extension)
431     cd ${D}${LOC}/${CCHOST}/gcc-bin/${MY_PV}
432     [ -f jar ] && mv -f jar gcj-jar
433    
434     # Move <cxxabi.h> to compiler-specific directories
435     [ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \
436     mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/
437    
438     # These should be symlinks
439     cd ${D}${BINPATH}
440     rm -f ${CCHOST}-{gcc,g++,c++,g77}
441     [ -f gcc ] && ln -sf gcc ${CCHOST}-gcc
442     [ -f g++ ] && ln -sf g++ ${CCHOST}-g++
443     [ -f g++ ] && ln -sf g++ ${CCHOST}-c++
444     [ -f g77 ] && ln -sf g77 ${CCHOST}-g77
445     fi
446    
447     # This one comes with binutils
448     if [ -f ${D}${LOC}/lib/libiberty.a ]
449     then
450     rm -f ${D}${LOC}/lib/libiberty.a
451     fi
452    
453     cd ${S}
454 azarah 1.16 if [ -z "`use build`" ]
455     then
456 azarah 1.1 cd ${S}
457     docinto /${CCHOST}
458     dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README
459     docinto ${CCHOST}/html
460     dohtml *.html
461     cd ${S}/boehm-gc
462     docinto ${CCHOST}/boehm-gc
463     dodoc ChangeLog doc/{README*,barrett_diagram}
464     docinto ${CCHOST}/boehm-gc/html
465     dohtml doc/*.html
466     cd ${S}/gcc
467     docinto ${CCHOST}/gcc
468     dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE
469     cd ${S}/libf2c
470 azarah 1.16 docinto ${CCHOST}/libf2c
471     dodoc ChangeLog README TODO *.netlib
472 azarah 1.1 cd ${S}/libffi
473 azarah 1.16 docinto ${CCHOST}/libffi
474     dodoc ChangeLog* LICENSE README
475     cd ${S}/libiberty
476     docinto ${CCHOST}/libiberty
477     dodoc ChangeLog COPYING.LIB README
478     cd ${S}/libobjc
479     docinto ${CCHOST}/libobjc
480     dodoc ChangeLog README* THREADS*
481 azarah 1.1 cd ${S}/libstdc++-v3
482     docinto ${CCHOST}/libstdc++-v3
483     dodoc ChangeLog* README
484     docinto ${CCHOST}/libstdc++-v3/html
485     dohtml -r -a css,diff,html,txt,xml docs/html/*
486     cp -f docs/html/17_intro/[A-Z]* \
487     ${D}/usr/share/doc/${PF}/${DOCDESTTREE}/17_intro/
488 msterret 1.19
489 azarah 1.16 if [ -n "`use java`" ]
490     then
491 azarah 1.1 cd ${S}/fastjar
492     docinto ${CCHOST}/fastjar
493     dodoc AUTHORS CHANGES COPYING ChangeLog NEWS README
494     cd ${S}/libjava
495     docinto ${CCHOST}/libjava
496     dodoc ChangeLog* COPYING HACKING LIBGCJ_LICENSE NEWS README THANKS
497 azarah 1.16 fi
498     else
499     rm -rf ${D}/usr/share/{man,info}
500 azarah 1.1 fi
501    
502 azarah 1.12 # Rather install the script, else portage with changing $FILESDIR
503     # between binary and source package borks things ....
504     insinto /lib/rcscripts/awk
505     doins ${FILESDIR}/awk/fixlafiles.awk
506     exeinto /sbin
507     doexe ${FILESDIR}/fix_libtool_files.sh
508    
509 azarah 1.16 # Fix ncurses b0rking
510     find ${D}/ -name '*curses.h' -exec rm -f {} \;
511 azarah 1.1 }
512    
513 azarah 1.12 pkg_preinst() {
514    
515     if [ ! -f "${WORKDIR}/.chkgccversion" ]
516     then
517     chk_gcc_version
518     fi
519 azarah 1.14
520     # Make again sure that the linker "should" be able to locate
521     # libstdc++.so ...
522     export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
523     ${ROOT}/sbin/ldconfig
524 azarah 1.12 }
525    
526 azarah 1.1 pkg_postinst() {
527    
528 azarah 1.12 export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}"
529    
530     if [ "${ROOT}" = "/" -a "${COMPILER}" = "gcc3" -a "${CHOST}" = "${CCHOST}" ]
531 azarah 1.1 then
532     gcc-config --use-portage-chost ${CCHOST}-${MY_PV_FULL}
533     fi
534    
535     # Update libtool linker scripts to reference new gcc version ...
536 azarah 1.18 if [ "${ROOT}" = "/" ] && \
537     [ -f "${WORKDIR}/.oldgccversion" -o -f "${WORKDIR}/.oldgccchost" ]
538 msterret 1.19 then
539 azarah 1.18 local OLD_GCC_VERSION=
540     local OLD_GCC_CHOST=
541    
542     if [ -f "${WORKDIR}/.oldgccversion" ] && \
543     [ -n "$(cat "${WORKDIR}/.oldgccversion")" ]
544     then
545     OLD_GCC_VERSION="$(cat "${WORKDIR}/.oldgccversion")"
546     else
547     OLD_GCC_VERSION="${MY_PV_FULL}"
548     fi
549 msterret 1.19
550 azarah 1.18 if [ -f "${WORKDIR}/.oldgccchost" ] && \
551     [ -n "$(cat "${WORKDIR}/.oldgccchost")" ]
552     then
553     OLD_GCC_CHOST="--oldarch $(cat "${WORKDIR}/.oldgccchost")"
554     fi
555 azarah 1.1
556 azarah 1.18 /sbin/fix_libtool_files.sh ${OLD_GCC_VERSION} ${OLD_GCC_CHOST}
557 azarah 1.1 fi
558 msterret 1.19
559 azarah 1.1 # Fix ncurses b0rking (if r5 isn't unmerged)
560     find ${ROOT}/usr/lib/gcc-lib -name '*curses.h' -exec rm -f {} \;
561     }

  ViewVC Help
Powered by ViewVC 1.1.20