/[gentoo-x86]/eclass/linux-mod.eclass
Gentoo

Diff of /eclass/linux-mod.eclass

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

Revision 1.62 Revision 1.64
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/linux-mod.eclass,v 1.62 2006/03/26 17:47:19 blubb Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.64 2006/05/11 08:23:43 johnm Exp $
4 4
5# Description: This eclass is used to interface with linux-info in such a way 5# Description: This eclass is used to interface with linux-info in such a way
6# to provide the functionality required and initial functions 6# to provide the functionality required and initial functions
7# required to install external modules against a kernel source 7# required to install external modules against a kernel source
8# tree. 8# tree.
462# -------------------------------- 462# --------------------------------
463 463
464linux-mod_pkg_setup() { 464linux-mod_pkg_setup() {
465 linux-info_pkg_setup; 465 linux-info_pkg_setup;
466 check_kernel_built; 466 check_kernel_built;
467 check_modules_supported; 467 strip_modulenames;
468 [[ -n ${MODULE_NAMES} ]] && check_modules_supported
468 set_kvobj; 469 set_kvobj;
469 # Commented out with permission from johnm until a fixed version for arches 470 # Commented out with permission from johnm until a fixed version for arches
470 # who intentionally use different kernel and userland compilers can be 471 # who intentionally use different kernel and userland compilers can be
471 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005 472 # introduced - Jason Wever <weeve@gentoo.org>, 23 Oct 2005
472 #check_vermagic; 473 #check_vermagic;
473} 474}
474 475
476strip_modulenames() {
477 local i
478 for i in ${MODULE_IGNORE}; do
479 MODULE_NAMES=${MODULE_NAMES//${i}(*}
480 done
481}
482
475linux-mod_src_compile() { 483linux-mod_src_compile() {
476 local modulename libdir srcdir objdir i n myARCH="${ARCH}" myABI="${ABI}" 484 local modulename libdir srcdir objdir i n myARCH="${ARCH}" myABI="${ABI}"
477 ARCH="$(tc-arch-kernel)" 485 ARCH="$(tc-arch-kernel)"
478 ABI="${KERNEL_ABI}" 486 ABI="${KERNEL_ABI}"
487 CC_HOSTCC=$(tc-getBUILD_CC)
488 CC_CC=$(tc-getCC)
479 489
480 BUILD_TARGETS=${BUILD_TARGETS:-clean module} 490 BUILD_TARGETS=${BUILD_TARGETS:-clean module}
481 491 strip_modulenames;
482 for i in ${MODULE_IGNORE}
483 do
484 MODULE_NAMES=${MODULE_NAMES//${i}(*}
485 done
486
487 for i in ${MODULE_NAMES} 492 for i in ${MODULE_NAMES}
488 do 493 do
489 unset libdir srcdir objdir 494 unset libdir srcdir objdir
490 for n in $(find_module_params ${i}) 495 for n in $(find_module_params ${i})
491 do 496 do
503 then 508 then
504 econf ${ECONF_PARAMS} || \ 509 econf ${ECONF_PARAMS} || \
505 die "Unable to run econf ${ECONF_PARAMS}" 510 die "Unable to run econf ${ECONF_PARAMS}"
506 fi 511 fi
507 512
513 emake HOSTCC=${CC_HOSTCC} CC=${CC_CC}\
508 emake ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \ 514 ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} \
509 || die "Unable to make \ 515 || die "Unable to make \
510 ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}." 516 ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}."
511 touch ${srcdir}/.built 517 touch ${srcdir}/.built
512 cd ${OLDPWD} 518 cd ${OLDPWD}
513 fi 519 fi
518} 524}
519 525
520linux-mod_src_install() { 526linux-mod_src_install() {
521 local modulename libdir srcdir objdir i n 527 local modulename libdir srcdir objdir i n
522 528
523 for i in ${MODULE_IGNORE} 529 strip_modulenames;
524 do
525 MODULE_NAMES=${MODULE_NAMES//${i}(*}
526 done
527
528 for i in ${MODULE_NAMES} 530 for i in ${MODULE_NAMES}
529 do 531 do
530 unset libdir srcdir objdir 532 unset libdir srcdir objdir
531 for n in $(find_module_params ${i}) 533 for n in $(find_module_params ${i})
532 do 534 do

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.20