Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Sanitized set of kernel headers for the C library's use" |
| 2 | SECTION = "devel" |
| 3 | LICENSE = "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 |
| 21 | # better than having a machine specific C library. This does mean your |
| 22 | # recipe needs a DEPENDS += "virtual/kernel" but again, that is fine and |
| 23 | # makes total sense. |
| 24 | # |
| 25 | # There can also be a case where your kernel extremely old and you want |
| 26 | # an older libc ABI for that old kernel. The headers installed by this |
| 27 | # recipe should still be a standard mainline kernel, not your own custom |
| 28 | # one. |
| 29 | # |
| 30 | # -- RP |
| 31 | |
| 32 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" |
| 33 | |
| 34 | python __anonymous () { |
| 35 | major = d.getVar("PV",True).split('.')[0] |
| 36 | if major == "3": |
| 37 | d.setVar("HEADER_FETCH_VER", "3.0") |
| 38 | elif major == "4": |
| 39 | d.setVar("HEADER_FETCH_VER", "4.x") |
| 40 | else: |
| 41 | d.setVar("HEADER_FETCH_VER", "2.6") |
| 42 | } |
| 43 | |
| 44 | inherit kernel-arch |
| 45 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 46 | KORG_ARCHIVE_COMPRESSION ?= "xz" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | |
| 48 | SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}" |
| 49 | |
| 50 | S = "${WORKDIR}/linux-${PV}" |
| 51 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 52 | # For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE. |
| 53 | EXTRA_OEMAKE = "" |
| 54 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | do_configure() { |
| 56 | oe_runmake allnoconfig |
| 57 | } |
| 58 | |
| 59 | do_compile () { |
| 60 | } |
| 61 | |
| 62 | do_install() { |
| 63 | oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix} |
| 64 | # Kernel should not be exporting this header |
| 65 | rm -f ${D}${exec_prefix}/include/scsi/scsi.h |
| 66 | |
| 67 | # The ..install.cmd conflicts between various configure runs |
| 68 | find ${D}${includedir} -name ..install.cmd | xargs rm -f |
| 69 | } |
| 70 | |
| 71 | BBCLASSEXTEND = "nativesdk" |
| 72 | |
| 73 | #DEPENDS = "cross-linkage" |
| 74 | RDEPENDS_${PN}-dev = "" |
| 75 | RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" |
| 76 | |
| 77 | INHIBIT_DEFAULT_DEPS = "1" |
| 78 | DEPENDS += "unifdef-native" |