blob: 20139a84972d73c8c312317943c4af7d966974ce [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Sanitized set of kernel headers for the C library's use"
2SECTION = "devel"
3LICENSE = "GPLv2"
4
5#########################################################################
6#### PLEASE READ
7#########################################################################
8#
9# You're probably looking here thinking you need to create some new copy
10# of linux-libc-headers since you have your own custom kernel. To put
11# this simply, you DO NOT.
12#
13# Why? These headers are used to build the libc. If you customise the
14# headers you are customising the libc and the libc becomes machine
15# specific. Most people do not add custom libc extensions to the kernel
16# and have a machine specific libc.
17#
18# But you have some kernel headers you need for some driver? That is fine
19# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
20# This will make the package using them machine specific but this is much
Patrick Williamsc0f7c042017-02-23 20:41:17 -060021# better than having a machine specific C library. This does mean your
22# recipe needs a
23# do_configure[depends] += "virtual/kernel:do_shared_workdir"
24# but again, that is fine and makes total sense.
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025#
26# There can also be a case where your kernel extremely old and you want
27# an older libc ABI for that old kernel. The headers installed by this
28# recipe should still be a standard mainline kernel, not your own custom
29# one.
30#
31# -- RP
32
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Andrew Geissler5a43b432020-06-13 10:46:56 -050035RECIPE_NO_UPDATE_REASON = "Recipe is updated through a separate process"
36
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037python __anonymous () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050038 major = d.getVar("PV").split('.')[0]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039 if major == "3":
40 d.setVar("HEADER_FETCH_VER", "3.0")
41 elif major == "4":
42 d.setVar("HEADER_FETCH_VER", "4.x")
Brad Bishop19323692019-04-05 15:28:33 -040043 elif major == "5":
44 d.setVar("HEADER_FETCH_VER", "5.x")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 else:
46 d.setVar("HEADER_FETCH_VER", "2.6")
47}
48
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049inherit kernel-arch pkgconfig multilib_header
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050051KORG_ARCHIVE_COMPRESSION ?= "xz"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052
53SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054UPSTREAM_CHECK_URI = "https://www.kernel.org/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
56S = "${WORKDIR}/linux-${PV}"
57
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}""
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080060do_configure[noexec] = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050061
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080062do_compile[noexec] = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063
64do_install() {
65 oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}
66 # Kernel should not be exporting this header
67 rm -f ${D}${exec_prefix}/include/scsi/scsi.h
68
69 # The ..install.cmd conflicts between various configure runs
70 find ${D}${includedir} -name ..install.cmd | xargs rm -f
71}
72
Brad Bishop6e60e8b2018-02-01 10:27:11 -050073do_install_append_aarch64 () {
74 do_install_armmultilib
75}
76
77do_install_append_arm () {
78 do_install_armmultilib
79}
80
Brad Bishopd5ae7d92018-06-14 09:52:03 -070081do_install_append_armeb () {
82 do_install_armmultilib
83}
84
Brad Bishop6e60e8b2018-02-01 10:27:11 -050085do_install_armmultilib () {
Brad Bishop316dfdd2018-06-25 12:45:53 -040086 oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h asm/bpf_perf_event.h
Brad Bishop6e60e8b2018-02-01 10:27:11 -050087 oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h asm/statfs.h asm/swab.h asm/types.h asm/unistd.h
88}
89
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090BBCLASSEXTEND = "nativesdk"
91
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092RDEPENDS_${PN}-dev = ""
93RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
94
95INHIBIT_DEFAULT_DEPS = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050096DEPENDS += "unifdef-native bison-native rsync-native"