Annotation of /trunk/include/multilib.sminc
Parent Directory | Revision Log
Revision 29795 -
(hide annotations)
(download)
Thu Oct 12 11:55:58 2017 UTC (7 years ago) by niro
File size: 13753 byte(s)
Thu Oct 12 11:55:58 2017 UTC (7 years ago) by niro
File size: 13753 byte(s)
-removed broken ABI_DO_NOT_ENTER_SRCDIR feature
1 | niro | 6346 | # $Id$ |
2 | niro | 2 | # multilib abis |
3 | |||
4 | niro | 11547 | # tell the buildsystem that we are doing a multilib build |
5 | export MULTILIB_BUILD="true" | ||
6 | niro | 11544 | |
7 | niro | 8334 | # be verbose or nor (true|false} |
8 | : ${MULTILIB_VERBOSE="true"} | ||
9 | |||
10 | niro | 11029 | # multilib should call all dependant includes, which gets overridden |
11 | niro | 11030 | sminclude mtools |
12 | niro | 11029 | |
13 | niro | 2 | # do not define EMUL_LINUX_32 after inherit of multlib !! |
14 | # it may break i*86 builds | ||
15 | |||
16 | # default ABIs to be build | ||
17 | case ${ARCH} in | ||
18 | x86_64) | ||
19 | : ${MULTILIB_ABIS="m32 m64"} | ||
20 | # default false | ||
21 | : ${EMUL_LINUX_32="false"} | ||
22 | |||
23 | # add linux32 to the dependencies | ||
24 | if [[ ${EMUL_LINUX_32} = true ]] | ||
25 | then | ||
26 | niro | 7554 | EMUL_LINUX_32_SDEPEND_x86_64=">= sys-apps/util-linux-2.19" |
27 | niro | 6406 | SPECIAL_VARS="${SPECIAL_VARS} EMUL_LINUX_32_SDEPEND_x86_64" |
28 | niro | 2 | fi |
29 | ;; | ||
30 | i*86) | ||
31 | : ${MULTILIB_ABIS="m32"} | ||
32 | # always false | ||
33 | EMUL_LINUX_32="false" | ||
34 | ;; | ||
35 | esac | ||
36 | |||
37 | # add linux32 to the dependencies | ||
38 | if [[ ${EMUL_LINUX_32} = true ]] | ||
39 | then | ||
40 | # very dirty trick to get the dependencies right | ||
41 | # ; is the IFS, tr replaces ; with an crlfs | ||
42 | # the var ist decided with our common eval+echo magic | ||
43 | if [[ -z ${SDEPEND} ]] | ||
44 | then | ||
45 | niro | 22297 | SDEPEND="$(marchsdepend EMUL_LINUX_32_SDEPEND)" |
46 | niro | 2 | else |
47 | SDEPEND="${SDEPEND} | ||
48 | niro | 22297 | $(marchsdepend EMUL_LINUX_32_SDEPEND)" |
49 | niro | 2 | fi |
50 | fi | ||
51 | |||
52 | ## | ||
53 | # overide some defaults to respect ABI_LIBDIR | ||
54 | ## | ||
55 | mlibdir() | ||
56 | { | ||
57 | local libdir=lib | ||
58 | [[ ${ARCH} = x86_64 ]] && libdir=lib64 | ||
59 | [[ -n ${ABI_LIBDIR} ]] && libdir="${ABI_LIBDIR}" | ||
60 | |||
61 | echo "${libdir}" | ||
62 | } | ||
63 | |||
64 | ## | ||
65 | # multilib abi changers | ||
66 | ## | ||
67 | abi-m32() | ||
68 | { | ||
69 | export ABI="m32" | ||
70 | export CC="gcc -${ABI}" | ||
71 | export CXX="g++ -${ABI}" | ||
72 | export ABI_LIBDIR="lib" | ||
73 | niro | 307 | if [[ ${EXPORT_ABI_LDFLAGS} != false ]] |
74 | then | ||
75 | niro | 11300 | local saved_ldflags="${LDFLAGS}" |
76 | export LDFLAGS="${LDFLAGS} -L/${ABI_LIBDIR} -L/usr/${ABI_LIBDIR}" | ||
77 | niro | 307 | fi |
78 | niro | 5371 | # keep pkgconfig clean |
79 | local orig_pkg_config_path="${PKG_CONFIG_PATH}" | ||
80 | export PKG_CONFIG_PATH="/usr/${ABI_LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}" | ||
81 | niro | 2 | |
82 | niro | 8334 | if [[ ${MULTILIB_VERBOSE} = true ]] |
83 | niro | 307 | then |
84 | niro | 8334 | echo -e "${COLBLUE}*** ${COLGREEN}running with -${ABI} ABI${COLDEFAULT}" |
85 | echo -e "${COLBLUE}*** ${COLGREEN} ABI${COLDEFAULT}='${ABI}'" | ||
86 | echo -e "${COLBLUE}*** ${COLGREEN} CC${COLDEFAULT}='${CC}'" | ||
87 | echo -e "${COLBLUE}*** ${COLGREEN} CXX${COLDEFAULT}='${CXX}'" | ||
88 | echo -e "${COLBLUE}*** ${COLGREEN} ABI_LIBDIR${COLDEFAULT}='${ABI_LIBDIR}'" | ||
89 | if [[ ${EXPORT_ABI_LDFLAGS} != false ]] | ||
90 | then | ||
91 | echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${LDFLAGS}'" | ||
92 | else | ||
93 | echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${COLYELLOW}not exported${COLDEFAULT}'" | ||
94 | fi | ||
95 | niro | 11525 | echo -e "${COLBLUE}*** ${COLGREEN} CHOST${COLDEFAULT}='${CHOST}'" |
96 | echo -e "${COLBLUE}*** ${COLGREEN} SRCDIR${COLDEFAULT}='${SRCDIR}/${SRCSUBDIR}'" | ||
97 | niro | 8334 | echo -e "${COLBLUE}*** ${COLGREEN} PKG_CONFIG_PATH${COLDEFAULT}='${PKG_CONFIG_PATH}'" |
98 | niro | 307 | fi |
99 | niro | 2 | |
100 | # configure a linux32 emulated build | ||
101 | if [[ ${EMUL_LINUX_32} = true ]] | ||
102 | then | ||
103 | niro | 8334 | if [[ ${MULTILIB_VERBOSE} = true ]] |
104 | then | ||
105 | echo -e "${COLBLUE}*** ${COLGREEN} EMUL_LINUX_32${COLDEFAULT}='${EMUL_LINUX_32}'" | ||
106 | fi | ||
107 | niro | 2 | uname(){ linux32 uname $@; } && export -f uname |
108 | niro | 11830 | local orig_chost="${CHOST}" && export CHOST="i686-pc-linux-gnu" |
109 | niro | 2 | fi |
110 | niro | 8334 | if [[ ${MULTILIB_VERBOSE} = true ]] |
111 | then | ||
112 | echo -e "${COLBLUE}*** ${COLGREEN} CHOST${COLDEFAULT}='${CHOST}'" | ||
113 | fi | ||
114 | niro | 2 | |
115 | # run any given command | ||
116 | niro | 29795 | if [[ ${MULTILIB_VERBOSE} = true ]] |
117 | then | ||
118 | echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" | ||
119 | fi | ||
120 | niro | 13974 | eval $@ || die |
121 | niro | 2 | |
122 | niro | 11300 | unset ABI CC CXX ABI_LIBDIR |
123 | niro | 5371 | # keep pkgconfig clean |
124 | export PKG_CONFIG_PATH="${orig_pkg_config_path}" | ||
125 | niro | 11300 | export LDFLAGS="${saved_ldflags}" |
126 | niro | 2 | |
127 | # restore original settings | ||
128 | if [[ ${EMUL_LINUX_32} = true ]] | ||
129 | then | ||
130 | unset uname | ||
131 | niro | 11830 | export CHOST="${orig_chost}" && unset orig_chost |
132 | niro | 2 | fi |
133 | } | ||
134 | |||
135 | abi-m64() | ||
136 | { | ||
137 | export ABI="m64" | ||
138 | export CC="gcc -${ABI}" | ||
139 | export CXX="g++ -${ABI}" | ||
140 | export ABI_LIBDIR="lib64" | ||
141 | niro | 307 | if [[ ${EXPORT_ABI_LDFLAGS} != false ]] |
142 | then | ||
143 | niro | 11300 | local saved_ldflags="${LDFLAGS}" |
144 | niro | 307 | export LDFLAGS="-L/${ABI_LIBDIR} -L/usr/${ABI_LIBDIR}" |
145 | fi | ||
146 | niro | 5371 | # keep pkgconfig clean |
147 | local orig_pkg_config_path="${PKG_CONFIG_PATH}" | ||
148 | export PKG_CONFIG_PATH="/usr/${ABI_LIBDIR}/pkgconfig:${PKG_CONFIG_PATH}" | ||
149 | niro | 2 | |
150 | niro | 8334 | if [[ ${MULTILIB_VERBOSE} = true ]] |
151 | niro | 307 | then |
152 | niro | 8334 | echo -e "${COLBLUE}*** ${COLGREEN}running with -${ABI} ABI${COLDEFAULT}" |
153 | echo -e "${COLBLUE}*** ${COLGREEN} ABI${COLDEFAULT}='${ABI}'" | ||
154 | echo -e "${COLBLUE}*** ${COLGREEN} CC${COLDEFAULT}='${CC}'" | ||
155 | echo -e "${COLBLUE}*** ${COLGREEN} CXX${COLDEFAULT}='${CXX}'" | ||
156 | echo -e "${COLBLUE}*** ${COLGREEN} ABI_LIBDIR${COLDEFAULT}='${ABI_LIBDIR}'" | ||
157 | if [[ ${EXPORT_ABI_LDFLAGS} != false ]] | ||
158 | then | ||
159 | echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${LDFLAGS}'" | ||
160 | else | ||
161 | echo -e "${COLBLUE}*** ${COLGREEN} LDFLAGS${COLDEFAULT}='${COLYELLOW}not exported${COLDEFAULT}'" | ||
162 | fi | ||
163 | echo -e "${COLBLUE}*** ${COLGREEN} CHOST${COLDEFAULT}='${CHOST}'" | ||
164 | niro | 11525 | echo -e "${COLBLUE}*** ${COLGREEN} SRCDIR${COLDEFAULT}='${SRCDIR}/${SRCSUBDIR}'" |
165 | niro | 8334 | echo -e "${COLBLUE}*** ${COLGREEN} PKG_CONFIG_PATH${COLDEFAULT}='${PKG_CONFIG_PATH}'" |
166 | niro | 307 | fi |
167 | niro | 2 | |
168 | # run any given command | ||
169 | niro | 29795 | if [[ ${MULTILIB_VERBOSE} = true ]] |
170 | then | ||
171 | echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" | ||
172 | fi | ||
173 | niro | 2 | eval $@ || die |
174 | |||
175 | niro | 11300 | unset ABI CC CXX ABI_LIBDIR |
176 | niro | 5371 | # keep pkgconfig clean |
177 | export PKG_CONFIG_PATH="${orig_pkg_config_path}" | ||
178 | niro | 11300 | export LDFLAGS="${saved_ldflags}" |
179 | niro | 2 | } |
180 | |||
181 | only-m32() | ||
182 | { | ||
183 | local abi=m32 | ||
184 | local i | ||
185 | |||
186 | for i in ${MULTILIB_ABIS} | ||
187 | do | ||
188 | if [[ ${i} = ${abi} ]] | ||
189 | then | ||
190 | # export this for mpatch etc (to repect only-${abi}) | ||
191 | export MULTILIB_ONLY_ABI=${abi} | ||
192 | |||
193 | niro | 29795 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
194 | niro | 2 | abi-${abi} $@ || die |
195 | |||
196 | # unset this is very important | ||
197 | unset MULTILIB_ONLY_ABI | ||
198 | fi | ||
199 | done | ||
200 | } | ||
201 | |||
202 | only-m64() | ||
203 | { | ||
204 | local abi=m64 | ||
205 | local i | ||
206 | |||
207 | for i in ${MULTILIB_ABIS} | ||
208 | do | ||
209 | if [[ ${i} = ${abi} ]] | ||
210 | then | ||
211 | # export this for mpatch etc (to repect only-${abi}) | ||
212 | export MULTILIB_ONLY_ABI=${abi} | ||
213 | |||
214 | niro | 29795 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
215 | niro | 2 | abi-${abi} $@ || die |
216 | |||
217 | # unset this is very important | ||
218 | unset MULTILIB_ONLY_ABI | ||
219 | fi | ||
220 | done | ||
221 | } | ||
222 | |||
223 | all-abis() | ||
224 | { | ||
225 | local abi | ||
226 | for abi in ${MULTILIB_ABIS} | ||
227 | do | ||
228 | niro | 29795 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
229 | niro | 2 | abi-${abi} $@ || die |
230 | done | ||
231 | } | ||
232 | |||
233 | niro | 6346 | mabi() |
234 | { | ||
235 | echo \${ABI} | ||
236 | } | ||
237 | |||
238 | niro | 11825 | mabi-cc() |
239 | { | ||
240 | niro | 20903 | echo "gcc -\${ABI}" |
241 | niro | 11825 | } |
242 | |||
243 | mabi-cxx() | ||
244 | { | ||
245 | niro | 20903 | echo "g++ -\${ABI}" |
246 | niro | 11825 | } |
247 | |||
248 | niro | 11828 | mabi-cflags() |
249 | { | ||
250 | niro | 20903 | echo "\${CFLAGS}" |
251 | niro | 11828 | } |
252 | |||
253 | mabi-cxxflags() | ||
254 | { | ||
255 | niro | 20903 | echo "\${CXXFLAGS}" |
256 | niro | 11828 | } |
257 | |||
258 | mabi-ldflags() | ||
259 | { | ||
260 | niro | 20903 | echo "\${LDFLAGS}" |
261 | niro | 11828 | } |
262 | |||
263 | niro | 2 | ## |
264 | # multilib compile functions | ||
265 | ## | ||
266 | |||
267 | niro | 3671 | if [[ ! -z $(typeset -f mconfigure) ]] |
268 | then | ||
269 | # rename the old one | ||
270 | old_mconfigure=old$(typeset -f mconfigure) | ||
271 | niro | 4783 | eval "${old_mconfigure}" |
272 | niro | 20987 | |
273 | niro | 2 | mconfigure() |
274 | { | ||
275 | local abi | ||
276 | local abis_to_run="${MULTILIB_ABIS}" | ||
277 | |||
278 | # respect MULTILIB_ONLY_ABI variable | ||
279 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
280 | |||
281 | for abi in ${abis_to_run} | ||
282 | do | ||
283 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
284 | niro | 2 | abi-${abi} oldmconfigure $@ || die |
285 | done | ||
286 | } | ||
287 | niro | 20987 | fi |
288 | niro | 2 | |
289 | niro | 4780 | if [[ ! -z $(typeset -f cmake_configure) ]] |
290 | then | ||
291 | # rename the old one | ||
292 | old_cmake_configure=old$(typeset -f cmake_configure) | ||
293 | niro | 4783 | eval "${old_cmake_configure}" |
294 | niro | 20987 | |
295 | niro | 4780 | cmake_configure() |
296 | { | ||
297 | local abi | ||
298 | local abis_to_run="${MULTILIB_ABIS}" | ||
299 | |||
300 | # respect MULTILIB_ONLY_ABI variable | ||
301 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
302 | |||
303 | local saved_SRCDIR="${SRCDIR}" | ||
304 | for abi in ${abis_to_run} | ||
305 | do | ||
306 | SRCDIR="${saved_SRCDIR}-${abi}" | ||
307 | niro | 21293 | # honor inside and outside build-dir builds |
308 | if [ -d ${BUILDDIR}/build-${abi} ] | ||
309 | then | ||
310 | cd ${BUILDDIR}/build-${abi} | ||
311 | else | ||
312 | niro | 22068 | cd ${SRCDIR} |
313 | niro | 21293 | fi |
314 | niro | 4780 | abi-${abi} oldcmake_configure $@ || die |
315 | done | ||
316 | niro | 9367 | # restore SRCDIR |
317 | SRCDIR="${saved_SRCDIR}" | ||
318 | niro | 4780 | } |
319 | niro | 20987 | fi |
320 | niro | 4780 | |
321 | niro | 20977 | if [[ ! -z $(typeset -f cmake_src_compile) ]] |
322 | then | ||
323 | # rename the old one | ||
324 | old_cmake_src_compile=old$(typeset -f cmake_src_compile) | ||
325 | eval "${old_cmake_src_compile}" | ||
326 | niro | 20987 | |
327 | niro | 20977 | cmake_src_compile() |
328 | { | ||
329 | local abi | ||
330 | local abis_to_run="${MULTILIB_ABIS}" | ||
331 | |||
332 | # respect MULTILIB_ONLY_ABI variable | ||
333 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
334 | |||
335 | for abi in ${abis_to_run} | ||
336 | do | ||
337 | # remove build dir if exist | ||
338 | [[ -d ${BUILDDIR}/build-${abi} ]] && rm -rf ${BUILDDIR}/build-${abi} | ||
339 | |||
340 | # build outside of the source dir | ||
341 | install -d ${BUILDDIR}/build-${abi} || die | ||
342 | cd ${BUILDDIR}/build-${abi} | ||
343 | done | ||
344 | |||
345 | cmake_configure || die | ||
346 | |||
347 | for abi in ${abis_to_run} | ||
348 | do | ||
349 | cd ${BUILDDIR}/build-${abi} | ||
350 | abi-${abi} oldmmake $@ || die | ||
351 | done | ||
352 | } | ||
353 | niro | 20987 | fi |
354 | niro | 20977 | |
355 | niro | 20978 | if [[ ! -z $(typeset -f cmake_src_check) ]] |
356 | then | ||
357 | # rename the old one | ||
358 | old_cmake_src_check=old$(typeset -f cmake_src_check) | ||
359 | eval "${old_cmake_check}" | ||
360 | niro | 20987 | |
361 | niro | 20978 | cmake_src_check() |
362 | { | ||
363 | local abi | ||
364 | local abis_to_run="${MULTILIB_ABIS}" | ||
365 | |||
366 | # respect MULTILIB_ONLY_ABI variable | ||
367 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
368 | |||
369 | for abi in ${abis_to_run} | ||
370 | do | ||
371 | niro | 22066 | # honor inside and outside build-dir builds |
372 | if [ -d ${BUILDDIR}/build-${abi} ] | ||
373 | then | ||
374 | cd ${BUILDDIR}/build-${abi} | ||
375 | else | ||
376 | niro | 22067 | cd ${SRCDIR}-${abi} |
377 | niro | 22066 | fi |
378 | niro | 20978 | mmake -j1 -k check || die |
379 | done | ||
380 | } | ||
381 | niro | 20987 | fi |
382 | niro | 20978 | |
383 | niro | 20977 | if [[ ! -z $(typeset -f cmake_src_install) ]] |
384 | then | ||
385 | # rename the old one | ||
386 | old_cmake_src_install=old$(typeset -f cmake_src_install) | ||
387 | eval "${old_cmake_install}" | ||
388 | niro | 20987 | |
389 | niro | 20977 | cmake_src_install() |
390 | { | ||
391 | local abi | ||
392 | local abis_to_run="${MULTILIB_ABIS}" | ||
393 | |||
394 | # respect MULTILIB_ONLY_ABI variable | ||
395 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
396 | |||
397 | for abi in ${abis_to_run} | ||
398 | do | ||
399 | niro | 22066 | # honor inside and outside build-dir builds |
400 | if [ -d ${BUILDDIR}/build-${abi} ] | ||
401 | then | ||
402 | cd ${BUILDDIR}/build-${abi} | ||
403 | else | ||
404 | niro | 22067 | cd ${SRCDIR}-${abi} |
405 | niro | 22066 | fi |
406 | niro | 20977 | abi-${abi} oldmmake DESTDIR=${BINDIR} $@ install || die |
407 | done | ||
408 | } | ||
409 | niro | 20987 | fi |
410 | niro | 20977 | |
411 | niro | 3671 | if [[ ! -z $(typeset -f munpack) ]] |
412 | then | ||
413 | # rename the old one | ||
414 | old_munpack=old$(typeset -f munpack) | ||
415 | eval "${old_munpack}" | ||
416 | niro | 20987 | |
417 | niro | 2 | munpack() |
418 | { | ||
419 | local abi | ||
420 | local abis_to_run="${MULTILIB_ABIS}" | ||
421 | |||
422 | # respect MULTILIB_ONLY_ABI variable | ||
423 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
424 | |||
425 | for abi in ${abis_to_run} | ||
426 | do | ||
427 | echo -e "${COLBLUE}*** ${COLGREEN}unpacking for ABI -${abi}${COLDEFAULT}" | ||
428 | niro | 13488 | oldmunpack $@ || die |
429 | niro | 2 | mv ${SRCDIR} ${SRCDIR}-${abi} || die |
430 | done | ||
431 | } | ||
432 | niro | 20987 | fi |
433 | niro | 2 | |
434 | niro | 3671 | if [[ ! -z $(typeset -f mmake) ]] |
435 | then | ||
436 | # rename the old one | ||
437 | old_mmake=old$(typeset -f mmake) | ||
438 | eval "${old_mmake}" | ||
439 | niro | 20987 | |
440 | niro | 2 | mmake() |
441 | { | ||
442 | local abi | ||
443 | local abis_to_run="${MULTILIB_ABIS}" | ||
444 | |||
445 | # respect MULTILIB_ONLY_ABI variable | ||
446 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
447 | |||
448 | for abi in ${abis_to_run} | ||
449 | do | ||
450 | echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" | ||
451 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
452 | niro | 2 | abi-${abi} oldmmake $@ || die |
453 | done | ||
454 | } | ||
455 | niro | 20987 | fi |
456 | niro | 2 | |
457 | niro | 3671 | if [[ ! -z $(typeset -f minstall) ]] |
458 | then | ||
459 | # rename the old one | ||
460 | old_minstall=old$(typeset -f minstall) | ||
461 | eval "${old_minstall}" | ||
462 | niro | 20987 | |
463 | niro | 2 | minstall() |
464 | { | ||
465 | local abi | ||
466 | local abis_to_run="${MULTILIB_ABIS}" | ||
467 | |||
468 | # respect MULTILIB_ONLY_ABI variable | ||
469 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
470 | |||
471 | for abi in ${abis_to_run} | ||
472 | do | ||
473 | echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" | ||
474 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
475 | niro | 2 | abi-${abi} oldminstall $@ || die |
476 | done | ||
477 | } | ||
478 | niro | 20987 | fi |
479 | niro | 2 | |
480 | minstall_destdir() | ||
481 | { | ||
482 | local abi | ||
483 | local abis_to_run="${MULTILIB_ABIS}" | ||
484 | |||
485 | # respect MULTILIB_ONLY_ABI variable | ||
486 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
487 | |||
488 | for abi in ${abis_to_run} | ||
489 | do | ||
490 | echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" | ||
491 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
492 | niro | 2 | make DESTDIR=${BINDIR} $@ install || die |
493 | done | ||
494 | } | ||
495 | |||
496 | niro | 3671 | if [[ ! -z $(typeset -f mpatch) ]] |
497 | then | ||
498 | # rename the old one | ||
499 | old_mpatch=old$(typeset -f mpatch) | ||
500 | eval "${old_mpatch}" | ||
501 | niro | 20987 | |
502 | niro | 2 | mpatch() |
503 | { | ||
504 | local abi | ||
505 | local abis_to_run="${MULTILIB_ABIS}" | ||
506 | |||
507 | # respect MULTILIB_ONLY_ABI variable | ||
508 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
509 | |||
510 | for abi in ${abis_to_run} | ||
511 | do | ||
512 | echo -e "${COLBLUE}*** ${COLGREEN}appling patch for ABI -${abi}${COLDEFAULT}" | ||
513 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
514 | niro | 2 | oldmpatch $@ || die |
515 | done | ||
516 | } | ||
517 | niro | 20987 | fi |
518 | niro | 2 | |
519 | niro | 3671 | if [[ ! -z $(typeset -f mlibtoolize) ]] |
520 | then | ||
521 | # rename the old one | ||
522 | old_mlibtoolize=old$(typeset -f mlibtoolize) | ||
523 | eval "${old_mlibtoolize}" | ||
524 | niro | 20987 | |
525 | niro | 2 | mlibtoolize() |
526 | { | ||
527 | local abi | ||
528 | local abis_to_run="${MULTILIB_ABIS}" | ||
529 | |||
530 | # respect MULTILIB_ONLY_ABI variable | ||
531 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
532 | |||
533 | for abi in ${abis_to_run} | ||
534 | do | ||
535 | echo -e "${COLBLUE}*** ${COLGREEN}running mlibtoolize for ABI -${abi}${COLDEFAULT}" | ||
536 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
537 | niro | 2 | oldmlibtoolize $@ || die |
538 | done | ||
539 | } | ||
540 | niro | 20987 | fi |
541 | niro | 2 | |
542 | niro | 9334 | if [[ ! -z $(typeset -f mautoreconf) ]] |
543 | then | ||
544 | # rename the old one | ||
545 | old_mautoreconf=old$(typeset -f mautoreconf) | ||
546 | eval "${old_mautoreconf}" | ||
547 | niro | 20987 | |
548 | niro | 9334 | mautoreconf() |
549 | { | ||
550 | local abi | ||
551 | local abis_to_run="${MULTILIB_ABIS}" | ||
552 | |||
553 | # respect MULTILIB_ONLY_ABI variable | ||
554 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
555 | |||
556 | for abi in ${abis_to_run} | ||
557 | do | ||
558 | echo -e "${COLBLUE}*** ${COLGREEN}running mautoreconf for ABI -${abi}${COLDEFAULT}" | ||
559 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
560 | niro | 9334 | oldmautoreconf $@ || die |
561 | done | ||
562 | } | ||
563 | niro | 20987 | fi |
564 | niro | 9334 | |
565 | niro | 9333 | if [[ ! -z $(typeset -f minstalldocs) ]] |
566 | then | ||
567 | # rename the old one | ||
568 | old_minstalldocs=old$(typeset -f minstalldocs) | ||
569 | eval "${old_minstalldocs}" | ||
570 | niro | 20987 | |
571 | niro | 2 | minstalldocs() |
572 | { | ||
573 | local abi | ||
574 | local docfiles | ||
575 | |||
576 | local abis_to_run="${MULTILIB_ABIS}" | ||
577 | |||
578 | # respect MULTILIB_ONLY_ABI variable | ||
579 | [[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" | ||
580 | |||
581 | for abi in ${abis_to_run} | ||
582 | do | ||
583 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
584 | niro | 9756 | oldminstalldocs $@ || die |
585 | niro | 2 | done |
586 | } | ||
587 | niro | 20987 | fi |
588 | niro | 2 | |
589 | ## | ||
590 | # multilib mbuild wrappers | ||
591 | ## | ||
592 | multilib_src_prepare() | ||
593 | { | ||
594 | niro | 20903 | munpack ${SRCFILE} || die |
595 | niro | 2 | } |
596 | |||
597 | multilib_src_compile() | ||
598 | { | ||
599 | niro | 20977 | if [[ ! -z $(typeset -f cmake_src_compile) ]] |
600 | then | ||
601 | cmake_src_compile || die | ||
602 | else | ||
603 | mconfigure || die | ||
604 | mmake || die | ||
605 | fi | ||
606 | niro | 2 | } |
607 | |||
608 | niro | 9902 | multilib_src_check() |
609 | { | ||
610 | niro | 20977 | if [[ ! -z $(typeset -f cmake_src_check) ]] |
611 | then | ||
612 | cmake_src_check || die | ||
613 | else | ||
614 | mmake -j1 -k check || die | ||
615 | fi | ||
616 | niro | 9902 | } |
617 | |||
618 | niro | 2 | multilib_src_install() |
619 | { | ||
620 | niro | 20977 | if [[ ! -z $(typeset -f cmake_src_install) ]] |
621 | then | ||
622 | niro | 20980 | cmake_src_install || die |
623 | niro | 20977 | else |
624 | mmake DESTDIR=${BINDIR} install || die | ||
625 | fi | ||
626 | niro | 2 | |
627 | local i | ||
628 | for abi in ${MULTILIB_ABIS} | ||
629 | do | ||
630 | niro | 11522 | cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
631 | niro | 2 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
632 | FAQ LICENSE NEWS README TODO | ||
633 | do | ||
634 | if [ -f ${SRCDIR}-${abi}/${i} ] | ||
635 | then | ||
636 | minstalldocs ${i} || die | ||
637 | fi | ||
638 | done | ||
639 | done | ||
640 | } | ||
641 | |||
642 | niro | 9902 | export_inherits multilib src_prepare src_compile src_check src_install |