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

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

  ViewVC Help
Powered by ViewVC 1.1.20