Chinese translated version of Documentation/make/header_install
If you have any comment or update to the content, please contact the
original document maintainer directly. However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help. Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.
Chinese maintainer: 799942107@qq.com
---------------------------------------------------------------------
Documentation/make/header_install的中文翻译
如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。
中文版维护者: 黄佳露 799942107@qq.com
中文版翻译者: 黄佳露 799942107@qq.com
中文版校译者: 潘丽卡 774945605@qq.com
以下为正文
---------------------------------------------------------------------
Exporting kernel headers for use by userspace
导出内核文件,用于用户空间
=============================================
The "make headers_install" command exports the kernel's header files in a
form suitable for use by userspace programs.
在一个形成适合于用户空间程序中,使用“让头安装”命令出口内核的头文件。
The linux kernel's exported header files describe the API for user space
programs attempting to use kernel services. These kernel header files are
used by the system's C library (such as glibc or uClibc) to define available
system calls, as well as constants and structures to be used with these
system calls. The C library's header files include the kernel header files
from the "linux" subdirectory. The system's libc headers are usually
installed at the default location /usr/include and the kernel headers in
subdirectories under that (most notably /usr/include/linux and
/usr/include/asm).
linux内核的头文件的导出,描述了用户空间程序尝试使用内核服务的API。这些内核头文件
被用在系统的C库(例如glibc或者uClibc),可以用来定义系统调用,以及定义用来系统调用的
常量和结构。C库的头文件包括“linux”子目录的内核头文件。系统的libc标题通常安装在默认位置
/usr/include和内核头文件的子目录下(最明显的是/usr/include/linux和/usr/include/asm)。
Kernel headers are backwards compatible, but not forwards compatible. This
means that a program built against a C library using older kernel headers
should run on a newer kernel (although it may not have access to new
features), but a program built against newer kernel headers may not work on an
older kernel.
内核头文件是向后兼容的,而不是向前兼容。这意味着一个程序的建立,反对一个C库使
用旧内核头文件,它应该在一个新内核中运行(尽管它可能没有获得新的特征),但是一个
程序的建立反对相对新的内核头文件,也可能不在旧的内核上工作。
The "make headers_install" command can be run in the top level directory of the
kernel source code (or using a standard out-of-tree build). It takes two
optional arguments:
命令"make headers_install"可以在上一级目录的内核源代码中运行(或者使用一个标准的树构建)。
它需要两个可选参数:
make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr/include
ARCH indicates which architecture to produce headers for, and defaults to the
current architecture. The linux/asm directory of the exported kernel headers
is platform-specific, to see a complete list of supported architectures use
the command:
ARCH显示哪个体系结构产生头信息,以及默认当前的体系结构。linux/asm目录的导出内核头文件
是有特定平台的,这是为了看到一个完整的支持架构的列表使用下面这个命令:
ls -d include/asm-* | sed 's/.*-//'
INSTALL_HDR_PATH indicates where to install the headers. It defaults to
"./usr/include".
INSTALL_HDR_PATH显示在哪里安装头。它默认为"./usr/include".
The command "make headers_install_all" exports headers for all architectures
simultaneously. (This is mostly of interest to distribution maintainers,
who create an architecture-independent tarball from the resulting include
directory.) You also can use HDR_ARCH_LIST to specify list of architectures.
Remember to provide the appropriate linux/asm directory via "mv" or "ln -s"
before building a C library with headers exported this way.
命令"make headers_install_all"出口头同时应对所有体系结构。(这几乎是那些
维护者的兴趣,这些维护者创建了一个与体系结构无关的从结果包含目录的tarball。)
你也可以用HDR_ARCH_LIST来指定列表的体系结构。记得通过"mv"或者"ln -s"提供
适当的linux/asm目录,在构建一个带有头出口的C库之前。
The kernel header export infrastructure is maintained by David Woodhouse
<dwmw2@infradead.org>.
内核头出口基础设施是由大卫·柴棚维护的<dwmw2@infradead.org>