1 |
commit: ad0df8153f83d2cbe3b114e335661c4cf9245335 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 9 12:00:04 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 9 12:00:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad0df815 |
7 |
|
8 |
kernel-2.eclass: Remove < 2.6 support for kernel headers |
9 |
|
10 |
The functionality removed is only to support kernels |
11 |
< 2.6 These kernels have long been removed from the tree |
12 |
|
13 |
Detail: |
14 |
Remove the function compile_headers as it is not called |
15 |
for kernels > 2.6.18 because that's when the build target |
16 |
headers_install was introduced. |
17 |
Remove supporting function compile_headers_tweak_config. |
18 |
Additionally, remove 2.6 support from install_headers. |
19 |
|
20 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
21 |
|
22 |
eclass/kernel-2.eclass | 112 +++---------------------------------------------- |
23 |
1 file changed, 5 insertions(+), 107 deletions(-) |
24 |
|
25 |
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass |
26 |
index ef70e250c17..983ba916931 100644 |
27 |
--- a/eclass/kernel-2.eclass |
28 |
+++ b/eclass/kernel-2.eclass |
29 |
@@ -759,83 +759,6 @@ unpack_fix_install_path() { |
30 |
sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' "${S}"/Makefile || die |
31 |
} |
32 |
|
33 |
-# Compile Functions |
34 |
- |
35 |
-# @FUNCTION: compile_headers |
36 |
-# @USAGE: |
37 |
-# @DESCRIPTION: |
38 |
-# header compilation |
39 |
- |
40 |
-compile_headers() { |
41 |
- env_setup_xmakeopts |
42 |
- |
43 |
- # if we couldnt obtain HOSTCFLAGS from the Makefile, |
44 |
- # then set it to something sane |
45 |
- local HOSTCFLAGS=$(getfilevar HOSTCFLAGS "${S}"/Makefile) |
46 |
- HOSTCFLAGS=${HOSTCFLAGS:--Wall -Wstrict-prototypes -O2 -fomit-frame-pointer} |
47 |
- |
48 |
- if kernel_is 2 4; then |
49 |
- yes "" | make oldconfig ${xmakeopts} |
50 |
- einfo ">>> make oldconfig complete" |
51 |
- make dep ${xmakeopts} |
52 |
- elif kernel_is 2 6; then |
53 |
- # 2.6.18 introduces headers_install which means we dont need any |
54 |
- # of this crap anymore :D |
55 |
- kernel_is ge 2 6 18 && return 0 |
56 |
- |
57 |
- # autoconf.h isnt generated unless it already exists. plus, we have |
58 |
- # no guarantee that any headers are installed on the system... |
59 |
- [[ -f ${EROOT%/}/usr/include/linux/autoconf.h ]] \ |
60 |
- || touch include/linux/autoconf.h || die |
61 |
- |
62 |
- # if K_DEFCONFIG isn't set, force to "defconfig" |
63 |
- # needed by mips |
64 |
- if [[ -z ${K_DEFCONFIG} ]]; then |
65 |
- if kernel_is ge 2 6 16; then |
66 |
- case ${CTARGET} in |
67 |
- powerpc64*) K_DEFCONFIG="ppc64_defconfig";; |
68 |
- powerpc*) K_DEFCONFIG="pmac32_defconfig";; |
69 |
- *) K_DEFCONFIG="defconfig";; |
70 |
- esac |
71 |
- else |
72 |
- K_DEFCONFIG="defconfig" |
73 |
- fi |
74 |
- fi |
75 |
- |
76 |
- # if there arent any installed headers, then there also isnt an asm |
77 |
- # symlink in /usr/include/, and make defconfig will fail, so we have |
78 |
- # to force an include path with $S. |
79 |
- HOSTCFLAGS="${HOSTCFLAGS} -I${S}/include/" |
80 |
- ln -sf asm-${KARCH} "${S}"/include/asm || die |
81 |
- cross_pre_c_headers && return 0 |
82 |
- |
83 |
- make ${K_DEFCONFIG} HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "defconfig failed (${K_DEFCONFIG})" |
84 |
- if compile_headers_tweak_config; then |
85 |
- yes "" | make oldconfig HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "2nd oldconfig failed" |
86 |
- fi |
87 |
- make prepare HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed" |
88 |
- make prepare-all HOSTCFLAGS="${HOSTCFLAGS}" ${xmakeopts} || die "prepare failed" |
89 |
- fi |
90 |
-} |
91 |
- |
92 |
-# @FUNCTION: compile_headers_tweak_config |
93 |
-# @USAGE: |
94 |
-# @DESCRIPTION: |
95 |
-# some targets can be very very picky, so let's finesse the |
96 |
-# .config based upon any info we may have |
97 |
- |
98 |
-compile_headers_tweak_config() { |
99 |
- case ${CTARGET} in |
100 |
- sh*) |
101 |
- sed -i '/CONFIG_CPU_SH/d' .config || die |
102 |
- echo "CONFIG_CPU_SH${CTARGET:2:1}=y" >> .config |
103 |
- return 0;; |
104 |
- esac |
105 |
- |
106 |
- # no changes, so lets do nothing |
107 |
- return 1 |
108 |
-} |
109 |
- |
110 |
# install functions |
111 |
|
112 |
# @FUNCTION: install_universal |
113 |
@@ -856,36 +779,12 @@ install_universal() { |
114 |
install_headers() { |
115 |
local ddir=$(kernel_header_destdir) |
116 |
|
117 |
- # 2.6.18 introduces headers_install which means we dont need any |
118 |
- # of this crap anymore :D |
119 |
- if kernel_is ge 2 6 18; then |
120 |
- env_setup_xmakeopts |
121 |
- emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts} |
122 |
- |
123 |
- # let other packages install some of these headers |
124 |
- rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc... |
125 |
- return 0 |
126 |
- fi |
127 |
- |
128 |
- # Do not use "linux/*" as that can cause problems with very long |
129 |
- # $S values where the cmdline to cp is too long |
130 |
- pushd "${S}" >/dev/null || die |
131 |
- dodir ${ddir}/linux |
132 |
- cp -pPR "${S}"/include/linux "${ED%/}"${ddir}/ || die |
133 |
- rm -rf "${ED%/}"${ddir}/linux/modules || die |
134 |
- |
135 |
- dodir ${ddir}/asm |
136 |
- cp -pPR "${S}"/include/asm/* "${ED%/}"${ddir}/asm || die |
137 |
- |
138 |
- if kernel_is 2 6; then |
139 |
- dodir ${ddir}/asm-generic |
140 |
- cp -pPR "${S}"/include/asm-generic/* "${ED%/}"${ddir}/asm-generic || die |
141 |
- fi |
142 |
- |
143 |
- # clean up |
144 |
- find "${D}" -name '*.orig' -exec rm -f {} \; || die |
145 |
+ env_setup_xmakeopts |
146 |
+ emake headers_install INSTALL_HDR_PATH="${ED%/}"${ddir}/.. ${xmakeopts} |
147 |
|
148 |
- popd >/dev/null || die |
149 |
+ # let other packages install some of these headers |
150 |
+ rm -rf "${ED%/}"${ddir}/scsi || die #glibc/uclibc/etc... |
151 |
+ return 0 |
152 |
} |
153 |
|
154 |
# @FUNCTION: install_sources |
155 |
@@ -1479,7 +1378,6 @@ kernel-2_src_prepare() { |
156 |
|
157 |
kernel-2_src_compile() { |
158 |
cd "${S}" || die |
159 |
- [[ ${ETYPE} == headers ]] && compile_headers |
160 |
|
161 |
if [[ ${K_DEBLOB_AVAILABLE} == 1 ]] && use deblob; then |
162 |
einfo ">>> Running deblob script ..." |