以编译bluez中的configure为模版,并补充了些选项
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables 指定环境变量(e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
配置选项Configuration:
-h, --help display this help and exit ./configure出问题的第一反应
--help=short display options specific to this package 只显示正在运行的当前脚本选项
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking...' messages 不显示脚本工作期间输出的“checking ...”消息
-C, --config-cache alias for `--cache-file=config.cache' 这个文件会很有用
--cache-file=FILE cache test results in FILE [disabled] 在FILE文件中缓存测试结果(默认禁用)
-n, --no-create do not create output files 不输出结果
--srcdir=DIR find the sources in DIR [configure dir or `..'] 指定源代码所在目录DIR
安装目录Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
--enable-layout=LAYOUT
使用名为LAYOUT的布局配置所有源代码和编译脚本。这样就允许你在安装时分别指定不同文件的安装位置。config.layout文件中包含了默认布局的示例,你可以根据它创建你自己的布局。这个文件中的不同布局使用...段进行分组,其中的FOO就是布局名。默认的布局是Apache 。
For better control, use the options below.
安装目录微调
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin] 用户可执行目录DIR 。用于存放对网站管理员很有帮助的htpasswd, dbmmanage之类的支持程序。
--sbindir=DIR system admin executables [EPREFIX/sbin] 有超级用户执行的程序
--libexecdir=DIR program executables [EPREFIX/libexec] 指定可执行支持文件的安装位置。与二进制文件相反,这些文件从来不直接由用户执行,但是可以被上面提到的二进制文件所执行
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] /etc配置文件目录
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] 可写的单一机器数据目录DIR
--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-independent data [DATAROOTDIR] Web服务器只读的体系无关数据目录DIR
--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/bluez]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
程序名称Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names 前缀
--program-suffix=SUFFIX append SUFFIX to installed program names 后缀
--program-transform-name=PROGRAM run sed PROGRAM on installed program names 这里的PROGRAM是一个sed脚本.当一个程序被安装时,他的名字将经过`sed -e PROGRAM'来产生安装的名字
系统类型System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET类型的系统,默认使用host的值
特性选项Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 一些软件包可以选择这个选项来提供为大型选项的编译时配置,例如使用Kerberos认证系统或者一个实验性的编译器最优配置.如果默认是提供这些特性,这里'FEATURE'是特性的名字
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: `make V=1')
--disable-silent-rules verbose build output (undo: `make V=0')
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--enable-static[=PKGS] build static libraries [default=no] 编译为静态库
--enable-shared[=PKGS] build shared libraries [default=yes] 编译为动态库
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-optimization disable code optimization
--disable-fortify disable compile time buffer checks
--disable-pie disable position independent executables flag
--disable-network disable network plugin
--enable-sap enable sap plugin
--disable-serial disable serial plugin
--disable-input disable input plugin
--disable-audio disable audio plugin 编译的时候有些功能我们用不到就不用编译了使用--disable- 禁用
--disable-service disable service plugin
--enable-health enable health plugin
--enable-pnat enable pnat plugin
--enable-gatt-example enable GATT example plugin
--enable-gstreamer enable GStreamer support
--enable-alsa enable ALSA support
--enable-usb enable USB support
--enable-tracer install Tracing daemon
--enable-tools install Bluetooth utilities
--enable-bccmd install BCCMD interface utility
--enable-pcmcia install PCMCIA serial script
--enable-hid2hci install HID mode switching utility
--enable-dfutool install DFU firmware upgrade utility
--enable-hidd install HID daemon
--enable-pand install PAN daemon
--enable-dund install DUN daemon
--enable-cups install CUPS backend support
--enable-test install test programs
--enable-datafiles install Bluetooth configuration and data files
--enable-debug enable compiling with debugging information 启用调试日志
--enable-maemo6 compile with maemo6 plugin
--enable-dbusoob compile with D-Bus OOB plugin
--enable-hal Use HAL to determine adapter class
--enable-capng enable capabilities support
特殊程序包选项Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-ouifile=PATH Path to the oui.txt file [auto]
--with-sap=DRIVER select SAP driver
--with-telephony=DRIVER select telephony driver
--with-systemdunitdir=DIR
path to systemd system service directory
环境变量Some influential environment variables:
PKG_CONFIG path to pkg-config utility 找不到库的时候要设置这个
例如:export PKG_CONFIG_LIBDIR=/usr/local/newbt/lib/pkgconfig/
CC C compiler command C编译器命令
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
YACC The `Yet Another C Compiler' implementation to use. Defaults to
the first program found out of: `bison -y', `byacc', `yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC.
This script will default YFLAGS to the empty string to avoid a
default value of `-d' given by some make applications.
CPP C preprocessor
DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config 与dbus有关的头文件
DBUS_LIBS linker flags for DBUS, overriding pkg-config 与dbus有关的库
GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
GLIB_LIBS linker flags for GLIB, overriding pkg-config
ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config
ALSA_LIBS linker flags for ALSA, overriding pkg-config
GSTREAMER_CFLAGS
C compiler flags for GSTREAMER, overriding pkg-config
GSTREAMER_LIBS
linker flags for GSTREAMER, overriding pkg-config
USB_CFLAGS C compiler flags for USB, overriding pkg-config
USB_LIBS linker flags for USB, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
SNDFILE_CFLAGS
C compiler flags for SNDFILE, overriding pkg-config
SNDFILE_LIBS
linker flags for SNDFILE, overriding pkg-config
CAPNG_CFLAGS
C compiler flags for CAPNG, overriding pkg-config
CAPNG_LIBS linker flags for CAPNG, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
补充:
模块选项
有两种使用模块的方法:一是静态连接进核心,二是作为DSO模块动态加载;如果编译中包含任何DSO模块,则mod_so会被自动包含进核心。如果希望核心能够装载DSO,但不实际编译任何DSO模块,则需明确指定"--enable-so=static"。
一般语法
一般情况下你可以使用如下语法启用或者禁用某个模块:
--disable-MODULE
禁用MODULE模块(仅用于基本模块)
--enable-MODULE=shared
将MODULE编译为DSO(可用于所有模块)
--enable-MODULE=static
将MODULE静态连接进核心(仅用于扩展和实验模块)
--enable-mods-shared=MODULE-LIST
将MODULE-LIST中的所有模块都编译成DSO(可用于所有模块)
--enable-modules=MODULE-LIST
将MODULE-LIST静态连接进核心(可用于所有模块)
上述 MODULE-LIST 可以是:
(1)用引号界定并且用空格分隔的模块名列表
--enable-mods-shared='headers rewrite dav'
(2)"most"(大多数模块[遇见错误模块时忽略该模块而不中断配置过程])
(3)"all"(所有模块[遇见错误模块时中断配置过程并报错])
--enable-mods-shared=most
注意
configure将忽略MODULE和MODULE-LIST中的拼写错误,注意仔细拼写。用于MODULE和MODULE-LIST中的名称是"mod_NAME"中去掉"mod_"并将剩余部分中的下划线"_"替换为连字符"-"以后的结果,比如"mod_log_config"模块应当表示为"log-config"。