1 |
commit: 7b4d4636f026dcdd9d366af42cf555f14c3101de |
2 |
Author: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 4 01:38:21 2014 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 4 01:38:21 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=7b4d4636 |
7 |
|
8 |
[qt4-build-multilib.eclass] Convert ${conf} to a bash array. |
9 |
|
10 |
--- |
11 |
eclass/qt4-build-multilib.eclass | 168 ++++++++++++++++++++++----------------- |
12 |
1 file changed, 95 insertions(+), 73 deletions(-) |
13 |
|
14 |
diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass |
15 |
index 0e26497..27e610d 100644 |
16 |
--- a/eclass/qt4-build-multilib.eclass |
17 |
+++ b/eclass/qt4-build-multilib.eclass |
18 |
@@ -59,6 +59,11 @@ EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_i |
19 |
# Space-separated list of directories that will be configured, |
20 |
# compiled, and installed. All paths must be relative to ${S}. |
21 |
|
22 |
+# @ECLASS-VARIABLE: QT4_VERBOSE_BUILD |
23 |
+# @DESCRIPTION: |
24 |
+# Set to false to reduce build output during compilation. |
25 |
+: ${QT4_VERBOSE_BUILD:=true} |
26 |
+ |
27 |
# @FUNCTION: qt4-build-multilib_src_unpack |
28 |
# @DESCRIPTION: |
29 |
# Unpacks the sources. |
30 |
@@ -124,6 +129,12 @@ qt4-build-multilib_src_prepare() { |
31 |
-e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \ |
32 |
mkspecs/$(qt4_get_mkspec)/qmake.conf \ |
33 |
|| die "sed failed (aqua)" |
34 |
+ |
35 |
+ # we are crazy and build cocoa + qt3support |
36 |
+ if { ! in_iuse qt3support || use qt3support; } && [[ ${CHOST##*-darwin} -ge 9 ]]; then |
37 |
+ sed -i -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ |
38 |
+ configure || die "sed failed (cocoa + qt3support)" |
39 |
+ fi |
40 |
fi |
41 |
|
42 |
# Bug 261632 |
43 |
@@ -246,97 +257,108 @@ multilib_src_configure() { |
44 |
export AR="$(tc-getAR) cqs" |
45 |
export LD="$(tc-getCXX)" |
46 |
|
47 |
- # configure arguments |
48 |
- local conf=" |
49 |
- -prefix ${QT4_PREFIX} |
50 |
- -bindir ${QT4_BINDIR} |
51 |
- -libdir ${QT4_LIBDIR} |
52 |
- -docdir ${QT4_DOCDIR} |
53 |
- -headerdir ${QT4_HEADERDIR} |
54 |
- -plugindir ${QT4_PLUGINDIR} |
55 |
- -importdir ${QT4_IMPORTDIR} |
56 |
- -datadir ${QT4_DATADIR} |
57 |
- -translationdir ${QT4_TRANSLATIONDIR} |
58 |
- -sysconfdir ${QT4_SYSCONFDIR} |
59 |
- -examplesdir ${QT4_EXAMPLESDIR} |
60 |
- -demosdir ${QT4_DEMOSDIR} |
61 |
- -opensource -confirm-license |
62 |
- -shared -fast -largefile -stl -verbose |
63 |
- -nomake examples -nomake demos" |
64 |
- |
65 |
# convert tc-arch to the values supported by Qt |
66 |
+ local arch= |
67 |
case $(tc-arch) in |
68 |
- amd64|x64-*) conf+=" -arch x86_64" ;; |
69 |
- ppc*-macos) conf+=" -arch ppc" ;; |
70 |
- ppc*) conf+=" -arch powerpc" ;; |
71 |
- sparc*) conf+=" -arch sparc" ;; |
72 |
- x86-macos) conf+=" -arch x86" ;; |
73 |
- x86*) conf+=" -arch i386" ;; |
74 |
- alpha|arm|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;; |
75 |
- hppa|sh) conf+=" -arch generic" ;; |
76 |
- *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; |
77 |
+ amd64|x64-*) arch=x86_64 ;; |
78 |
+ ppc*-macos) arch=ppc ;; |
79 |
+ ppc*) arch=powerpc ;; |
80 |
+ sparc*) arch=sparc ;; |
81 |
+ x86-macos) arch=x86 ;; |
82 |
+ x86*) arch=i386 ;; |
83 |
+ alpha|arm|ia64|mips|s390) arch=$(tc-arch) ;; |
84 |
+ hppa|sh) arch=generic ;; |
85 |
+ *) die "qt4-build-multilib.eclass: unsupported tc-arch '$(tc-arch)'" ;; |
86 |
esac |
87 |
|
88 |
- conf+=" -platform $(qt4_get_mkspec)" |
89 |
+ # configure arguments |
90 |
+ local conf=( |
91 |
+ # installation paths |
92 |
+ -prefix "${QT4_PREFIX}" |
93 |
+ -bindir "${QT4_BINDIR}" |
94 |
+ -libdir "${QT4_LIBDIR}" |
95 |
+ -docdir "${QT4_DOCDIR}" |
96 |
+ -headerdir "${QT4_HEADERDIR}" |
97 |
+ -plugindir "${QT4_PLUGINDIR}" |
98 |
+ -importdir "${QT4_IMPORTDIR}" |
99 |
+ -datadir "${QT4_DATADIR}" |
100 |
+ -translationdir "${QT4_TRANSLATIONDIR}" |
101 |
+ -sysconfdir "${QT4_SYSCONFDIR}" |
102 |
+ -examplesdir "${QT4_EXAMPLESDIR}" |
103 |
+ -demosdir "${QT4_DEMOSDIR}" |
104 |
+ |
105 |
+ # debug/release |
106 |
+ $(use_if_iuse debug && echo -debug || echo -release) |
107 |
+ -no-separate-debug-info |
108 |
+ |
109 |
+ # licensing stuff |
110 |
+ -opensource -confirm-license |
111 |
|
112 |
- # debug/release |
113 |
- if use_if_iuse debug; then |
114 |
- conf+=" -debug" |
115 |
- else |
116 |
- conf+=" -release" |
117 |
- fi |
118 |
- conf+=" -no-separate-debug-info" |
119 |
+ # build shared libraries |
120 |
+ -shared |
121 |
|
122 |
- # skip recursive processing of .pro files at the end of configure |
123 |
- # (we run qmake by ourselves), thus saving quite a bit of time |
124 |
- conf+=" -dont-process" |
125 |
+ # misc stuff |
126 |
+ -fast -largefile |
127 |
|
128 |
- # exceptions USE flag |
129 |
- conf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)" |
130 |
+ # skip recursive processing of .pro files at the end of configure |
131 |
+ # (we run qmake by ourselves), thus saving quite a bit of time |
132 |
+ -dont-process |
133 |
|
134 |
- # disable rpath (bug 380415), except on prefix (bug 417169) |
135 |
- use prefix || conf+=" -no-rpath" |
136 |
+ # exceptions USE flag |
137 |
+ $(in_iuse exceptions && qt_use exceptions || echo -exceptions) |
138 |
|
139 |
- # precompiled headers don't work on hardened, where the flag is masked |
140 |
- conf+=" $(in_iuse pch && qt_use pch || echo -no-pch)" |
141 |
+ # build STL support |
142 |
+ -stl |
143 |
|
144 |
- # -reduce-relocations |
145 |
- # This flag seems to introduce major breakage to applications, |
146 |
- # mostly to be seen as a core dump with the message "QPixmap: Must |
147 |
- # construct a QApplication before a QPaintDevice" on Solaris. |
148 |
- # -- Daniel Vergien |
149 |
- [[ ${CHOST} != *-solaris* ]] && conf+=" -reduce-relocations" |
150 |
+ # architecture/platform (mkspec) |
151 |
+ -arch ${arch} |
152 |
+ -platform $(qt4_get_mkspec) |
153 |
|
154 |
- # this one is needed for all systems with a separate -liconv, apart from |
155 |
- # Darwin, for which the sources already cater for -liconv |
156 |
- if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then |
157 |
- conf+=" -liconv" |
158 |
- fi |
159 |
+ # prefer system libraries |
160 |
+ -system-zlib |
161 |
+ |
162 |
+ # exclude examples and demos from default build |
163 |
+ -nomake examples |
164 |
+ -nomake demos |
165 |
+ |
166 |
+ # disable rpath on non-prefix (bugs 380415 and 417169) |
167 |
+ $(use prefix || echo -no-rpath) |
168 |
+ |
169 |
+ # verbosity of the configure and build phases |
170 |
+ -verbose $(${QT4_VERBOSE_BUILD} || echo -silent) |
171 |
+ |
172 |
+ # precompiled headers don't work on hardened, where the flag is masked |
173 |
+ $(in_iuse pch && qt_use pch || echo -no-pch) |
174 |
+ |
175 |
+ # enable linker optimizations to reduce relocations, except on Solaris |
176 |
+ # where this flag seems to introduce major breakage to applications, |
177 |
+ # mostly to be seen as a core dump with the message: |
178 |
+ # "QPixmap: Must construct a QApplication before a QPaintDevice" |
179 |
+ $([[ ${CHOST} != *-solaris* ]] && echo -reduce-relocations) |
180 |
+ |
181 |
+ # this one is needed for all systems with a separate -liconv, apart from |
182 |
+ # Darwin, for which the sources already cater for -liconv |
183 |
+ $(use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] && echo -liconv) |
184 |
+ ) |
185 |
|
186 |
if use_if_iuse aqua; then |
187 |
- # On (snow) leopard use the new (frameworked) cocoa code. |
188 |
if [[ ${CHOST##*-darwin} -ge 9 ]]; then |
189 |
- conf+=" -cocoa -framework" |
190 |
- # We need the source's headers, not the installed ones. |
191 |
- conf+=" -I${S}/include" |
192 |
- # Add hint for the framework location. |
193 |
- conf+=" -F${QT4_LIBDIR}" |
194 |
- |
195 |
- # We are crazy and build cocoa + qt3support :-) |
196 |
- if use_if_iuse qt3support; then |
197 |
- sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ |
198 |
- -i configure || die |
199 |
- fi |
200 |
+ conf+=( |
201 |
+ # on (snow) leopard use the new (frameworked) cocoa code |
202 |
+ -cocoa -framework |
203 |
+ # add hint for the framework location |
204 |
+ -F"${QT4_LIBDIR}" |
205 |
+ ) |
206 |
else |
207 |
- conf+=" -no-framework" |
208 |
+ conf+=(-no-framework) |
209 |
fi |
210 |
fi |
211 |
|
212 |
# append module-specific arguments |
213 |
- conf+=" ${myconf}" |
214 |
+ conf+=(${myconf}) |
215 |
|
216 |
- einfo "Configuring with:" ${conf} |
217 |
- "${S}"/configure ${conf} || die "configure failed" |
218 |
+ einfo "Configuring with: ${conf[@]}" |
219 |
+ "${S}"/configure "${conf[@]}" || die "configure failed" |
220 |
|
221 |
# configure is stupid and assigns QMAKE_LFLAGS twice, |
222 |
# thus the previous -rpath-link flag gets overwritten |
223 |
@@ -712,7 +734,7 @@ qt4_get_mkspec() { |
224 |
*-solaris*) |
225 |
spec=solaris ;; |
226 |
*) |
227 |
- die "${FUNCNAME}(): Unsupported CHOST '${CHOST}'" ;; |
228 |
+ die "qt4-build-multilib.eclass: unsupported CHOST '${CHOST}'" ;; |
229 |
esac |
230 |
|
231 |
case $(tc-getCXX) in |
232 |
@@ -733,7 +755,7 @@ qt4_get_mkspec() { |
233 |
spec+=-g++ |
234 |
fi ;; |
235 |
*) |
236 |
- die "${FUNCNAME}(): Unsupported compiler '$(tc-getCXX)'" ;; |
237 |
+ die "qt4-build-multilib.eclass: unsupported compiler '$(tc-getCXX)'" ;; |
238 |
esac |
239 |
|
240 |
# Add -64 for 64-bit prefix profiles |