使用 ./configure –help可以查看configure的相关配置,显示内容如下:
`configure'configures this package to adapt to many kinds of systems.
Usage:./configure [OPTION]... [VAR=VALUE]...
Toassign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of theuseful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to thispackage
--help=recursive display the short help of all the includedpackages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure diror `..']
Installationdirectories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
Bydefault, `make install' will install all the files in
`/usr/local/bin',`/usr/local/lib' etc. You can specify
aninstallation prefix other than `/usr/local' using `--prefix',
forinstance `--prefix=$HOME'.
Forbetter control, use the options below.
Finetuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables[EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data[PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data[PREFIX/com]
--localstatedir=DIR modifiable single-machine data[PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root[PREFIX/share]
--datadir=DIR read-only architecture-independentdata [DATAROOTDIR]
--infodir=DIR info documentation[DATAROOTDIR/info]
--localedir=DIR locale-dependent data[DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root[DATAROOTDIR/doc/PACKAGE]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
Programnames:
--program-prefix=PREFIX prepend PREFIX to installed programnames
--program-suffix=SUFFIX append SUFFIX to installed programnames
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
Systemtypes:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to runon HOST [BUILD]
--target=TARGET configure for building compilers for TARGET[HOST]
OptionalFeatures:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as--enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-as-accelerator-for=ARG
build as offloadtarget compiler. Specify offload
host triple by ARG
--enable-offload-targets=LIST
enable offloading todevices from comma-separated
LIST of TARGET[=DIR].Use optional path to find
offload targetcompiler during the build
--enable-gold[=ARG] build gold [ARG={default,yes,no}]
--enable-ld[=ARG] build ld [ARG={default,yes,no}]
--disable-libquadmath do not build libquadmath directory
--disable-libquadmath-support
disable libquadmathsupport for Fortran
--enable-libada build libada directory
--enable-libssp build libssp directory
--disable-libstdcxx do not build libstdc++-v3 directory
--enable-liboffloadmic=ARG
build liboffloadmic[ARG={no,host,target}]
--enable-static-libjava[=ARG]
build static libjava[default=no]
--enable-bootstrap enable bootstrapping [yes if nativebuild]
--disable-isl-version-check
disable check for ISLversion
--enable-lto enable link timeoptimization support
--enable-linker-plugin-configure-flags=FLAGS
additional flags forconfiguring linker plugins
[none]
--enable-linker-plugin-flags=FLAGS
additional flags for configuring andbuilding linker
plugins [none]
--enable-stage1-languages[=all]
choose additionallanguages to build during stage1.
Mostly useful forcompiler development
--enable-objc-gc enable use of Boehm's garbage collectorwith the GNU
Objective-C runtime
--enable-vtable-verify Enable vtable verification feature
--enable-serial-[{host,target,build}-]configure
force sequentialconfiguration of sub-packages for
the host, target orbuild machine, or all
sub-packages
--enable-maintainer-mode
enable make rules anddependencies not useful (and
sometimes confusing)to the casual installer
--enable-stage1-checking[=all]
choose additionalchecking for stage1 of the
compiler
--enable-werror enable -Werror in bootstrap stage2 andlater
--enable-host-shared build host code as shared libraries
OptionalPackages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-build-libsubdir=DIR Directory where to find libraries for buildsystem
--with-mpc=PATH specify prefix directory for installedMPC package.
Equivalent to--with-mpc-include=PATH/include plus
--with-mpc-lib=PATH/lib
--with-mpc-include=PATH specify directory forinstalled MPC include files
--with-mpc-lib=PATH specify directory for the installed MPClibrary
--with-mpfr-dir=PATH this option has been REMOVED
--with-mpfr=PATH specify prefix directory for installedMPFR package.
Equivalent to--with-mpfr-include=PATH/include plus
--with-mpfr-lib=PATH/lib
--with-mpfr-include=PATH
specify directory forinstalled MPFR include files
--with-mpfr-lib=PATH specify directory for the installed MPFRlibrary
--with-gmp-dir=PATH this option has been REMOVED
--with-gmp=PATH specify prefix directory for theinstalled GMP
package. Equivalent to
--with-gmp-include=PATH/include plus
--with-gmp-lib=PATH/lib
--with-gmp-include=PATH specify directory forinstalled GMP include files
--with-gmp-lib=PATH specify directory for the installed GMPlibrary
--with-host-libstdcxx=L use linker argumentsL to link with libstdc++ when
linking with PPL
--with-stage1-libs=LIBS libraries for stage1
--with-stage1-ldflags=FLAGS
linker flags for stage1
--with-boot-libs=LIBS libraries for stage2 and later
--with-boot-ldflags=FLAGS
linker flags forstage2 and later
--with-isl=PATH Specify prefix directory for the installedISL
package. Equivalentto
--with-isl-include=PATH/include plus
--with-isl-lib=PATH/lib
--with-isl-include=PATH Specify directory forinstalled ISL include files
--with-isl-lib=PATH Specify the directory for the installedISL library
--with-build-sysroot=SYSROOT
use sysroot as thesystem root during the build
--with-debug-prefix-map='A=B C=D ...'
map A to B, C to D... in debug information
--with-build-config='NAME NAME2...'
use config/NAME.mkbuild configuration
--with-build-time-tools=PATH
use given path tofind target tools during the build
Someinfluential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <libdir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandarddirectory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
build_configargs
additional configure arguments forbuild directories
host_configargs
additional configure argumentsfor host directories
target_configargs
additional configure argumentsfor target directories
AR AR for the host
AS AS for the host
DLLTOOL DLLTOOL for the host
LD LD for the host
LIPO LIPO for the host
NM NM for the host
RANLIB RANLIB for the host
STRIP STRIP for the host
WINDRES WINDRES for the host
WINDMC WINDMC for the host
OBJCOPY OBJCOPY for the host
OBJDUMP OBJDUMP for the host
READELF READELF for the host
CC_FOR_TARGET
CC for the target
CXX_FOR_TARGET
CXX for the target
GCC_FOR_TARGET
GCC for the target
GCJ_FOR_TARGET
GCJ for the target
GFORTRAN_FOR_TARGET
GFORTRAN for the target
GOC_FOR_TARGET
GOC for the target
AR_FOR_TARGET
AR for the target
AS_FOR_TARGET
AS for the target
DLLTOOL_FOR_TARGET
DLLTOOL for the target
LD_FOR_TARGET
LD for the target
LIPO_FOR_TARGET
LIPO for the target
NM_FOR_TARGET
NM for the target
OBJCOPY_FOR_TARGET
OBJCOPY for the target
OBJDUMP_FOR_TARGET
OBJDUMP for the target
RANLIB_FOR_TARGET
RANLIB for the target
READELF_FOR_TARGET
READELF for the target
STRIP_FOR_TARGET
STRIP for the target
WINDRES_FOR_TARGET
WINDRES for the target
WINDMC_FOR_TARGET
WINDMC for the target
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
可以看出该命令主要用于编译命令make前做一些配置。这里只对其中几个做一下解释。
--prefix
'--prefix'是最常用的选项.默认情况下,make install会安装文件在/usr/local/bin,/usr/local/lib等命令下。使用--prefix可以改变安装位置,如设置安装到主文件夹下:--prefix=$HOME。
--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'是同义的.
有时候你可能不想让你的软件包与系统已有的软件包交互.例如,你可能不想让你的新编译器使用GNUld.通过使用这个选项可以做到这一点:
$./configure --without-gnu-ld