/[gentoo-x86]/eclass/mozilla.eclass
Gentoo

Contents of /eclass/mozilla.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.35 - (show annotations) (download)
Mon Nov 30 04:19:36 2009 UTC (4 years, 9 months ago) by abcd
Branch: MAIN
CVS Tags: HEAD
Changes since 1.34: +1 -1 lines
FILE REMOVED
Remove eclasses that have been marked as deprecated for >=2 years; schedule other deprecated eclasses for removal

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/mozilla.eclass,v 1.34 2009/01/04 22:09:06 ulm Exp $
4 #
5 # You probably don't want to change this eclass. Newer ebuilds use
6 # mozconfig.eclass instead.
7
8
9 IUSE="java gnome gtk2 ldap debug xinerama xprint"
10 # Internal USE flags that I do not really want to advertise ...
11 IUSE="${IUSE} moznoxft"
12 [[ ${PN} == mozilla || ${PN} == mozilla-firefox ]] && \
13 IUSE="${IUSE} mozdevelop mozxmlterm"
14 [[ ${PN} == mozilla ]] && \
15 IUSE="${IUSE} mozsvg"
16
17 RDEPEND="
18 !moznoxft? ( x11-libs/libXft )
19 >=media-libs/fontconfig-2.1
20 >=sys-libs/zlib-1.1.4
21 >=media-libs/jpeg-6b
22 >=media-libs/libmng-1.0.0
23 >=media-libs/libpng-1.2.1
24 dev-libs/expat
25 app-arch/zip
26 app-arch/unzip
27 gtk2? (
28 >=x11-libs/gtk+-2.2.0
29 >=dev-libs/glib-2.2.0
30 >=x11-libs/pango-1.2.1
31 >=dev-libs/libIDL-0.8.0
32 gnome? ( >=gnome-base/gnome-vfs-2.3.5 ) )
33 !gtk2? (
34 =x11-libs/gtk+-1.2*
35 =dev-libs/glib-1.2*
36 =gnome-base/orbit-0* )
37 >=www-client/mozilla-launcher-1.22"
38
39 DEPEND="${RDEPEND}
40 dev-util/pkgconfig"
41
42 # Set by configure (plus USE_AUTOCONF=1), but useful for NSPR
43 export MOZILLA_CLIENT=1
44 export BUILD_OPT=1
45 export NO_STATIC_LIB=1
46 export USE_PTHREADS=1
47
48 mozilla_conf() {
49 declare enable_optimize pango_version myext x
50 declare MOZ=$([[ ${PN} == mozilla ]] && echo true || echo false)
51 declare FF=$([[ ${PN} == *firefox ]] && echo true || echo false)
52 declare TB=$([[ ${PN} == *thunderbird ]] && echo true || echo false)
53
54 ####################################
55 #
56 # CFLAGS setup and ARCH support
57 #
58 ####################################
59
60 # Set optimization level based on CFLAGS
61 if is-flag -O0; then
62 mozilla_annotate "from CFLAGS" --enable-optimize=-O0
63 elif [[ ${ARCH} == hppa ]]; then
64 mozconfig_annotate "more than -O0 causes segfaults on hppa" --enable-optimize=-O0
65 elif [[ ${ARCH} == alpha || ${ARCH} == amd64 || ${ARCH} == ia64 || ${ARCH} == ppc64 ]]; then
66 mozilla_annotate "more than -O1 causes segfaults on 64-bit (bug 33767)" \
67 --enable-optimize=-O1
68 elif is-flag -O1; then
69 mozilla_annotate "from CFLAGS" --enable-optimize=-O1
70 else
71 mozilla_annotate "mozilla fallback" --enable-optimize=-O2
72 fi
73
74 # Now strip optimization from CFLAGS so it doesn't end up in the
75 # compile string
76 filter-flags '-O*'
77
78 # Strip over-aggressive CFLAGS - Mozilla supplies its own
79 # fine-tuned CFLAGS and shouldn't be interfered with.. Do this
80 # AFTER setting optimization above since strip-flags only allows
81 # -O -O1 and -O2
82 strip-flags
83
84 # Additional ARCH support
85 case "${ARCH}" in
86 alpha|amd64|ia64)
87 # Historically we have needed to add this manually for 64-bit
88 append-flags -fPIC
89 ;;
90
91 ppc64)
92 append-flags -mminimal-toc
93 append-flags -fPIC
94 ;;
95
96 ppc)
97 # Fix to avoid gcc-3.3.x micompilation issues.
98 if [[ $(gcc-major-version).$(gcc-minor-version) == 3.3 ]]; then
99 append-flags -fno-strict-aliasing
100 fi
101 ;;
102
103 sparc)
104 # Sparc support ...
105 replace-sparc64-flags
106 ;;
107
108 x86)
109 if [[ $(gcc-major-version) -eq 3 ]]; then
110 # gcc-3 prior to 3.2.3 doesn't work well for pentium4
111 # see bug 25332
112 if [[ $(gcc-minor-version) -lt 2 ||
113 ( $(gcc-minor-version) -eq 2 && $(gcc-micro-version) -lt 3 ) ]]
114 then
115 replace-flags -march=pentium4 -march=pentium3
116 filter-flags -msse2
117 fi
118 fi
119 ;;
120 esac
121
122 if [[ $(gcc-major-version) -eq 3 ]]; then
123 # Enable us to use flash, etc plugins compiled with gcc-2.95.3
124 mozilla_annotate "building with >=gcc-3" --enable-old-abi-compat-wrappers
125
126 # Needed to build without warnings on gcc-3
127 CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
128 fi
129
130 ####################################
131 #
132 # myconf setup
133 #
134 ####################################
135
136 # myconf should be declared local by the caller (src_compile).
137 myconf="${myconf} \
138 --disable-activex \
139 --disable-activex-scripting \
140 --disable-installer \
141 --disable-pedantic \
142 --enable-crypto \
143 --enable-xterm-updates \
144 --with-pthreads \
145 --with-system-jpeg \
146 --with-system-png \
147 --with-system-zlib \
148 --with-x \
149 --without-system-nspr \
150 --enable-default-toolkit=gtk2 \
151 $(mozilla_use_enable ipv6) \
152 $(mozilla_use_enable xinerama) \
153 $(mozilla_use_enable xprint) \
154 $(mozilla_use_enable truetype freetype2) \
155 $(mozilla_use_enable truetype freetypetest)"
156
157 # NOTE: QT and XLIB toolkit seems very unstable, leave disabled until
158 # tested ok -- azarah
159 if use gtk2; then
160 mozilla_annotate +gtk2 --enable-default-toolkit=gtk2
161 myconf="${myconf} $(mozilla_use_enable gnome gnomevfs)"
162 else
163 mozilla_annotate -gtk2 --enable-default-toolkit=gtk
164 mozilla_annotate -gtk2 --disable-gnomevfs
165 fi
166
167 if use debug; then
168 mozilla_annotate +debug \
169 --enable-debug \
170 --enable-tests \
171 --disable-reorder \
172 --disable-strip \
173 --disable-strip-libs \
174 --enable-debugger-info-modules=ALL_MODULES
175 else
176 mozilla_annotate -debug \
177 --disable-debug \
178 --disable-tests \
179 --enable-reorder \
180 --enable-strip \
181 --enable-strip-libs
182
183 # Currently --enable-elf-dynstr-gc only works for x86 and ppc,
184 # thanks to Jason Wever <weeve@gentoo.org> for the fix.
185 if use x86 || use ppc && [[ ${enable_optimize} != -O0 ]]; then
186 mozilla_annotate "${ARCH} optimized build" --enable-elf-dynstr-gc
187 fi
188 fi
189
190 # Here is a strange one...
191 if is-flag '-mcpu=ultrasparc*'; then
192 mozilla_annotate "building on ultrasparc" --enable-js-ultrasparc
193 fi
194
195 # Check if we should enable Xft support...
196 if use moznoxft; then
197 mozilla_annotate "disabling xft2 by request (+moznoxft)" --disable-xft
198 elif use gtk2; then
199 # We need Xft2.0 locally installed
200 if [[ -x /usr/bin/pkg-config ]] && pkg-config xft; then
201 # We also need pango-1.1, else Mozilla links to both
202 # Xft1.1 *and* Xft2.0, and segfault...
203 pango_version=$(pkg-config --modversion pango | cut -d. -f1,2)
204 if [[ ${pango_version//.} -gt 10 ]]; then
205 mozilla_annotate "gtk2 with xft2 (+gtk2 -moznoxft)" --enable-xft
206 else
207 mozilla_annotate "gtk2 without xft2 (bad pango version <1.1)" --disable-xft
208 fi
209 else
210 mozilla_annotate "gtk2 without xft2 (no pkg-config xft)" --disable-xft
211 fi
212 else
213 mozilla_annotate "gtk1 with xft2 (-gtk2 -moznoxft)" --enable-xft
214 fi
215
216 # Support some development/debugging stuff for web developers
217 if ( ${MOZ} || ${FF} ) && use mozdevelop; then
218 mozilla_annotate "+mozdevelop on ${PN}" \
219 --enable-jsd \
220 --enable-xpctools
221 else
222 mozilla_annotate "n/a on ${PN}" \
223 --disable-jsd \
224 --disable-xpctools
225 fi
226
227 # Some browser-only flags
228 if ${MOZ} || ${FF}; then
229 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
230 # regardless of java setting.
231 myconf="${myconf} --enable-oji \
232 --enable-mathml"
233 else
234 mozilla_annotate "n/a on ${PN}" --disable-oji
235 fi
236
237 # Some mailer-only flags
238 if ${TB}; then
239 # Set up extensions
240 if [[ ${PV} < 0.8 ]]; then
241 myext="pref,spellcheck,universalchardet,wallet"
242 else
243 myext="wallet,spellcheck,xmlextras,webservices"
244 fi
245
246 myconf="${myconf} --enable-single-profile \
247 --enable-necko-protocols=http,file,jar,viewsource,res,data \
248 --enable-image-decoders=default,-xbm \
249 $(mozilla_use_enable ldap) \
250 $(mozilla_use_enable ldap ldap-experimental) \
251 --enable-extensions=${myext}"
252
253 mozilla_annotate "n/a on ${PN}" \
254 --disable-calendar \
255 --disable-svg \
256 --disable-necko-disk-cache \
257 --disable-profilesharing \
258 --disable-plugins
259 fi
260
261 # Some firefox-only flags
262 if ${FF}; then
263 # Set up extensions
264 myext="cookie,inspector,negotiateauth,pref,transformiix,universalchardet,webservices,xmlextras,xml-rpc"
265 [[ ${PV} < 1.0 ]] && myext="${myext},typeaheadfind"
266 use mozdevelop && myext="${myext},venkman"
267 use gnome && use gtk2 && myext="${myext},gnomevfs"
268
269 myconf="${myconf} \
270 --enable-single-profile \
271 --enable-extensions=${myext}"
272
273 mozilla_annotate "n/a on ${PN}" \
274 --disable-mailnews \
275 --disable-composer \
276 --disable-ldap \
277 --disable-profilesharing
278 fi
279
280 # Some moz-only flags
281 if ${MOZ}; then
282 # Set up extensions
283 myext="default"
284 use mozdevelop && myext="${myext},venkman"
285 use gnome && myext="${myext},gnomevfs"
286 use moznoirc && myext="${myext},-irc"
287 use mozxmlterm && myext="${myext},xmlterm"
288
289 myconf="${myconf} \
290 $(mozilla_use_enable mozcalendar calendar) \
291 $(mozilla_use_enable ldap) \
292 $(mozilla_use_enable ldap ldap-experimental) \
293 --enable-extensions=${myext}"
294
295 if use moznomail && ! use mozcalendar; then
296 mozilla_annotate "+moznomail -mozcalendar" --disable-mailnews
297 fi
298 if use moznocompose && use moznomail; then
299 mozilla_annotate "+moznocompose +moznomail" --disable-composer
300 fi
301 # Re-enabled per bug 24522 (28 Apr 2004 agriffis)
302 if use mozsvg; then
303 export MOZ_INTERNAL_LIBART_LGPL=1
304 mozilla_annotate "+mozsvg on ${PN}" \
305 --enable-svg --enable-svg-renderer-libart
306 else
307 mozilla_annotate "-mozsvg" \
308 --disable-svg
309 fi
310 fi
311
312 # Report!
313 echo
314 echo "=========================================================="
315 echo "Building ${PF} with the following configuration"
316 for x in $(echo ${myconf} | sed 's/ /\n/g' | sort); do
317 mozilla_explain "${x}"
318 done
319 echo "=========================================================="
320 echo
321 }
322
323 # Simulate the silly csh makemake script
324 makemake() {
325 typeset m topdir
326 for m in $(find . -name Makefile.in); do
327 topdir=$(echo "$m" | sed -r 's:[^/]+:..:g')
328 sed -e "s:@srcdir@:.:g" -e "s:@top_srcdir@:${topdir}:g" \
329 < ${m} > ${m%.in} || die "sed ${m} failed"
330 done
331 }
332
333 #
334 # The following functions are internal to mozilla.eclass
335 #
336
337 mozilla_use_enable() {
338 declare flag=$(use_enable "$@")
339 mozilla_annotate "$(useq ${1} && echo +${1} || echo -${1})" "${flag}"
340 echo "${flag}"
341 }
342
343 mozilla_annotate() {
344 declare reason=${1} x ; shift
345 [[ $# -gt 0 ]] || die "mozilla_annotate missing flags for ${reason}!"
346 mkdir -p ${T}/annotations
347 for x in ${*}; do
348 myconf="${myconf} ${x}"
349 echo "${reason}" > "${T}/annotations/${x%%=*}"
350 done
351 }
352
353 mozilla_explain() {
354 printf " %-30s %s\n" "${1}" "$(cat "${T}/annotations/${1%%=*}" 2>/dev/null)"
355 }

  ViewVC Help
Powered by ViewVC 1.1.20