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

Diff of /eclass/multilib.eclass

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

Revision 1.26 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.26 2005/03/08 11:56:49 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:
403 if [[ ${sym::1} == "!" ]]; then 402 if [[ ${sym::1} == "!" ]]; then
404 echo "#ifndef ${sym:1}" 403 echo "#ifndef ${sym:1}"
405 else 404 else
406 echo "#ifdef ${sym}" 405 echo "#ifdef ${sym}"
407 fi 406 fi
408 echo "#include \"$(create_ml_includes-relative_between ${dest}/$(dirname ${file}) ${dir}/${file})\"" 407 echo "#include <$(create_ml_includes-absolute ${dir}/${file})>"
409 echo "#endif /* ${sym} */" 408 echo "#endif /* ${sym} */"
410 echo "" 409 echo ""
411 fi 410 fi
412 done 411 done
413 412
415 } > ${D}/${dest}/${file} 414 } > ${D}/${dest}/${file}
416 done 415 done
417} 416}
418 417
419# Helper function for create_ml_includes 418# Helper function for create_ml_includes
420create_ml_includes-relative_between() { 419create_ml_includes-absolute() {
421 local src="$(create_ml_includes-tidy_path ${1})"
422 local dst="$(create_ml_includes-tidy_path ${2})" 420 local dst="$(create_ml_includes-tidy_path ${1})"
423 421
424 src=(${src//\// })
425 dst=(${dst//\// }) 422 dst=(${dst//\// })
426 423
427 local i 424 local i
428 for ((i=0; i<${#src[*]}; i++)); do 425 for ((i=0; i<${#dst[*]}; i++)); do
429 [ "${dst[i]}" != "${src[i]}" ] && break 426 [ "${dst[i]}" == "include" ] && break
430 done 427 done
431 428
432 local common=$i 429 local strip_upto=$i
433 430
434 for ((i=${#src[*]}; i>common; i--)); do
435 echo -n ../
436 done
437
438 for ((i=common; i<${#dst[*]}-1; i++)); do 431 for ((i=strip_upto+1; i<${#dst[*]}-1; i++)); do
439 echo -n ${dst[i]}/ 432 echo -n ${dst[i]}/
440 done 433 done
441 434
442 echo -n ${dst[i]} 435 echo -n ${dst[i]}
443} 436}

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

  ViewVC Help
Powered by ViewVC 1.1.20