From b1abb2decd427e81df145b02432d7877f81be8ac Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 6 Oct 2004 21:25:11 +0000 Subject: Add .config parsing functions --- eclass/kernel-mod.eclass | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'eclass') diff --git a/eclass/kernel-mod.eclass b/eclass/kernel-mod.eclass index a0c47b335d1d..67145ae9d36e 100644 --- a/eclass/kernel-mod.eclass +++ b/eclass/kernel-mod.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-mod.eclass,v 1.8 2004/06/25 00:39:48 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-mod.eclass,v 1.9 2004/10/06 21:25:11 dsd Exp $ # This eclass provides help for compiling external kernel modules from # source. @@ -85,6 +85,47 @@ kernel-mod_getversion () einfo "Building for Linux ${KV_VERSION_FULL} found in ${KERNEL_DIR}" } +kernel-mod_configoption_present () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[ym]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_configoption_module () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[m]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_configoption_builtin () +{ + [ -e "${KERNEL_DIR}/.config" ] || die "kernel has not been configured yet" + + if egrep "^CONFIG_${1}=[y]" ${ROOT}/usr/src/linux/.config >/dev/null + then + return 0 + else + return -1 + fi +} + +kernel-mod_modules_supported () +{ + kernel-mod_configoption_builtin "MODULES" +} + kernel-mod_checkzlibinflate_configured () { einfo "Checking for status of CONFIG_ZLIB_INFLATE support in your kernel" -- cgit v1.2.3-65-gdbad