summaryrefslogtreecommitdiff
path: root/eclass/linux-info.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-10 04:21:55 +0100
commit677b7ba5c317778df2ad7e70df94b9b7eec4adbc (patch)
tree6c418a1546fff5becab5d8b9ed6803323e7f316e /eclass/linux-info.eclass
parentfbda87924e6faa7a1919f1a2b4182490bde5ec5c (diff)
gentoo resync : 10.09.2021
Diffstat (limited to 'eclass/linux-info.eclass')
-rw-r--r--eclass/linux-info.eclass48
1 files changed, 28 insertions, 20 deletions
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass
index 0b6df1bf5919..4e08949a3854 100644
--- a/eclass/linux-info.eclass
+++ b/eclass/linux-info.eclass
@@ -80,6 +80,15 @@ KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}"
# There are also a couple of variables which are set by this, and shouldn't be
# set by hand. These are as follows:
+# @ECLASS-VARIABLE: KERNEL_MAKEFILE
+# @INTERNAL
+# @DESCRIPTION:
+# According to upstream documentation, by default, when make looks for the makefile, it tries
+# the following names, in order: GNUmakefile, makefile and Makefile. Set this variable to the
+# proper Makefile name or the eclass will search in this order for it.
+# See https://www.gnu.org/software/make/manual/make.html
+: ${KERNEL_MAKEFILE:=""}
+
# @ECLASS-VARIABLE: KV_FULL
# @OUTPUT_VARIABLE
# @DESCRIPTION:
@@ -195,9 +204,10 @@ getfilevar() {
unset ARCH
# We use nonfatal because we want the caller to take care of things #373151
+ # Pass need-config= to make to avoid config check in kernel Makefile.
[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
- nonfatal emake -C "${basedname}" M="${T}" ${BUILD_FIXES} -s -f - 2>/dev/null
+ nonfatal emake -C "${basedname}" M="${T}" need-config= ${BUILD_FIXES} -s -f - 2>/dev/null
ARCH=${myARCH}
fi
@@ -510,7 +520,9 @@ get_version() {
qeinfo " ${KV_DIR}"
fi
- if [ ! -s "${KV_DIR}/Makefile" ]
+ kernel_get_makefile
+
+ if [[ ! -s ${KERNEL_MAKEFILE} ]]
then
if [ -z "${get_version_warning_done}" ]; then
get_version_warning_done=1
@@ -526,9 +538,6 @@ get_version() {
# do we pass KBUILD_OUTPUT on the CLI?
local OUTPUT_DIR=${KBUILD_OUTPUT}
- # keep track of it
- KERNEL_MAKEFILE="${KV_DIR}/Makefile"
-
if [[ -z ${OUTPUT_DIR} ]]; then
# Decide the function used to extract makefile variables.
local mkfunc=$(get_makefile_extract_function "${KERNEL_MAKEFILE}")
@@ -954,20 +963,19 @@ linux-info_pkg_setup() {
linux-info_get_any_version
- if kernel_is 2 4; then
- if [ "$( gcc-major-version )" -eq "4" ] ; then
- echo
- ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with"
- ewarn "linux-2.4 (or modules building against a linux-2.4 kernel)!"
- echo
- ewarn "Either switch to another gcc-version (via gcc-config) or use a"
- ewarn "newer kernel that supports >=sys-devel/gcc-4."
- echo
- ewarn "Also, be aware that bug reports about gcc-4 not working"
- ewarn "with linux-2.4 based ebuilds will be closed as INVALID!"
- echo
- fi
- fi
-
[ -n "${CONFIG_CHECK}" ] && check_extra_config;
}
+
+# @FUNCTION: kernel_get_makefile
+# @DESCRIPTION:
+# Support the possibility that the Makefile could be one of the following and should
+# be checked in the order described here:
+# https://www.gnu.org/software/make/manual/make.html
+# Order of checking and valid Makefiles names: GNUMakefile, makefile, Makefile
+kernel_get_makefile() {
+
+ [[ -s ${KV_DIR}/GNUMakefile ]] && KERNEL_MAKEFILE="${KV_DIR}/GNUMakefile" && return
+ [[ -s ${KV_DIR}/makefile ]] && KERNEL_MAKEFILE="${KV_DIR}/makefile" && return
+ [[ -s ${KV_DIR}/Makefile ]] && KERNEL_MAKEFILE="${KV_DIR}/Makefile" && return
+
+}