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

Contents of /sys-devel/gcc/gcc-3.2.3-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (show annotations) (download)
Wed Jul 20 08:58:35 2011 UTC (3 years, 5 months ago) by dirtyepic
Branch: MAIN
Changes since 1.29: +89 -89 lines
Repoman talks too much.

(Portage version: 2.2.0_alpha46/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20