/[gentoo-x86]/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild
Gentoo

Contents of /sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Thu Jun 26 08:24:44 2014 UTC (3 months, 3 weeks ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +4 -2 lines
Filter out -frecord-gcc-switches. Require <bison-3 until the underlying issue is fixed properly, bug #509572.

(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r1.ebuild,v 1.12 2014/02/16 19:29:29 vapier Exp $
4
5 inherit eutils flag-o-matic libtool multilib
6
7 transform_known_flags() {
8 declare setting
9
10 # and on x86, we just need to filter the 3.4 specific amd64 -marchs
11 replace-cpu-flags k8 athlon64 opteron x86-64
12
13 # gcc 3.3 doesn't support -march=pentium-m
14 replace-cpu-flags pentium-m pentium3m pentium3
15
16 #GCC 3.3 does not understand G3, G4, G5 on ppc
17 replace-cpu-flags G3 750
18 replace-cpu-flags G4 7400
19 replace-cpu-flags G5 7400
20 }
21
22 is_arch_allowed() {
23 i386_processor_table="i386 i486 i586 pentium pentium-mmx winchip-c6 \
24 winchip2 c3 i686 pentiumpro pentium2 pentium3 pentium4 prescott \
25 nocona k6 k6-2 k6-3 athlon athlon-tbird x86-64 athlon-4 athlon-xp \
26 athlon-mp"
27
28 for proc in ${i386_processor_table} ; do
29 [ "${proc}" == "${1}" ] && return 0
30 done
31
32 mips_processor_table="mips1 mips2 mips3 mips4 mips32 mips64 r3000 r2000 \
33 r3900 r6000 r4000 vr4100 vr4111 vr4120 vr4300 r4400 r4600 orion \
34 r4650 r8000 vr5000 vr5400 vr5500 4kc 4kp 5kc 20kc sr71000 sb1"
35
36 for proc in ${mips_processor_table} ; do
37 [ "${proc}" == "${1}" ] && return 0
38 done
39
40 rs6000_processor_table="common power power2 power3 power4 powerpc \
41 powerpc64 rios rios1 rsc rsc1 rios2 rs64a 401 403 405 505 601 602 \
42 603 603e ec603e 604 604e 620 630 740 750 7400 7450 8540 801 821 823 \
43 860"
44
45 for proc in ${rs6000_processor_table} ; do
46 [ "${proc}" == "${1}" ] && return 0
47 done
48
49 return 1
50 }
51
52 do_filter_flags() {
53 declare setting
54
55 # In general gcc does not like optimization, and add -O2 where
56 # it is safe. This is especially true for gcc 3.3 + 3.4
57 replace-flags -O? -O2
58
59 # gcc 3.3 doesn't support -mtune on numerous archs, so xgcc will fail
60 setting="`get-flag mtune`"
61 [ ! -z "${setting}" ] && filter-flags -mtune="${setting}"
62
63 # in gcc 3.3 there is a bug on ppc64 where if -mcpu is used
64 # the compiler incorrectly assumes the code you are about to build
65 # is 32 bit
66 use ppc64 && setting="`get-flag mcpu`"
67 [ ! -z "${setting}" ] && filter-flags -mcpu="${setting}"
68
69 # only allow the flags that we -know- are supported
70 transform_known_flags
71 setting="`get-flag march`"
72 if [ ! -z "${setting}" ] ; then
73 is_arch_allowed "${setting}" || filter-flags -march="${setting}"
74 fi
75 setting="`get-flag mcpu`"
76 if [ ! -z "${setting}" ] ; then
77 is_arch_allowed "${setting}" || filter-flags -mcpu="${setting}"
78 fi
79
80 # xgcc wont understand gcc 3.4 flags...
81 filter-flags -fno-unit-at-a-time
82 filter-flags -funit-at-a-time
83 filter-flags -fweb
84 filter-flags -fno-web
85 filter-flags -mno-tls-direct-seg-refs
86
87 # xgcc isnt patched with propolice
88 filter-flags -fstack-protector-all
89 filter-flags -fno-stack-protector-all
90 filter-flags -fstack-protector
91 filter-flags -fno-stack-protector
92
93 # xgcc isnt patched with the gcc symbol visibility patch
94 filter-flags -fvisibility-inlines-hidden
95 filter-flags -fvisibility=hidden
96
97 # Bug #269433 & #290202
98 filter-flags -fno-strict-overflow
99 filter-flags -fstrict-overflow
100
101 # Bug #442784
102 filter-flags '-W*'
103
104 filter-flags -frecord-gcc-switches
105
106 # ...sure, why not?
107 strip-unsupported-flags
108
109 strip-flags
110 }
111
112 PATCH_VER="1.8"
113
114 DESCRIPTION="Compatibility package for running binaries linked against a pre gcc 3.4 libstdc++"
115 HOMEPAGE="http://gcc.gnu.org/libstdc++/"
116 SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2
117 mirror://gentoo/gcc-${PV}-patches-${PATCH_VER}.tar.bz2"
118
119 LICENSE="GPL-2 LGPL-2.1"
120 SLOT="5"
121 KEYWORDS="amd64 ~mips ppc -ppc64 sparc x86 ~x86-fbsd"
122 IUSE="multilib nls"
123
124 DEPEND="<sys-devel/bison-3"
125 RDEPEND=""
126
127 S=${WORKDIR}/gcc-${PV}
128
129 src_unpack() {
130 unpack ${A}
131 cd "${S}"
132 EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
133 elibtoolize --portage --shallow
134 ./contrib/gcc_update --touch
135 mkdir -p "${WORKDIR}"/build
136
137 if use multilib && [[ ${SYMLINK_LIB} == "yes" ]] ; then
138 # ugh, this shit has to match the way we've hacked gcc else
139 # the build falls apart #259215
140 sed -i \
141 -e 's:\(MULTILIB_OSDIRNAMES = \).*:\1../lib64 ../lib32:' \
142 "${S}"/gcc/config/i386/t-linux64 \
143 || die "sed failed!"
144 fi
145 }
146
147 src_compile() {
148 cd "${WORKDIR}"/build
149 do_filter_flags
150 ECONF_SOURCE=${S} \
151 econf \
152 --enable-shared \
153 --with-system-zlib \
154 --enable-languages=c++ \
155 --enable-threads=posix \
156 --enable-long-long \
157 --disable-checking \
158 --enable-cstdio=stdio \
159 --enable-__cxa_atexit \
160 $(use_enable multilib) \
161 $(use_enable nls) \
162 $(use_with !nls included-gettext)
163
164 touch "${S}"/gcc/c-gperf.h
165
166 emake all-target-libstdc++-v3 || die
167 }
168
169 src_install() {
170 emake -j1 \
171 -C "${WORKDIR}"/build \
172 DESTDIR="${D}" \
173 install-target-libstdc++-v3 || die
174
175 # scrub everything but the library we care about
176 pushd "${D}" >/dev/null
177 mv usr/lib* . || die
178 rm -rf usr
179 rm -f lib*/*.{a,la,so} || die
180 dodir /usr
181 mv lib* usr/ || die
182 }

  ViewVC Help
Powered by ViewVC 1.1.20