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

Diff of /eclass/multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.24 Revision 1.28
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.24 2005/03/08 10:40:42 eradicator Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.28 2005/07/06 20:20:04 agriffis Exp $
4# 4#
5# Author: Jeremy Huddleston <eradicator@gentoo.org> 5# Author: Jeremy Huddleston <eradicator@gentoo.org>
6# 6#
7# This eclass is for all functions pertaining to handling multilib. 7# This eclass is for all functions pertaining to handling multilib.
8# configurations. 8# configurations.
9 9
10ECLASS=multilib
11INHERITED="$INHERITED $ECLASS" 10INHERITED="$INHERITED $ECLASS"
12 11
13DESCRIPTION="Based on the ${ECLASS} eclass" 12DESCRIPTION="Based on the ${ECLASS} eclass"
14 13
15# has_multilib_profile: 14# has_multilib_profile:
89### END DOCUMENTATION ### 88### END DOCUMENTATION ###
90 89
91# Defaults: 90# Defaults:
92export MULTILIB_ABIS=${MULTILIB_ABIS:-"default"} 91export MULTILIB_ABIS=${MULTILIB_ABIS:-"default"}
93export DEFAULT_ABI=${DEFAULT_ABI:-"default"} 92export DEFAULT_ABI=${DEFAULT_ABI:-"default"}
93# This causes econf to set --libdir=/usr/lib where it didn't before
94export ABI=${ABI:-"default"} 94#export ABI=${ABI:-"default"}
95export CFLAGS_default 95export CFLAGS_default
96export LDFLAGS_default 96export LDFLAGS_default
97export CHOST_default=${CHOST_default:-${CHOST}} 97export CHOST_default=${CHOST_default:-${CHOST}}
98export LIBDIR_default=${CONF_LIBDIR:-"lib"} 98export LIBDIR_default=${CONF_LIBDIR:-"lib"}
99export CDEFINE_default="__unix__" 99export CDEFINE_default="__unix__"
280# if we're in the last (or only) run through src_{unpack,compile,install} 280# if we're in the last (or only) run through src_{unpack,compile,install}
281is_final_abi() { 281is_final_abi() {
282 has_multilib_profile || return 0 282 has_multilib_profile || return 0
283 local ALL_ABIS=$(get_install_abis) 283 local ALL_ABIS=$(get_install_abis)
284 local LAST_ABI=${ALL_ABIS/* /} 284 local LAST_ABI=${ALL_ABIS/* /}
285 [[ "${LAST_ABI}" == "${ABI}" ]] 285 [[ ${LAST_ABI} == ${ABI} ]]
286} 286}
287 287
288# echo the number of ABIs we will be installing for 288# echo the number of ABIs we will be installing for
289number_abis() { 289number_abis() {
290 get_install_abis | wc -w 290 get_install_abis | wc -w
304 if [[ -z "${MULTILIB_ABIS}" ]]; then 304 if [[ -z "${MULTILIB_ABIS}" ]]; then
305 echo ${incdir} 305 echo ${incdir}
306 return 0 306 return 0
307 fi 307 fi
308 308
309 local abi=${ABI:-${DEFAULT_ABI}} 309 local abi=${ABI-${DEFAULT_ABI}}
310 if [[ ${#} -gt 0 ]]; then 310 if [[ ${#} -gt 0 ]]; then
311 abi=${1} 311 abi=${1}
312 shift 312 shift
313 fi 313 fi
314 314
402 if [[ ${sym::1} == "!" ]]; then 402 if [[ ${sym::1} == "!" ]]; then
403 echo "#ifndef ${sym:1}" 403 echo "#ifndef ${sym:1}"
404 else 404 else
405 echo "#ifdef ${sym}" 405 echo "#ifdef ${sym}"
406 fi 406 fi
407 echo "#include \"$(create_ml_includes-relative_between ${dest}/$(dirname ${file}) ${dir}/${file})\"" 407 echo "#include <$(create_ml_includes-absolute ${dir}/${file})>"
408 echo "#endif /* ${sym} */" 408 echo "#endif /* ${sym} */"
409 echo "" 409 echo ""
410 fi 410 fi
411 done 411 done
412 412
414 } > ${D}/${dest}/${file} 414 } > ${D}/${dest}/${file}
415 done 415 done
416} 416}
417 417
418# Helper function for create_ml_includes 418# Helper function for create_ml_includes
419create_ml_includes-relative_between() { 419create_ml_includes-absolute() {
420 local src="$(create_ml_includes-tidy_path ${1})"
421 local dst="$(create_ml_includes-tidy_path ${2})" 420 local dst="$(create_ml_includes-tidy_path ${1})"
422 421
423 src=(${src//\// })
424 dst=(${dst//\// }) 422 dst=(${dst//\// })
425 423
426 local i 424 local i
427 for ((i=0; i<${#src[*]}; i++)); do 425 for ((i=0; i<${#dst[*]}; i++)); do
428 [ "${dst[i]}" != "${src[i]}" ] && break 426 [ "${dst[i]}" == "include" ] && break
429 done 427 done
430 428
431 local common=$i 429 local strip_upto=$i
432 430
433 for ((i=${#src[*]}; i>common; i--)); do
434 echo -n ../
435 done
436
437 for ((i=common; i<${#dst[*]}-1; i++)); do 431 for ((i=strip_upto+1; i<${#dst[*]}-1; i++)); do
438 echo -n ${dst[i]}/ 432 echo -n ${dst[i]}/
439 done 433 done
440 434
441 echo -n ${dst[i]} 435 echo -n ${dst[i]}
442} 436}

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20