libusb的安装文档翻译

最近做毕业设计,课题是基于libusb的照相机驱动开发

网上关于libusb的介绍很少,大部分都是转载的同一篇文章,而且这篇文章谈到libusb的安装都会说一句,安装编译见readme,

打开libusb的readme文档一看,嘛都没有,后来发现安装方法在install这个文档里面,全英文,没关系,有道帮忙,翻译如下,我又将它们核对了一下。

原文如下

 

 

Installation Instructions
*************************

Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.

This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.

Basic Installation
==================

Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package.  The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').

   It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring.  Caching is
disabled by default to prevent problems with accidental use of stale
cache files.

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.

   The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'.  You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.

The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.

     Running `configure' might take a while.  While running, it prints
     some messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package.

  4. Type `make install' to install the programs and any data files and
     documentation.

  5. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

Compilers and Options
=====================

Some systems require unusual options for compilation or linking that the
`configure' script does not know about.  Run `./configure --help' for
details on some of the pertinent environment variables.

   You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment.  Here
is an example:

     ./configure CC=c99 CFLAGS=-g LIBS=-lposix

   *Note Defining Variables::, for more details.

Compiling For Multiple Architectures
====================================

You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you can use GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.

   With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory.  After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.

Installation Names
==================

By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc.  You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.

   In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files.  Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.

   If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.

Optional Features
=================

Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System).  The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

   For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.

Specifying the System Type
==========================

There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:

     CPU-COMPANY-SYSTEM

where SYSTEM can have one of these forms:

     OS KERNEL-OS

   See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.

   If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.

   If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.

Sharing Defaults
================

If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Defining Variables
==================

Variables not defined in a site shell script can be set in the
environment passed to `configure'.  However, some packages may run
configure again during the build, and the customized values of these
variables may be lost.  In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'.  For example:

     ./configure CC=/usr/local2/bin/gcc

causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).

Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug.  Until the bug is fixed you can use this workaround:

     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash

`configure' Invocation
======================

`configure' recognizes the following options to control how it operates.

`--help'
`-h'
     Print a summary of the options to `configure', and exit.

`--version'
`-V'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`--cache-file=FILE'
     Enable the cache: use and save the results of the tests in FILE,
     traditionally `config.cache'.  FILE defaults to `/dev/null' to
     disable caching.

`--config-cache'
`-C'
     Alias for `--cache-file=config.cache'.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.  To
     suppress all normal output, redirect it to `/dev/null' (any error
     messages will still be shown).

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`configure' also accepts some other, not widely useful, options.  Run
`configure --help' for more details.

 

翻译如下

安装指南

* * * * * * * * * * * * * * * * * * * * * * * * *’

版权(C)1994年,1995年,1996年,1999年、2000、2001、2002年、2004、2005年,

自由软件基金会——一个总部设在菲律宾的2006年。

这个文件是自由文件;自由软体基金会所赐的

无限的许可复制,发布和修改它。

 

 

 

基本安装

= = = = = = = = = = = = = = = = = =

简而言之,他有如下几个SHELL命令完成。

./configure

 make

make install

三条命令配置,建立,并安装这个开发包。以下是更详细指令解析

 

configure指令是 用来获取系统信息。(包括系统文件结构什么的)

它使用这些信息去创建一个 makefile,同时创建一个或多个.h文件。

并在这些.h文件中包含系统定义。最后会创建一个config.status脚本一个config.log脚本。

config.status脚本用来重新建立用来重新建立.h文件,config.log用来存储(configure指令的)编译信息。

 

它也可以用一个可选文件(通常是叫做“config.cache”

和带有'——cache-file = config.cache”或简单的-c文件

保存测试以加快重新配置过程。Caching在默认状态下禁止使用陈旧的

缓存文件,从而防止意外的使用(缓存文件)。

 

如果想改动库,就得先把configure搞明白。然后把修改的实现说明发给我们(地址在readme文档中),我们会考虑加入到下一个发行版本中。

如果你用缓存,config.cache可能会有你不需要的内容,你可以删除它。

 

文件configure.ac”(或“configure.in”)是用来创造

“配置”,一个项目叫做“autoconf”。你需要的configure.ac“如果

你要换掉它或再生的配置的使用一个新版本

“autoconf”。

 

编译这个包最简单的方式是:

1。“cd”  进入库文件目录

”./configure"        配置库文件系统变量。

  运行的配置的可能会花一些时间。它打印运行时,

一些消息告诉这档节目的特点就是它正在检查。

2。使用make 编译库文件

3。make check 指令让库文件进行自我检查(可选的)

4。make install指令  安装程序和任何的数据文件

5。make clean(可选)删除程序代码和目标文件 ,同时也会删除配置文件。还有一些指令是让库开发人员使用的,此处略去不谈。

 

 

编译器和选择

= = = = = = = = = = = = = = = = = = = = =

有些系统要求不寻常的选择,或者将编写

“配置的脚本不知道的。跑”。/配置——帮助”,

在一些细节相关的环境变量。

你可以让'配置的初始值的组态参数

通过建立变量在命令行或环境。这里

是一个例子:

。/配置CC = c99 CFLAGS = -g唇边= -lposix

*笔记定义变量:,因为更多的细节。

编制,多种架构

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

你可以编译包超过一种计算机

同时,把物体文档的每个建筑在他们的

自己的目录。要做到这一点,你可以使用GNU“make”。cd到”

在你想要的目录对象文件和可执行的代码去跑

“配置的脚本。“配置”的自动检查

源代码的目录”是在配置的. .”。

“要用non-GNU,这样比较安全的编写包装

建筑,每次在源代码目录。在你

安装了包的某个架构,请使用‘使distclean '之前

重组为另一个建筑。

安装的名字

= = = = = = = = = = = = = = = = = =

默认情况下,“让安装的安装包的命令下

“/使用/本地人/本”,包含文件在“/使用/本地人/包括”等。你

可以指定其他安装前缀从“/ /本地的奉献

“配置”选项'——前缀=前缀”。

你可以指定分开安装的前缀

architecture-specific文件和architecture-independent文件。如果你

通过选择'——exec-prefix =前缀的“配置”,包装的用途

前缀前缀的安装程序和库文件。

文件和其他数据文件仍然使用常规的前缀。

另外,如果你想通过一个不寻常的目录布局你能给的。

选项,如选择'——bindir =你的指定不同的值为特定

类型的文件。跑的配置——帮助'的列表,目录

你可以设置,什么类型的文件去。

如果包装的支持,你都可以使得可以安装

用额外的字首或字尾在他们的名字给的配置”

选择'——program-prefix =前缀”或“——program-suffix =后缀”。

选择功能

= = = = = = = = = = = = = = = = =

有的包注意'——enable-FEATURE意见来

“配置”,在那里特征表明一个可选的婚姻的一部分。

他们也注意'——with-PACKAGE意见,在那里的包裹

有点像“gnu-as”或“x”(x视窗系统)。这

“说明”要提到的任何'——使- '和'——-选项,

包装承认。

为的软件包,使用X视窗系统,”配置”可以经常

发现X包括和图书馆文件自动,但如果它不回来,

你可以使用的配置意见'——x-includes =你的

'——x-libraries =目录”指定他们的位置。

指定系统类型

= = = = = = = = = = = = = = = = = = = = = = = = = =

可能会有一些特征的配置的不明白自动控制,

但需要判定的类型的机器上运行的一揽子计划将会。

通常,如果包装要重盖_same_跑步

的体系结构,配置”可以发现,但如果它打印

短信它不能猜出机械型,给它

——营造=型”的选择。类型可以是一个简短的名字为系统

字体,如“sun4”,或一个标准的名字具有形式:

CPU-COMPANY-SYSTEM

在系统中所能包含这些表格之一:

操作系统KERNEL-OS

看到文件的config.sub '为可能的值的各个领域。如果

“config.sub”不包括在这个包裹,那么这个包裹没有

需要知道这个机器类型。

如果你是_building_编译器工具,交叉编译,你应该买

使用选择'——目标=型”类型的系统的选择

产生的代码。

如果你想_use_交叉编译器,能生成代码

平台,从不同的建地台,你应该详细说明

主机平台(也就是说,程序将会产生的

最终运行)与“——主人=型”。

共享违约

= = = = = = = = = = = = = = = =

如果你想去设置默认值为“配置的剧本分享,你

建立一个网站可以叫做“config.site壳的剧本出的默认值

值的变量类似“CC ',cache_file”,和“前缀”。

“配置”寻找的前缀/和config.site“如果它存在,即可

“前缀/及其他/ config.site“如果它存在。或者,你可以设置你的

“CONFIG_SITE的环境变量的位置有网站的脚本。

警告:并不是所有的“配置”脚本寻找一个站点的脚本。

定义变量

= = = = = = = = = = = = = = = = = =

未定义的变量在网站壳在脚本

通过“配置”环境。然而,有的包可能会遇到

配置建造的,期间又换了一次的定制价值的这些

变量可能会失去。为了避免这个问题,你应该设置

他们在“配置的命令行,用“VAR =价值”。例如:

。/配置CC = /使用/ local2 /本/ gcc

使指定的gcc的用来作为C编译器(除非它是

在这个网站所覆盖壳脚本)。

不幸的是,这个方法不好使“CONFIG_SHELL的分

一个Autoconf错误。直到虫是固定的你可以用这个解决办法:

CONFIG_SHELL = /本/击/本/舞会。/配置CONFIG_SHELL = /本/舞会

“配置的调用

= = = = = = = = = = = = = = = = = = = = = =

“配置”承认下列选项来控制它如何运作。

帮助' '——

“发酵的

打印一份的权配置”,并退出。

'——版本的

“中会的

打印版本的Autoconf用于产生“配置”

剧本,并退出。

'——cache-file =文件'

使缓存:使用和保存这些测试的结果在文件,

传统上的config.cache”。文件的默认的/ 368 /无效

禁用缓存。

'——config-cache的

“特别的

化名'——cache-file = config.cache”。

'——安静的

'——沉默的

“-q的

不要刊印消息说,它检查是在不断产生。到

压抑所有正常产量,重新引导“/ 368 /无效”(任何错误

信息将仍然显示)。

'——srcdir =你”

寻找包装目录中的程序的源程序目录。通常

“配置”可以确定目录自动。

“配置”也接受一些,而不是广泛有用,选择。跑

“配置——帮助的更多信息。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值