headers_install.txt 2.3 KB

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