headers_install.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. =============================================
  2. Exporting kernel headers for use by userspace
  3. =============================================
  4. The "make headers_install" command exports the kernel's header files in a
  5. form suitable for use by userspace programs.
  6. The linux kernel's exported header files describe the API for user space
  7. programs attempting to use kernel services. These kernel header files are
  8. used by the system's C library (such as glibc or uClibc) to define available
  9. system calls, as well as constants and structures to be used with these
  10. system calls. The C library's header files include the kernel header files
  11. from the "linux" subdirectory. The system's libc headers are usually
  12. installed at the default location /usr/include and the kernel headers in
  13. subdirectories under that (most notably /usr/include/linux and
  14. /usr/include/asm).
  15. Kernel headers are backwards compatible, but not forwards compatible. This
  16. means that a program built against a C library using older kernel headers
  17. should run on a newer kernel (although it may not have access to new
  18. features), but a program built against newer kernel headers may not work on an
  19. older kernel.
  20. The "make headers_install" command can be run in the top level directory of the
  21. kernel source code (or using a standard out-of-tree build). It takes two
  22. optional arguments::
  23. make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr
  24. ARCH indicates which architecture to produce headers for, and defaults to the
  25. current architecture. The linux/asm directory of the exported kernel headers
  26. is platform-specific, to see a complete list of supported architectures use
  27. the command::
  28. ls -d include/asm-* | sed 's/.*-//'
  29. INSTALL_HDR_PATH indicates where to install the headers. It defaults to
  30. "./usr".
  31. An 'include' directory is automatically created inside INSTALL_HDR_PATH and
  32. headers are installed in 'INSTALL_HDR_PATH/include'.
  33. The kernel header export infrastructure is maintained by David Woodhouse
  34. <dwmw2@infradead.org>.