Chinaunix首页 | 论坛 | 博客
  • 博客访问: 54689
  • 博文数量: 10
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 42
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-08 13:50
个人简介

如果你想造一艘船,首先应该学会对无边无际大海的渴望

文章分类
文章存档

2016年(5)

2015年(2)

2014年(3)

我的朋友

分类: LINUX

2016-04-27 20:29:44


2008-12-20 12:38

linux configure 参数解释


Linux环境下的软件安装,并不是一件容易的事情;如果通过源代码编译后在安装,当然事情就更为复杂一些;现在安装各种软件的教程都非常普遍;但万变不
离其中,对基础知识的扎实掌握,安装各种软件的问题就迎刃而解了。Configure脚本配置工具就是基础之一,它是autoconf的工具的基本应用。
'configure'脚本有大量的命令行选项.对不同的软件包来说,这些选项可能会有变化,但是许多基本的选项是不会改变的.带上'--help'选
项执行'configure'脚本可以看到可用的所有选项.尽管许多选项是很少用到的,但是当你为了特殊的需求而configure一个包时,知道他们的
存在是很有益处的.下面对每一个选项进行简略的介绍:

--cache-file=FILE
  'configure'会在你的系
统上测试存在的特性(或者bug!).为了加速随后进行的配置,测试的结果会存储在一个cache
file里.当configure一个每个子树里都有'configure'脚本的复杂的源码树时,一个很好的cache
file的存在会有很大帮助.

--help
  输出帮助信息.即使是有经验的用户也偶尔需要使用使用'--help'选项,因为一个复杂的项目会包含附加的选项.例如,GCC包里的'configure'脚本就包含了允许你控制是否生成和在GCC中使用GNU汇编器的选项.

--no-create
  'configure'中的一个主要函数会制作输出文件.此选项阻止'configure'生成这个文件.你可以认为这是一种演习(dry
run),尽管缓存(cache)仍然被改写了.

--quiet
--silent
 
 当'configure'进行他的测试时,会输出简要的信息来告诉用户正在作什么.这样作是因为'configure'可能会比较慢,没有这种输出的话
用户将会被扔在一旁疑惑正在发生什么.使用这两个选项中的任何一个都会把你扔到一旁.(译注:这两句话比较有意思,原文是这样的:If there was no
such output, the user would be left wondering what is happening. By using this
option, you too can be left
wondering!)

--version
  打印用来产生'configure'脚本的Autoconf的版本号.

--prefix=PEWFIX
 
 '--prefix'是最常用的选项.制作出的'Makefile'会查看随此选项传递的参数,当一个包在安装时可以彻底的重新安置他的结构独立部分.
举一个例子,当安装一个包,例如说Emacs,下面的命令将会使Emacs Lisp file被安装到"/opt/gnu/share":
$
./configure
--prefix=/opt/gnu

--exec-prefix=EPREFIX
  与'--prefix'选项类似,但是他是用来设置结构倚赖的文件的安装位置.编译好的'emacs'二进制文件就是这样一个问件.如果没有设置这个选项的话,默认使用的选项值将被设为和'--prefix'选项值一样.

--bindir=DIR
  指定二进制文件的安装位置.这里的二进制文件定义为可以被用户直接执行的程序.

--sbindir=DIR
  指定超级二进制文件的安装位置.这是一些通常只能由超级用户执行的程序.

--libexecdir=DIR
  指定可执行支持文件的安装位置.与二进制文件相反,这些文件从来不直接由用户执行,但是可以被上面提到的二进制文件所执行.

--datadir=DIR
  指定通用数据文件的安装位置.

--sysconfdir=DIR
  指定在单个机器上使用的只读数据的安装位置.

--sharedstatedir=DIR
  指定可以在多个机器上共享的可写数据的安装位置.

--localstatedir=DIR
  指定只能单机使用的可写数据的安装位置.

--libdir=DIR
  指定库文件的安装位置.

--includedir=DIR
  指定C头文件的安装位置.其他语言如C++的头文件也可以使用此选项.

--oldincludedir=DIR
  指定为除GCC外编译器安装的C头文件的安装位置.

--infodir=DIR
  指定Info格式文档的安装位置.Info是被GNU工程所使用的文档格式.

--mandir=DIR
  指定手册页的安装位置.

--srcdir=DIR
  这个选项对安装没有作用.他会告诉'configure'源码的位置.一般来说不用指定此选项,因为'configure'脚本一般和源码文件在同一个目录下.

--program-prefix=PREFIX
 
 指定将被加到所安装程序的名字上的前缀.例如,使用'--program-prefix=g'来configure一个名为'tar'的程序将会使安装
的程序被命名为'gtar'.当和其他的安装选项一起使用时,这个选项只有当他被`Makefile.in'文件使用时才会工作.

--program-suffix=SUFFIX
  指定将被加到所安装程序的名字上的后缀.

--program-transform-name=PROGRAM
  这里的PROGRAM是一个sed脚本.当一个程序被安装时,他的名字将经过`sed
-e
PROGRAM'来产生安装的名字.

--build=BUILD
  指定软件包安装的系统平台.如果没有指定,默认值将是'--host'选项的值.

--host=HOST
  指定软件运行的系统平台.如果没有指定,将会运行`config.guess'来检测.

--target=GARGET
  指定软件面向(target
to)的系统平台.这主要在程序语言工具如编译器和汇编器上下文中起作用.如果没有指定,默认将使用'--host'选项的值.

--disable-FEATURE
  一些软件包可以选择这个选项来提供为大型选项的编译时配置,例如使用Kerberos认证系统或者一个实验性的编译器最优配置.如果默认是提供这些特性,可以使用'--disable-FEATURE'来禁用它,这里'FEATURE'是特性的名字.例如:
$
./configure
--disable-gui

-enable-FEATURE[=ARG]
  相反的,一些软件包可能提供了一些默认被禁止的特性,可以使用'--enable-FEATURE'来起用它.这里'FEATURE'是特性的名字.一个特性可能会接受一个可选的参数.例如:
$
./configure
--enable-buffers=128
`--enable-FEATURE=no'与上面提到的'--disable-FEATURE'是同义的.

--with-PACKAGE[=ARG]
 
 在自由软件社区里,有使用已有软件包和库的优秀传统.当用'configure'来配置一个源码树时,可以提供其他已经安装的软件包的信息.例如,倚赖
于Tcl和Tk的BLT器件工具包.要配置BLT,可能需要给'configure'提供一些关于我们把Tcl和Tk装的何处的信息:
$ ./configure
--with-tcl=/usr/local
--with-tk=/usr/local
'--with-PACKAGE=no'与下面将提到的'--without-PACKAGE'是同义的.

--without-PACKAGE
  有时候你可能不想让你的软件包与系统已有的软件包交互.例如,你可能不想让你的新编译器使用GNU
ld.通过使用这个选项可以做到这一点:
$ ./configure
--without-gnu-ld

--x-includes=DIR
 
 这个选项是'--with-PACKAGE'选项的一个特例.在Autoconf最初被开发出来时,流行使用'configure'来作为Imake的
一个变通方法来制作运行于X的软件.'--x-includes'选项提供了向'configure'脚本指明包含X11头文件的目录的方法.

--x-libraries=DIR
  类似的,'--x-libraries'选项提供了向'configure'脚本指明包含X11库的目录的方法.

 
 在源码树中运行'configure'是不必要的同时也是不好的.一个由'configure'产生的良好的'Makefile'可以构筑源码属于另一
棵树的软件包.在一个独立于源码的树中构筑派生的文件的好处是很明显的:派生的文件,如目标文件,会凌乱的散布于源码树.这也使在另一个不同的系统或用不
同的配置选项构筑同样的目标文件非常困难.建议使用三棵树:一棵源码树(source tree),一棵构筑树(build tree),一棵安装树(install
tree).这里有一个很接近的例子,是使用这种方法来构筑GNU malloc包:
$ gtar zxf mmalloc-1.0.tar.gz
$
mkdir build && cd build
$ ../mmalloc-1.0/configure
creating cache
./config.cache
checking for gcc... gcc
checking whether the C compiler
(gcc ) works... yes
checking whether the C compiler (gcc ) is a
cross-compiler... no
checking whether we are using GNU C... yes
checking
whether gcc accepts -g... yes
checking for a BSD compatible install...
/usr/bin/install -c
checking host system type...
i586-pc-linux-gnu
checking build system type... i586-pc-linux-gnu
checking
for ar... ar
checking for ranlib... ranlib
checking how to run the C
preprocessor... gcc -E
checking for unistd.h... yes
checking for
getpagesize... yes
checking for working mmap... yes
checking for
limits.h... yes
checking for stddef.h... yes
updating cache
../config.cache
creating
./config.status
这样这棵构筑树就被配置了,下面可以继续构筑和安装这个包到默认的位置'/usr/local':
$ make all
&& make install


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1440383



用于配置的参数(configure)configure 里可用的参数集可以通过键入下面命令获得$
./configure --help下面的参数可能会引起安装者的兴趣:Directories to install PostgreSQL in(安装
postgreSQL 的目录): --prefix=PREFIX         install architecture-independent files
in PREFIX(把体系无关的文件装在 PREFIX)                          [/usr/local/pgsql]
--bindir=DIR            user executables in DIR (用户的可执行文件装在 DIR )[EPREFIX/bin]
--libdir=DIR            object code libraries in DIR (目标代码库在 DIR )[EPREFIX/lib]
--includedir=DIR        C header files in DIR (C 头文件放在 DIR)[PREFIX/include]
--mandir=DIR            man documentation in DIR (手册文档在 DIR
)[PREFIX/man]Features and packages(特性和包): --disable-FEATURE       do not include
FEATURE (same as --enable-FEATURE=no)(不包含 FEATURE (等效于 --enable-FEATURE=no))
--enable-FEATURE[=ARG] include FEATURE (包含 FEATURE )[ARG=yes]
--with-PACKAGE[=ARG]    use PACKAGE (使用 PACKAGE)[ARG=yes]
--without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)(不使用
PACKAGE (等效于 --with-PACKAGE=no))--enable and --with options
recognized(可识别的附加选项):
--with-template=template                          use
operating system template file(使用操作系统模板文件)                              see
template directory(参阅模板目录) --with-includes=dirs    look for
header files for tcl/tk, etc in DIRS(tk/tcl等的头文件在 DIR)
--with-libraries=dirs   look for additional libraries in
DIRS(在DIR里查找附加库) --with-libs=dirs        alternate spelling of
--with-libraries(--with-libraries 的可选写法) --enable-locale         enable locale
support(打开本地化支持) --enable-recode         enable cyrillic recode
support(打开西里尔字母(斯拉夫语言字母)记录的支持) --enable-multibyte      enable multibyte
character support(打开多字节支持) --with-pgport=portnum   change
default postmaster port(更改缺省的启动端口) --with-maxbackends=n    set
default maximum number of server processes (设置缺省的最大服务器进程数)
--with-tcl              build Tcl interfaces and pgtclsh(制作 Tcl 接口和 pgtclsh)
--with-tclconfig=tcldir                          tclConfig.sh
and tkConfig.sh are in DIR(tclConfig.sh 和 tkConfig.sh 在 DIR)
--with-perl             build Perl interface and plperl(制作 Perl 接口和plperl)
--with-odbc             build ODBC driver package(制作 ODBC 驱动包)
--with-odbcinst=odbcdir                          change
default directory for odbcinst.ini(为 odbcinst.ini 改变缺省路径)
--enable-cassert        enable assertion checks (for debugging)(打开断言检查 (调试))
--enable-debug          build with debugging symbols (-g) (带调试符号(-g)制作)
--with-CC=compiler                          use specific C
compiler(使用声明的 C 编译器)
--with-CXX=compiler                          use specific C++
compiler(使用声明的 C++ 编译器) --without-CXX           prevent building C++ code (禁止制作
C++ 代码)有些系统在制作 Postgres 的一些特性时有问题.例如,有些系统的 C++ 编译器坏了,可能就需要声明
--without-CXX 告诉制作过程忽略 libpq++ 的制作.

如果你想用安装在非相同标准查找路径里的头文件或库制作 Postgres ,请使用 --with-includes 和
--with-libraries 选项.例如,你可能用这些制作一个实验版本的
Tcl.如果你需要为头文件或库声明超过一个的非标准目录,这样做:

--with-includes="/opt/tcl/include
/opt/perl5/include"

[root@web ffmpeg]# ./configure --help
Usage: configure
[options]
Options: [defaults in brackets after descriptions]


Standard options: 基本选项参数
--help                   显示此帮助信息|print this
message
--log[=FILE|yes|no]      记录测试并输出到config.err文件|log tests and output to
FILE [config.err]
--prefix=PREFIX          安装程序到指定目录(默认/usr/local)|install in
PREFIX [/usr/local]
--libdir=DIR             安装库到指定目录(默认prefix/lib)|install
libs in DIR [PREFIX/lib]
--shlibdir=DIR          
指定共享库路径(默认prefix/lib)|install shared libs in DIR
[PREFIX/lib]
--incdir=DIR            
指定includes路径(默认prefix/include/ffmpeg)|install includes in
DIR[PREFIX/include/ffmpeg]
--mandir=DIR             指定man
page路径(默认prefix/man)install man page in DIR
[PREFIX/man]
--enable-mp3lame         启用mp3编码libmp3lame(默认关闭)enable MP3
encoding via libmp3lame[default=no]
--enable-libogg         
启用ogg支持libogg(默认关闭)enable Ogg support via libogg
[default=no]
--enable-vorbis          启用Vorbis支持libvorbis(默认关闭)enable Vorbis
support via libvorbis [default=no]
--enable-faad           
启用faad支持libfaad(默认关闭)enable FAAD support via libfaad
[default=no]
--enable-faadbin         启用faad运行时链接支持(默认关闭)build FAAD support
with runtime linking[default=no]
--enable-faac           
启用faac支持libfaac(默认关闭)enable FAAC support via libfaac
[default=no]
--enable-libgsm          启用GSM支持libgsm(默认关闭)enable GSM support
via libgsm [default=no]
--enable-xvid            启用xvid支持xvidcore(默认关闭)enable
XviD support via xvidcore [default=no]
--enable-x264           
启用H.264编码(默认关闭)enable H.264 encoding via x264
[default=no]
--enable-mingw32         启用MinGW本地/交叉win环境编译|enable MinGW
native/cross Windows compile
--enable-mingwce        
启用MinGW本地/交叉winCE环境编译enable MinGW native/cross WinCE
compile
--enable-a52             启用A52支持(默认关闭)enable GPLed A52 support
[default=no]
--enable-a52bin          启用运行时打开liba52.so.0(默认关闭)open
liba52.so.0 at runtime [default=no]
--enable-dts            
启用DTS支持(默认关闭)enable GPLed DTS support [default=no]
--enable-pp             
启用后加工支持(默认关闭)enable GPLed postprocessing support
[default=no]
--enable-static          构建静态库(默认启用)build static libraries
[default=yes]
--disable-static         禁止构建静态库(默认关闭)do not build static
libraries [default=no]
--enable-shared          构建共享库(默认关闭)build shared
libraries [default=no]
--disable-shared         禁止构建共享库(默认启用)do not build
shared libraries [default=yes]
--enable-amr_nb          启用amr_nb
float音频编解码器|enable amr_nb float audio codec
--enable-amr_nb-fixed    启用fixed
amr_nb codec | use fixed point for amr-nb codec
--enable-amr_wb         
启用amr_wb float音频编解码器|enable amr_wb float audio codec
--enable-amr_if2        
启用amr_wb IF2音频编解码器|enable amr_wb IF2 audio codec
--enable-sunmlib        
启用Sun medialib(默认关闭) | use Sun medialib [default=no]
--enable-pthreads       
启用pthreads(多线程)(默认关闭)use pthreads [default=no]
--enable-dc1394         
启用libdc1394、libraw1394抓取IIDC-1394(默认关闭)enable IIDC-1394 grabbing using libdc1394
and libraw1394 [default=no]
--enable-swscaler        启用计数器支持?(默认关闭)software
scaler support [default=no]
--enable-avisynth       
允许读取AVISynth脚本本件(默认关闭)allow reading AVISynth script files
[default=no]
--enable-gpl             允许使用GPL(默认关闭)allow use of GPL code, the
resulting libav* and ffmpeg will be under GPL [default=no]


Advanced options (experts only): 高级选项参数(供专业人员使用)
--source-path=PATH      
源码的路径(当前为/root/flv/ffmpeg)| path to source code
[/root/flv/ffmpeg]
--cross-prefix=PREFIX    为编译工具指定路径 | use PREFIX for
compilation tools []
--cross-compile          假定使用了交叉编译 | assume a
cross-compiler is used
--cc=CC                  指定使用何种C编译器(默认gcc)use C
compiler CC [gcc]
--make=MAKE              使用特定的make | use specified make
[make]
--extra-cflags=ECFLAGS   添加ECFLAGS到CFLAGS | add ECFLAGS to CFLAGS
[]
--extra-ldflags=ELDFLAGS 添加ELDFLAGS到LDFLAGS(默认-Wl,--as-needed)| add
ELDFLAGS to LDFLAGS [ -Wl,--as-needed]
--extra-libs=ELIBS       添加ELIBS | add
ELIBS []
--build-suffix=SUFFIX    为专用程序添加后缀 | suffix for application specific
build []
--arch=ARCH              选择机器架构(默认x86)select architecture
[x86]
--cpu=CPU                选用最低的cpu(影响指令的选择,可以在老CPU上出错) | selects the
minimum cpu required (affects instruction selection, may crash on older
CPUs)
--powerpc-perf-enable    启用PPC上面的性能报告(需要启用PMC)enable performance report
on PPC
                           (requires enabling
PMC)
--disable-mmx            禁用MMX | disable MMX
usage
--disable-armv5te        禁用armv5te | disable armv5te
usage
--disable-iwmmxt         禁用iwmmxt | disable iwmmxt
usage
--disable-altivec        禁用AltiVec | disable AltiVec
usage
--disable-audio-oss      禁用OSS音频支持(默认启用)disable OSS audio support
[default=no]
--disable-audio-beos     禁用BeOS音频支持(默认启用)disable BeOS audio
support [default=no]
--disable-v4l            禁用video4linux提取(默认启用)disable
video4linux grabbing [default=no]
--disable-v4l2          
禁用video4linux2提取(默认启用)disable video4linux2 grabbing
[default=no]
--disable-bktr           禁用bktr视频提取(默认启用)disable bktr video
grabbing [default=no]
--disable-dv1394         禁用DV1394提取(默认启用)disable DV1394
grabbing [default=no]
--disable-network        禁用网络支持(默认支持)disable network
support [default=no]
--disable-ipv6           禁用ipv6支持(默认支持)disable ipv6
support [default=no]
--disable-zlib           禁用zlib(默认支持)disable zlib
[default=no]
--disable-simple_idct    禁用simple IDCT例程(默认启用)disable simple
IDCT routines [default=no]
--disable-vhook          禁用video hooking支持 |
disable video hooking support
--enable-gprof           enable profiling with
gprof [no]
--disable-debug          禁用调试符号 | disable debugging
symbols
--disable-opts           禁用编译器最优化 | disable compiler
optimizations
--disable-mpegaudio-hp   启用更快的解码MPEG音频(但精确度较低)(默认禁用)faster (but
less accurate) MPEG audio decoding [default=no]
--disable-protocols      禁用
I/O 协议支持(默认启用)disable I/O protocols support
[default=no]
--disable-ffserver       禁用生成ffserver | disable ffserver
build
--disable-ffplay         禁用生成ffplay | disable ffplay
build
--enable-small           启用优化文件尺寸大小(牺牲速度)optimize for size instead of
speed
--enable-memalign-hack   启用模拟内存排列,由内存调试器干涉? | emulate memalign,
interferes with memory debuggers
--disable-strip          禁用剥离可执行程序和共享库 |
disable stripping of executables and shared
libraries
--disable-encoder=NAME   禁用XX编码器 | disables encoder
NAME
--enable-encoder=NAME    启用XX编码器 | enables encoder
NAME
--disable-decoder=NAME   禁用XX解码器 | disables decoder
NAME
--enable-decoder=NAME    启用XX解码器 | enables decoder
NAME
--disable-encoders       禁用所有编码器 | disables all
encoders
--disable-decoders       禁用所有解码器 | disables all
decoders
--disable-muxer=NAME     禁用XX混音器 | disables muxer
NAME
--enable-muxer=NAME      启用XX混音器 | enables muxer
NAME
--disable-muxers         禁用所有混音器 | disables all
muxers
--disable-demuxer=NAME   禁用XX解轨器 | disables demuxer
NAME
--enable-demuxer=NAME    启用XX解轨器 | enables demuxer
NAME
--disable-demuxers       禁用所有解轨器 | disables all
demuxers
--enable-parser=NAME     启用XX剖析器 | enables parser
NAME
--disable-parser=NAME    禁用XX剖析器 | disables parser
NAME
--disable-parsers        禁用所有剖析器 | disables all parsers


原文:http://blogger.org.cn/blog/more.asp?name=lhwork&id=22496



阅读(2127) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~