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

Diff of /eclass/multilib.eclass

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

Revision 1.22 Revision 1.29
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.22 2005/02/14 11:33:11 eradicator Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.29 2005/07/06 20:23:20 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"
12 10
13DESCRIPTION="Based on the ${ECLASS} eclass" 11DESCRIPTION="Based on the ${ECLASS} eclass"
14 12
15# has_multilib_profile: 13# has_multilib_profile:
16# Return true if the current profile is a multilib profile and lists more than 14# Return true if the current profile is a multilib profile and lists more than
89### END DOCUMENTATION ### 87### END DOCUMENTATION ###
90 88
91# Defaults: 89# Defaults:
92export MULTILIB_ABIS=${MULTILIB_ABIS:-"default"} 90export MULTILIB_ABIS=${MULTILIB_ABIS:-"default"}
93export DEFAULT_ABI=${DEFAULT_ABI:-"default"} 91export DEFAULT_ABI=${DEFAULT_ABI:-"default"}
92# This causes econf to set --libdir=/usr/lib where it didn't before
94export ABI=${ABI:-"default"} 93#export ABI=${ABI:-"default"}
95export CFLAGS_default="" 94export CFLAGS_default
96export LDFLAGS_default="" 95export LDFLAGS_default
97export CHOST_default=${CHOST} 96export CHOST_default=${CHOST_default:-${CHOST}}
98export LIBDIR_default=${CONF_LIBDIR:-"lib"} 97export LIBDIR_default=${CONF_LIBDIR:-"lib"}
99export CDEFINE_default="__unix__" 98export CDEFINE_default="__unix__"
100 99
101# has_multilib_profile() 100# has_multilib_profile()
102has_multilib_profile() { 101has_multilib_profile() {
187} 186}
188 187
189get_abi_CFLAGS() { get_abi_var CFLAGS "${@}"; } 188get_abi_CFLAGS() { get_abi_var CFLAGS "${@}"; }
190get_abi_LDFLAGS() { get_abi_var LDFLAGS "${@}"; } 189get_abi_LDFLAGS() { get_abi_var LDFLAGS "${@}"; }
191get_abi_CHOST() { get_abi_var CHOST "${@}"; } 190get_abi_CHOST() { get_abi_var CHOST "${@}"; }
191get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "${@}"; }
192get_abi_CDEFINE() { get_abi_var CDEFINE "${@}"; } 192get_abi_CDEFINE() { get_abi_var CDEFINE "${@}"; }
193get_abi_LIBDIR() { get_abi_var LIBDIR "${@}"; } 193get_abi_LIBDIR() { get_abi_var LIBDIR "${@}"; }
194 194
195# Return a list of the ABIs we want to install for with 195# Return a list of the ABIs we want to install for with
196# the last one in the list being the default. 196# the last one in the list being the default.
276 276
277# Return true if ${ABI} is the last ABI on our list (or if we're not 277# Return true if ${ABI} is the last ABI on our list (or if we're not
278# using the new multilib configuration. This can be used to determine 278# using the new multilib configuration. This can be used to determine
279# if we're in the last (or only) run through src_{unpack,compile,install} 279# if we're in the last (or only) run through src_{unpack,compile,install}
280is_final_abi() { 280is_final_abi() {
281 ! has_multilib_profile && return 0 281 has_multilib_profile || return 0
282 local ALL_ABIS=$(get_install_abis) 282 local ALL_ABIS=$(get_install_abis)
283 local LAST_ABI=${ALL_ABIS/* /} 283 local LAST_ABI=${ALL_ABIS/* /}
284 [ "${LAST_ABI}" = "${ABI}" ] 284 [[ ${LAST_ABI} == ${ABI} ]]
285} 285}
286 286
287# echo the number of ABIs we will be installing for 287# echo the number of ABIs we will be installing for
288number_abis() { 288number_abis() {
289 get_install_abis | wc -w 289 get_install_abis | wc -w
303 if [[ -z "${MULTILIB_ABIS}" ]]; then 303 if [[ -z "${MULTILIB_ABIS}" ]]; then
304 echo ${incdir} 304 echo ${incdir}
305 return 0 305 return 0
306 fi 306 fi
307 307
308 local abi=${ABI:-${DEFAULT_ABI}} 308 local abi=${ABI-${DEFAULT_ABI}}
309 if [[ ${#} -gt 0 ]]; then 309 if [[ ${#} -gt 0 ]]; then
310 abi=${1} 310 abi=${1}
311 shift 311 shift
312 fi 312 fi
313 313
401 if [[ ${sym::1} == "!" ]]; then 401 if [[ ${sym::1} == "!" ]]; then
402 echo "#ifndef ${sym:1}" 402 echo "#ifndef ${sym:1}"
403 else 403 else
404 echo "#ifdef ${sym}" 404 echo "#ifdef ${sym}"
405 fi 405 fi
406 echo "#include \"$(create_ml_includes-relative_between ${dest}/$(dirname ${file}) ${dir}/${file})\"" 406 echo "#include <$(create_ml_includes-absolute ${dir}/${file})>"
407 echo "#endif /* ${sym} */" 407 echo "#endif /* ${sym} */"
408 echo "" 408 echo ""
409 fi 409 fi
410 done 410 done
411 411
413 } > ${D}/${dest}/${file} 413 } > ${D}/${dest}/${file}
414 done 414 done
415} 415}
416 416
417# Helper function for create_ml_includes 417# Helper function for create_ml_includes
418create_ml_includes-relative_between() { 418create_ml_includes-absolute() {
419 local src="$(create_ml_includes-tidy_path ${1})"
420 local dst="$(create_ml_includes-tidy_path ${2})" 419 local dst="$(create_ml_includes-tidy_path ${1})"
421 420
422 src=(${src//\// })
423 dst=(${dst//\// }) 421 dst=(${dst//\// })
424 422
425 local i 423 local i
426 for ((i=0; i<${#src[*]}; i++)); do 424 for ((i=0; i<${#dst[*]}; i++)); do
427 [ "${dst[i]}" != "${src[i]}" ] && break 425 [ "${dst[i]}" == "include" ] && break
428 done 426 done
429 427
430 local common=$i 428 local strip_upto=$i
431 429
432 for ((i=${#src[*]}; i>common; i--)); do
433 echo -n ../
434 done
435
436 for ((i=common; i<${#dst[*]}-1; i++)); do 430 for ((i=strip_upto+1; i<${#dst[*]}-1; i++)); do
437 echo -n ${dst[i]}/ 431 echo -n ${dst[i]}/
438 done 432 done
439 433
440 echo -n ${dst[i]} 434 echo -n ${dst[i]}
441} 435}

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.20