developer | 93e9720 | 2024-01-17 12:29:44 +0800 | [diff] [blame] | 1 | SUMMARY = "Sanitized set of kernel headers for the C library's use" |
| 2 | HOMEPAGE = "https://www.kernel.org/" |
| 3 | DESCRIPTION = "Designed to maintain an Application Programming Interface (API) stable version of the Linux headers" |
| 4 | SECTION = "devel" |
| 5 | LICENSE = "GPLv2" |
| 6 | |
| 7 | ######################################################################### |
| 8 | #### PLEASE READ |
| 9 | ######################################################################### |
| 10 | # |
| 11 | # You're probably looking here thinking you need to create some new copy |
| 12 | # of linux-libc-headers since you have your own custom kernel. To put |
| 13 | # this simply, you DO NOT. |
| 14 | # |
| 15 | # Why? These headers are used to build the libc. If you customise the |
| 16 | # headers you are customising the libc and the libc becomes machine |
| 17 | # specific. Most people do not add custom libc extensions to the kernel |
| 18 | # and have a machine specific libc. |
| 19 | # |
| 20 | # But you have some kernel headers you need for some driver? That is fine |
| 21 | # but get them from STAGING_KERNEL_BUILDDIR where the kernel installs itself. |
| 22 | # This will make the package using them machine specific but this is much |
| 23 | # better than having a machine specific C library. This does mean your |
| 24 | # recipe needs a |
| 25 | # do_configure[depends] += "virtual/kernel:do_shared_workdir" |
| 26 | # but again, that is fine and makes total sense. |
| 27 | # |
| 28 | # There can also be a case where your kernel extremely old and you want |
| 29 | # an older libc ABI for that old kernel. The headers installed by this |
| 30 | # recipe should still be a standard mainline kernel, not your own custom |
| 31 | # one. |
| 32 | # |
| 33 | # -- RP |
| 34 | |
| 35 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814" |
| 36 | |
| 37 | python __anonymous () { |
| 38 | major = d.getVar("PV").split('.')[0] |
| 39 | if major == "3": |
| 40 | d.setVar("HEADER_FETCH_VER", "3.0") |
| 41 | elif major == "4": |
| 42 | d.setVar("HEADER_FETCH_VER", "4.x") |
| 43 | elif major == "5": |
| 44 | d.setVar("HEADER_FETCH_VER", "5.x") |
| 45 | else: |
| 46 | d.setVar("HEADER_FETCH_VER", "2.6") |
| 47 | } |
| 48 | |
| 49 | inherit kernel-arch pkgconfig multilib_header |
| 50 | |
| 51 | KORG_ARCHIVE_COMPRESSION ?= "xz" |
| 52 | |
| 53 | SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}" |
| 54 | UPSTREAM_CHECK_URI = "https://www.kernel.org/" |
| 55 | |
| 56 | S = "${WORKDIR}/linux-${PV}" |
| 57 | |
| 58 | EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}"" |
| 59 | |
| 60 | do_configure[noexec] = "1" |
| 61 | |
| 62 | do_compile[noexec] = "1" |
| 63 | |
| 64 | do_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 | |
| 73 | do_install_append_aarch64 () { |
| 74 | do_install_armmultilib |
| 75 | } |
| 76 | |
| 77 | do_install_append_arm () { |
| 78 | do_install_armmultilib |
| 79 | } |
| 80 | |
| 81 | do_install_append_armeb () { |
| 82 | do_install_armmultilib |
| 83 | } |
| 84 | |
| 85 | do_install_armmultilib () { |
| 86 | 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 |
| 87 | 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 | |
| 90 | BBCLASSEXTEND = "nativesdk" |
| 91 | |
| 92 | RDEPENDS_${PN}-dev = "" |
| 93 | RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" |
| 94 | |
| 95 | INHIBIT_DEFAULT_DEPS = "1" |
| 96 | DEPENDS += "unifdef-native bison-native rsync-native" |