/[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.86 Revision 1.95
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.86 2008/10/31 22:24:55 dsd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.95 2009/09/06 23:16:37 robbat2 Exp $
4 4
5# Author(s): John Mylchreest <johnm@gentoo.org>, 5# Author(s): John Mylchreest <johnm@gentoo.org>,
6# Stefan Schweizer <genstef@gentoo.org> 6# Stefan Schweizer <genstef@gentoo.org>
7# Maintainer: kernel-misc@gentoo.org 7# Maintainer: kernel-misc@gentoo.org
8# 8#
41 41
42# @ECLASS-VARIABLE: MODULE_NAMES 42# @ECLASS-VARIABLE: MODULE_NAMES
43# @DESCRIPTION: 43# @DESCRIPTION:
44# It's a string containing the modules to be built automatically using the default 44# It's a string containing the modules to be built automatically using the default
45# src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory. 45# src_compile/src_install. It will only make ${BUILD_TARGETS} once in any directory.
46
47# 46#
48# The structure of each MODULE_NAMES entry is as follows: 47# The structure of each MODULE_NAMES entry is as follows:
49# 48#
50# modulename(libdir:srcdir:objdir) 49# modulename(libdir:srcdir:objdir)
51# 50#
52# where: 51# where:
53# 52#
54# modulename = name of the module file excluding the .ko 53# modulename = name of the module file excluding the .ko
55# libdir = place in system modules directory where module is installed: 54# libdir = place in system modules directory where module is installed (by default it's misc)
56# srcdir = place for ebuild to cd to before running make 55# srcdir = place for ebuild to cd to before running make (by default it's ${S})
57# objdir = place the .ko and objects are located after make runs 56# objdir = place the .ko and objects are located after make runs (by default it's set to srcdir)
58# 57#
59# To get an idea of how these variables are used, here's a few lines 58# To get an idea of how these variables are used, here's a few lines
60# of code from around line 540 in this eclass: 59# of code from around line 540 in this eclass:
61# 60#
62# einfo "Installing ${modulename} module" 61# einfo "Installing ${modulename} module"
137IUSE="kernel_linux" 136IUSE="kernel_linux"
138SLOT="0" 137SLOT="0"
139DESCRIPTION="Based on the $ECLASS eclass" 138DESCRIPTION="Based on the $ECLASS eclass"
140RDEPEND="kernel_linux? ( virtual/modutils )" 139RDEPEND="kernel_linux? ( virtual/modutils )"
141DEPEND="${RDEPEND} 140DEPEND="${RDEPEND}
142 sys-apps/sed" 141 sys-apps/sed
142 kernel_linux? ( virtual/linux-sources )"
143 143
144# eclass utilities 144# eclass utilities
145# ---------------------------------- 145# ----------------------------------
146 146
147check_vermagic() { 147check_vermagic() {
505 if kernel_is ge 2 6; then 505 if kernel_is ge 2 6; then
506 insinto /etc/modprobe.d 506 insinto /etc/modprobe.d
507 else 507 else
508 insinto /etc/modules.d 508 insinto /etc/modules.d
509 fi 509 fi
510 newins ${module_config} ${currm_path//*\/} 510 newins ${module_config} ${currm_path//*\/}.conf
511 511
512 # and install any documentation we might have. 512 # and install any documentation we might have.
513 [[ -n ${module_docs} ]] && dodoc ${module_docs} 513 [[ -n ${module_docs} ]] && dodoc ${module_docs}
514 done 514 done
515 eend 0 515 eend 0
613 ABI="${KERNEL_ABI}" 613 ABI="${KERNEL_ABI}"
614 614
615 BUILD_TARGETS=${BUILD_TARGETS:-clean module} 615 BUILD_TARGETS=${BUILD_TARGETS:-clean module}
616 strip_modulenames; 616 strip_modulenames;
617 cd "${S}" 617 cd "${S}"
618 touch Module.symvers
618 for i in ${MODULE_NAMES} 619 for i in ${MODULE_NAMES}
619 do 620 do
620 unset libdir srcdir objdir 621 unset libdir srcdir objdir
621 for n in $(find_module_params ${i}) 622 for n in $(find_module_params ${i})
622 do 623 do
627 objdir=${objdir:-${srcdir}} 628 objdir=${objdir:-${srcdir}}
628 629
629 if [ ! -f "${srcdir}/.built" ]; 630 if [ ! -f "${srcdir}/.built" ];
630 then 631 then
631 cd ${srcdir} 632 cd ${srcdir}
633 ln -s "${S}"/Module.symvers Module.symvers
632 einfo "Preparing ${modulename} module" 634 einfo "Preparing ${modulename} module"
633 if [[ -n ${ECONF_PARAMS} ]] 635 if [[ -n ${ECONF_PARAMS} ]]
634 then 636 then
635 econf ${ECONF_PARAMS} || \ 637 econf ${ECONF_PARAMS} || \
636 die "Unable to run econf ${ECONF_PARAMS}" 638 die "Unable to run econf ${ECONF_PARAMS}"
646 LDFLAGS=\"$(get_abi_LDFLAGS)\" \ 648 LDFLAGS=\"$(get_abi_LDFLAGS)\" \
647 ${BUILD_FIXES} \ 649 ${BUILD_FIXES} \
648 ${BUILD_PARAMS} \ 650 ${BUILD_PARAMS} \
649 ${BUILD_TARGETS} " \ 651 ${BUILD_TARGETS} " \
650 || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}" 652 || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}"
653 cd ${OLDPWD}
651 touch ${srcdir}/.built 654 touch ${srcdir}/.built
652 cd ${OLDPWD}
653 fi 655 fi
654 done 656 done
655 657
656 set_arch_to_portage 658 set_arch_to_portage
657 ABI="${myABI}" 659 ABI="${myABI}"

Legend:
Removed from v.1.86  
changed lines
  Added in v.1.95

  ViewVC Help
Powered by ViewVC 1.1.20